aboutsummaryrefslogtreecommitdiff
path: root/src/parser.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-06-07 13:08:15 +0100
committergingerBill <bill@gingerbill.org>2023-06-07 13:08:15 +0100
commit349641e95f63047a5fc28b3f5358f9249da7f38a (patch)
tree64749b7f0934ccdc140a6f30740a1ccb026b72e6 /src/parser.cpp
parent9941ec85d8530b8105029e5517eeca0798c2509a (diff)
Fix #2572
Diffstat (limited to 'src/parser.cpp')
-rw-r--r--src/parser.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index c19e3f859..883342b21 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -666,7 +666,11 @@ gb_internal ExactValue exact_value_from_token(AstFile *f, Token const &token) {
}
break;
}
- return exact_value_from_basic_literal(token.kind, s);
+ ExactValue value = exact_value_from_basic_literal(token.kind, s);
+ if (value.kind == ExactValue_Invalid) {
+ syntax_error(token, "Invalid token literal");
+ }
+ return value;
}
gb_internal String string_value_from_token(AstFile *f, Token const &token) {