diff options
Diffstat (limited to 'src/pipac.c')
-rw-r--r-- | src/pipac.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pipac.c b/src/pipac.c index 993d56d..6e6df9e 100644 --- a/src/pipac.c +++ b/src/pipac.c @@ -20,11 +20,12 @@ #include "lexer.h" #include "parser.h" +#include "string_view.h" void generate_gas_x86_64_linux(ast_function_t *func) { - if (strcmp(func->name, "main") != 0) { + if (!string_view_eq(func->name, string_view_from_str("main"))) { fprintf(stderr, "[ERROR]: no main function has been defined!\n"); exit(EXIT_FAILURE); } @@ -47,7 +48,7 @@ void print_tokens(lexer_t *lexer) { token_t token; for (lexer_next_token(lexer, &token); token.kind != TOKEN_EOF; lexer_next_token(lexer, &token)) { - printf("%s:%d:%d: [kind=%d, value='%s']\n", lexer->filepath, token.row + 1, token.col + 1, token.kind, token.value); + printf("%s:%d:%d: [kind=%d, value='"SVFMT"']\n", lexer->filepath, token.row + 1, token.col + 1, token.kind, SVARG(&token.value)); } } |