aboutsummaryrefslogtreecommitdiff
path: root/src/parser.cpp
diff options
context:
space:
mode:
authorJon Lipstate <Jon@Lipstate.com>2023-04-05 22:20:21 -0700
committerJon Lipstate <Jon@Lipstate.com>2023-04-05 22:20:21 -0700
commit41ff7a6010e146a33045e9dca28c4d753835bd0d (patch)
tree0f526d3af99d170b3792b84e3dcd2357827e5d76 /src/parser.cpp
parent0570c84a83884bbf5c36dc4a5546c04cf3be3c2d (diff)
parent0234f50da1d5f697e6c180d2d7463a9587cbc7a4 (diff)
Merge branch 'master' into strconv_docs
Diffstat (limited to 'src/parser.cpp')
-rw-r--r--src/parser.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index 86f955254..50a9ba766 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -3693,9 +3693,11 @@ gb_internal bool allow_field_separator(AstFile *f) {
if (allow_token(f, Token_Comma)) {
return true;
}
- if (ALLOW_NEWLINE && token.kind == Token_Semicolon && !token_is_newline(token)) {
- String p = token_to_string(token);
- syntax_error(token_end_of_line(f, f->prev_token), "Expected a comma, got a %.*s", LIT(p));
+ if (ALLOW_NEWLINE && token.kind == Token_Semicolon) {
+ if (!token_is_newline(token)) {
+ String p = token_to_string(token);
+ syntax_error(token_end_of_line(f, f->prev_token), "Expected a comma, got a %.*s", LIT(p));
+ }
advance_token(f);
return true;
}