diff options
| author | gingerBill <bill@gingerbill.org> | 2021-08-02 00:53:45 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-08-02 00:53:45 +0100 |
| commit | 7f3d4cb50463dbc0ef9154ea467209ff52ddadc2 (patch) | |
| tree | 29ec4b90d55c63bb3d5c41192858d306d3e8ea0f /src/checker.cpp | |
| parent | 97be36d18a5135b756f6e70e721622a7032f40d8 (diff) | |
Remove the literal conversion logic to the parser from the tokenizer
Diffstat (limited to 'src/checker.cpp')
| -rw-r--r-- | src/checker.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/checker.cpp b/src/checker.cpp index f81017c38..d4094d6ed 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -2521,7 +2521,7 @@ DECL_ATTRIBUTE_PROC(foreign_block_decl_attribute) { if (ev.kind == ExactValue_String) { auto cc = string_to_calling_convention(ev.value_string); if (cc == ProcCC_Invalid) { - error(elem, "Unknown procedure calling convention: '%.*s'\n", LIT(ev.value_string)); + error(elem, "Unknown procedure calling convention: '%.*s'", LIT(ev.value_string)); } else { c->foreign_context.default_cc = cc; } @@ -2533,7 +2533,7 @@ DECL_ATTRIBUTE_PROC(foreign_block_decl_attribute) { if (ev.kind == ExactValue_String) { String link_prefix = ev.value_string; if (!is_foreign_name_valid(link_prefix)) { - error(elem, "Invalid link prefix: '%.*s'\n", LIT(link_prefix)); + error(elem, "Invalid link prefix: '%.*s'", LIT(link_prefix)); } else { c->foreign_context.link_prefix = link_prefix; } @@ -3138,7 +3138,10 @@ void check_collect_value_decl(CheckerContext *c, Ast *decl) { bool success = false; if (value != nullptr) { if (value->kind == Ast_BasicLit && value->BasicLit.token.kind == Token_String) { - String v = value->BasicLit.token.string; + String v = {}; + if (value->tav.value.kind == ExactValue_String) { + v = value->tav.value.value_string; + } if (v == "file") { kind = EntityVisiblity_PrivateToFile; success = true; |