aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2025-12-30 13:35:16 +0000
committerGitHub <noreply@github.com>2025-12-30 13:35:16 +0000
commita523463b7e385d6a9b4f9ca2fb5a7c8c05a80333 (patch)
treeb3ccd31967e9f0fa8be034ac9de7778fc70fa74a
parent93d7e2a4526bc1075f6eef26b3e1ba6345450f05 (diff)
parent0bf4ffe46943f8f8bfe2f4f077c92be1512d117a (diff)
Merge pull request #6079 from krnowak/krnowak/fix-proc-inlining
Fix handling of #force_inline
-rw-r--r--src/parser.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index b2ff55396..823021e04 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -2183,7 +2183,7 @@ gb_internal Ast *parse_force_inlining_operand(AstFile *f, Token token) {
return expr;
}
if (e->kind != Ast_ProcLit && e->kind != Ast_CallExpr) {
- syntax_error(expr, "%.*s must be followed by a procedure literal or call, got %.*s", LIT(token.string), LIT(ast_strings[expr->kind]));
+ syntax_error(expr, "%.*s must be followed by a procedure literal or call, got %.*s", LIT(token.string), LIT(ast_strings[e->kind]));
return ast_bad_expr(f, token, f->curr_token);
}
ProcInlining pi = ProcInlining_none;
@@ -2197,17 +2197,17 @@ gb_internal Ast *parse_force_inlining_operand(AstFile *f, Token token) {
if (pi != ProcInlining_none) {
if (e->kind == Ast_ProcLit) {
- if (expr->ProcLit.inlining != ProcInlining_none &&
- expr->ProcLit.inlining != pi) {
+ if (e->ProcLit.inlining != ProcInlining_none &&
+ e->ProcLit.inlining != pi) {
syntax_error(expr, "Cannot apply both '#force_inline' and '#force_no_inline' to a procedure literal");
}
- expr->ProcLit.inlining = pi;
+ e->ProcLit.inlining = pi;
} else if (e->kind == Ast_CallExpr) {
- if (expr->CallExpr.inlining != ProcInlining_none &&
- expr->CallExpr.inlining != pi) {
+ if (e->CallExpr.inlining != ProcInlining_none &&
+ e->CallExpr.inlining != pi) {
syntax_error(expr, "Cannot apply both '#force_inline' and '#force_no_inline' to a procedure call");
}
- expr->CallExpr.inlining = pi;
+ e->CallExpr.inlining = pi;
}
}