aboutsummaryrefslogtreecommitdiff
path: root/src/parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser.cpp')
-rw-r--r--src/parser.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index 7f866922a..10aa10119 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -588,6 +588,7 @@ Ast *ast_undef(AstFile *f, Token token) {
Ast *ast_basic_lit(AstFile *f, Token basic_lit) {
Ast *result = alloc_ast_node(f, Ast_BasicLit);
result->BasicLit.token = basic_lit;
+ result->BasicLit.value = exact_value_from_basic_literal(basic_lit);
return result;
}
@@ -1509,8 +1510,11 @@ Ast *parse_value(AstFile *f) {
if (f->curr_token.kind == Token_OpenBrace) {
return parse_literal_value(f, nullptr);
}
-
- Ast *value = parse_expr(f, false);
+ Ast *value;
+ bool prev_allow_range = f->allow_range;
+ f->allow_range = true;
+ value = parse_expr(f, false);
+ f->allow_range = prev_allow_range;
return value;
}
@@ -1735,7 +1739,8 @@ Ast *parse_operand(AstFile *f, bool lhs) {
operand = ast_bad_expr(f, token, f->curr_token);
}
operand->stmt_state_flags |= StmtStateFlag_no_deferred;
- } */ else if (name.string == "file") { return ast_basic_directive(f, token, name.string);
+ } */ else if (name.string == "file") {
+ return ast_basic_directive(f, token, name.string);
} else if (name.string == "line") { return ast_basic_directive(f, token, name.string);
} else if (name.string == "procedure") { return ast_basic_directive(f, token, name.string);
} else if (name.string == "caller_location") { return ast_basic_directive(f, token, name.string);