(* 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, std, elna.lexer, elna.ast, elna.parser var sample_source_text := "program() Here.a few (* documentation block *) or #size if '\\n' `У` \"некоторая строка\" 23 -- End line comment\0" begin elna_lexer_transitions(); block local_main var global_cursor := elna_lexer_cursor_make(sample_source_text) parser := elna_parser_make(@global_cursor) tree := elna_parser_program(@parser) begin if std_slist_empty(@parser.diagnostics) then fputs("int main(){ return 0; }\n\0".ptr, stdout_()) else fputs("Parsing failed.\n\0".ptr, stderr_()) end; end end.