#include #include #include "../include/parser.h" int main() { const char *code; Parser parser; BufferView code_view; int result; code = "const main = () {\n" " var hello = () {\n" " \n" " }\n" " hello()\n" "}\n" "const print = () {\n" " \n" "}"; result = parser_init(&parser); if(result != PARSER_OK) { fprintf(stderr, "Failed to initialize parser\n"); return 1; } code_view = create_buffer_view(code, strlen(code)); result = parser_parse_buffer(&parser, code_view); if(result != PARSER_OK) { fprintf(stderr, "Failed to parse\n"); return 1; } /* No need to do this here as the program is exiting */ /* parser_deinit(&parser); */ return 0; }