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


#include "include/lexer.h"
#include "include/tree.h"


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

   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;
}