Changeset 235 for branches/xpascal/Parsers
- Timestamp:
- Jun 27, 2023, 10:09:21 AM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/xpascal/Parsers/ParserPascal.pas
r233 r235 44 44 implementation 45 45 46 resourcestring 47 SExpectedFunctionParameter = 'Expected function parameter.'; 48 SExpectedProcedureParameter = 'Expected procedure parameter.'; 49 SFunctionParameterMismatch = 'Function parameter mismatch.'; 50 SUnexpectedToken = 'Unexpected token %s'; 51 46 52 function TParserPascal.ParseBeginEnd(Block: TBlock; out BeginEnd: TBeginEnd): Boolean; 47 53 var … … 57 63 Tokenizer.Expect(';', tkSpecialSymbol); 58 64 end else begin 59 Error( 'Unexpected token ' + Tokenizer.GetNext.Text);65 Error(Format(SUnexpectedToken, [Tokenizer.GetNext.Text])); 60 66 Result := False; 61 67 Break; … … 88 94 if Expression.GetType = TFunctionParameter(FunctionDef.Params[I]).TypeRef then 89 95 FunctionCall.Params.Add(Expression) 90 else Error( 'Function parameter mismatch.');91 end else Error( 'Expected function parameter.');96 else Error(SFunctionParameterMismatch); 97 end else Error(SExpectedFunctionParameter); 92 98 end; 93 99 Tokenizer.Expect(')', tkSpecialSymbol); … … 126 132 if Expression.GetType = TFunctionParameter(ProcedureDef.Params[I]).TypeRef then 127 133 ProcedureCall.Params.Add(Expression) 128 else Error( 'Function parameter mismatch.');129 end else Error( 'Expected procedure parameter.');134 else Error(SFunctionParameterMismatch); 135 end else Error(SExpectedProcedureParameter); 130 136 end; 131 137 Tokenizer.Expect(')', tkSpecialSymbol); … … 396 402 if ParseFunctionParameter(Block, FunctionParameter) then begin 397 403 Params.Add(FunctionParameter); 398 end else Error( 'Expected function parameter.');404 end else Error(SExpectedFunctionParameter); 399 405 end; 400 406 Tokenizer.Expect(')', tkSpecialSymbol);
Note:
See TracChangeset
for help on using the changeset viewer.