frontend: implement printing integer and double lex tokens

This commit is contained in:
2024-11-19 16:57:39 +00:00
parent 6e642b3c19
commit 335e360b2d

View File

@@ -14,7 +14,8 @@ extern void print_lex_token(struct ivy_token *tok)
case IVY_TOK_ATOM: case IVY_TOK_ATOM:
b_fputs("[yellow]", stdout); b_fputs("[yellow]", stdout);
break; break;
case IVY_TOK_NUMBER: case IVY_TOK_INT:
case IVY_TOK_DOUBLE:
b_fputs("[yellow]", stdout); b_fputs("[yellow]", stdout);
break; break;
case IVY_TOK_LABEL: case IVY_TOK_LABEL:
@@ -54,8 +55,11 @@ extern void print_lex_token(struct ivy_token *tok)
case IVY_TOK_KEYWORD: case IVY_TOK_KEYWORD:
printf("(%s)", ivy_keyword_to_string(tok->t_keyword)); printf("(%s)", ivy_keyword_to_string(tok->t_keyword));
break; break;
case IVY_TOK_NUMBER: case IVY_TOK_INT:
printf("(%llu)", tok->t_number); printf("(%llu)", tok->t_int);
break;
case IVY_TOK_DOUBLE:
printf("(%lf)", tok->t_double);
break; break;
default: default:
break; break;