(* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. *) program() import sys.posix.stdio, elna.lexer var global_cursor: ElnaLexerCursor sample_source_text := "Here.are a few (* documentation block *) or if '\\n' -- End line comment\0" token: ^ElnaLexerToken begin elna_lexer_transitions(); global_cursor := { ElnaLexerCursor; start: sample_source_text.ptr, cursor: sample_source_text.ptr, position: 1u }; token := elna_lexer_lex(@global_cursor); elna_lexer_token_dump(token, @global_cursor); while token^.kind <> ElnaLexerTokenKind.eof do elna_lexer_token_destroy(token); token := elna_lexer_lex(@global_cursor); elna_lexer_token_dump(token, @global_cursor) end; elna_lexer_token_destroy(token) end.