semos/main.c
2024-04-05 04:16:24 +02:00

26 lines
512 B
C

#include "parser.h"
#include <stddef.h>
#include <stdio.h>
#include <string.h>
bool lexer_debug = false;
void print_error(const char* message, Pos pos)
{
fprintf(
stderr, "\x1b[31merror\x1b[0m: %s, on line %d\n", message, pos.line);
}
int main(void)
{
char test_program[] = " if a == true { (1) += 2; } ";
Parser parser;
parser_construct(&parser, test_program, strlen(test_program));
ASTNode* ast = parser_parse_statements(&parser);
printf("ast = %d\n", ast->node_type);
}