Appearance
| 1 | namespace Syntax.Parsers.Identifiers is | |
| 2 | use IO.Std; | |
| 3 | ||
| 4 | use Source; | |
| 5 | ||
| 6 | class IDENTIFIER(): Base[Trees.Identifiers.Identifier] is | |
| 7 | description: string => "identifier"; | |
| 8 | ||
| 9 | super(); | |
| 10 | ||
| 11 | parse(context: CONTEXT) -> Trees.Identifiers.Identifier? => | |
| 12 | if context.expect_token(Lexical.TOKEN.IDENTIFIER, syntax_error_message) then | |
| 13 | let name = context.current.value_string; | |
| 14 | let result = Trees.Identifiers.Identifier(context.location, name); | |
| 15 | context.next_token(); | |
| 16 | ||
| 17 | result; | |
| 18 | else | |
| 19 | null | |
| 20 | fi; | |
| 21 | si | |
| 22 | si |