diff options
Diffstat (limited to 'source/lexer.elna')
| -rw-r--r-- | source/lexer.elna | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/source/lexer.elna b/source/lexer.elna index 370c24d..9ba593f 100644 --- a/source/lexer.elna +++ b/source/lexer.elna @@ -5,7 +5,7 @@ module import cstdio, common, cstdlib type - ElnaLexerState = ( + ElnaLexerState* = ( start, colon, identifier, @@ -28,7 +28,7 @@ type ) ElnaLexerToken* = record kind: ElnaLexerKind; - start: []const Word8; (* DEPRECATED *) + start: []const Word8; position: ElnaPosition end ElnaLexerBooleanToken* = record(ElnaLexerToken) @@ -45,7 +45,6 @@ type end TransitionAction = proc(lexer: ^Lexer; token: ^ElnaLexerToken) - (* DEPRECATED should be replaced with TransitionAction (but keeping the type name). *) ElnaLexerAction = (none, accumulate, skip, single, eof, finalize, composite, key_id, integer, delimited) ElnaLexerTransition = record @@ -53,7 +52,7 @@ type next_state: ElnaLexerState end - ElnaLexerCursor = record + ElnaLexerCursor* = record state: ElnaLexerState; start: ^Word8; finish: ^Word8; @@ -755,7 +754,7 @@ return elna_lexer_execute_action(cursor, next_transition^.action) (** * One time lexer initialization. *) -proc elna_lexer_initialize(cursor: ^ElnaLexerCursor; code_pointer: ^Word8) +proc elna_lexer_initialize*(cursor: ^ElnaLexerCursor; code_pointer: ^Word8) begin elna_lexer_classifications(); elna_lexer_transitions(); @@ -771,7 +770,7 @@ return * Reads the next token and writes its type into the address in the kind parameter. * Resets the lexer state for reading the next token. *) -proc elna_lexer_peek(cursor: ^ElnaLexerCursor) -> ^ElnaLexerToken +proc elna_lexer_peek*(cursor: ^ElnaLexerCursor) -> ^ElnaLexerToken var token: ^ElnaLexerToken begin @@ -788,7 +787,7 @@ return cursor^.token (** * Reads the token and advance the lexer. *) -proc elna_lexer_read(cursor: ^ElnaLexerCursor) -> ^ElnaLexerToken +proc elna_lexer_read*(cursor: ^ElnaLexerCursor) -> ^ElnaLexerToken var token: ^ElnaLexerToken begin @@ -801,7 +800,7 @@ return token (** * Skips comments. *) -proc elna_lexer_skip_empty_lines(cursor: ^ElnaLexerCursor) +proc elna_lexer_skip_empty_lines*(cursor: ^ElnaLexerCursor) var token: ^ElnaLexerToken begin |
