aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
blob: 45ee0c67bcb74e23ccb3b2d56ff150c872ca3be2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdio.h>
#include "include/lexer.h"

int main(int argc, char* argv[]) {
   lexer_t* lexer = lexer_init(
      "[nice & simple]\nlet it = \"Hello, World!\";\nsay it;\n"
   );

   printf("\n=== INPUT =======\n%s\n=== END INPUT ===\n", lexer->content);

   token_t* token = NULL;

   while ((token = lexer_get_next_token(lexer)) != NULL) {
      printf("===\ntoken type: %d\ntoken value: %s\n===\n", token->type, token->value);
   }

   return 0;
}