Changeset 233 for branches/xpascal/Tokenizer.pas
- Timestamp:
- Jun 26, 2023, 6:08:23 PM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/xpascal/Tokenizer.pas
r224 r233 62 62 implementation 63 63 64 resourcestring 65 SUnknownToken = 'Unknown token %s'; 66 SUnsupportedTokenizerState = 'Unsupported tokenizer state.'; 67 SExpectedButFound = 'Expected %s but %s found.'; 68 64 69 { TToken } 65 70 … … 155 160 (Text = 'else') or (Text = 'while') or (Text = 'do') or (Text = 'for') or 156 161 (Text = 'to') or (Text = 'repeat') or (Text = 'until') or (Text = 'break') or 157 (Text = 'continue') or (Text = 'function') ;162 (Text = 'continue') or (Text = 'function') or (Text = 'procedure'); 158 163 end; 159 164 … … 203 208 Pos.Increment; 204 209 end else begin 205 Error( 'Unknown token ' + C);210 Error(Format(SUnknownToken, [C])); 206 211 Break; 207 212 end; … … 260 265 end; 261 266 end else 262 raise Exception.Create( 'Unsupported tokenizer state.');267 raise Exception.Create(SUnsupportedTokenizerState); 263 268 end; 264 269 end; … … 314 319 Token := GetNext; 315 320 if (Token.Text <> Text) or (Token.Kind <> Kind) then 316 Error( 'Expected ' + Text + ' but ' + Token.Text + ' found.');321 Error(Format(SExpectedButFound, [Text, Token.Text])); 317 322 end; 318 323
Note:
See TracChangeset
for help on using the changeset viewer.