aboutsummaryrefslogtreecommitdiff
path: root/src/parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser.cpp')
-rw-r--r--src/parser.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index 0cd96f5b5..0364e2c2b 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -718,7 +718,17 @@ gb_internal ExactValue exact_value_from_token(AstFile *f, Token const &token) {
}
ExactValue value = exact_value_from_basic_literal(token.kind, s);
if (value.kind == ExactValue_Invalid) {
- syntax_error(token, "Invalid token literal");
+ switch (token.kind) {
+ case Token_Integer:
+ syntax_error(token, "Invalid integer literal");
+ break;
+ case Token_Float:
+ syntax_error(token, "Invalid float literal");
+ break;
+ default:
+ syntax_error(token, "Invalid token literal");
+ break;
+ }
}
return value;
}