diff options
Diffstat (limited to 'source')
| -rw-r--r-- | source/lexer.elna | 6 | ||||
| -rw-r--r-- | source/main.elna | 12 |
2 files changed, 14 insertions, 4 deletions
diff --git a/source/lexer.elna b/source/lexer.elna index c221f07..9e1db21 100644 --- a/source/lexer.elna +++ b/source/lexer.elna @@ -100,6 +100,8 @@ type right_paren, left_square, right_square, + left_brace, + right_brace, greater_equal, less_equal, greater_than, @@ -756,8 +758,8 @@ begin cursor^.start := code_pointer; cursor^.finish := code_pointer; cursor^.token := nil; - cursor^.position.start_location := ElnaLocation(1u, 1u); - cursor^.position.end_location := ElnaLocation(1u, 1u) + cursor^.position.start_location := ElnaLocation{ line: 1u, column: 1u }; + cursor^.position.end_location := ElnaLocation{ line: 1u, column: 1u } return (** diff --git a/source/main.elna b/source/main.elna index fdfc49f..8f0250b 100644 --- a/source/main.elna +++ b/source/main.elna @@ -445,6 +445,14 @@ begin current_token := malloc(#size(ElnaLexerToken)); current_token^.kind := ElnaLexerKind.right_paren; source_code_advance(@source_code) + elsif first_char = '{' then + current_token := malloc(#size(ElnaLexerToken)); + current_token^.kind := ElnaLexerKind.left_brace; + source_code_advance(@source_code) + elsif first_char = '}' then + current_token := malloc(#size(ElnaLexerToken)); + current_token^.kind := ElnaLexerKind.right_brace; + source_code_advance(@source_code) elsif first_char = '\'' then source_code_advance(@source_code); @@ -585,7 +593,7 @@ var token_buffer: StringBuffer lexer: Tokenizer begin - lexer := Tokenizer(0u, nil); + lexer := Tokenizer{ length: 0u, data: nil }; token_buffer := string_buffer_new(); lexer_spaces(@source_code); @@ -801,7 +809,7 @@ begin fclose(source_file^.handle) end; - source_code.position := ElnaLocation(1u, 1u); + source_code.position := ElnaLocation{line: 1u, column: 1u}; source_code.input := source_file; source_code.empty := source_file_empty; source_code.head := source_file_head; |
