summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/parser/parser_core.c3
-rw-r--r--src/parser/parser_decl.c5
-rw-r--r--src/parser/parser_expr.c5
-rw-r--r--src/parser/parser_stmt.c3
4 files changed, 11 insertions, 5 deletions
diff --git a/src/parser/parser_core.c b/src/parser/parser_core.c
index 8410203..7468bfb 100644
--- a/src/parser/parser_core.c
+++ b/src/parser/parser_core.c
@@ -347,7 +347,8 @@ ASTNode *parse_program_nodes(ParserContext *ctx, Lexer *l)
}
else if (t.len == 5 && strncmp(t.start, "const", 5) == 0)
{
- zpanic_at(t, "'const' for declarations is deprecated. Use 'def' for constants or 'var x: const T' for read-only variables.");
+ zpanic_at(t, "'const' for declarations is deprecated. Use 'def' for constants or "
+ "'var x: const T' for read-only variables.");
}
else if (t.len == 6 && strncmp(t.start, "extern", 6) == 0)
{
diff --git a/src/parser/parser_decl.c b/src/parser/parser_decl.c
index 87b15ad..7e0cc5b 100644
--- a/src/parser/parser_decl.c
+++ b/src/parser/parser_decl.c
@@ -727,7 +727,8 @@ ASTNode *parse_def(ParserContext *ctx, Lexer *l)
// Use is_def flag for manifest constants
add_symbol(ctx, ns, type_str ? type_str : "unknown", type_obj);
Symbol *sym_entry = find_symbol_entry(ctx, ns);
- if (sym_entry) {
+ if (sym_entry)
+ {
sym_entry->is_def = 1;
// is_const_value set only if literal
}
@@ -762,7 +763,7 @@ ASTNode *parse_def(ParserContext *ctx, Lexer *l)
free(s->type_info);
}
s->type_info = type_new(TYPE_INT);
- s->type_info->is_const = 1;
+ s->type_info->is_const = 1;
}
}
}
diff --git a/src/parser/parser_expr.c b/src/parser/parser_expr.c
index 9d21e77..c848072 100644
--- a/src/parser/parser_expr.c
+++ b/src/parser/parser_expr.c
@@ -3423,7 +3423,10 @@ ASTNode *parse_expr_prec(ParserContext *ctx, Lexer *l, Precedence min_prec)
Symbol *s = find_symbol_entry(ctx, operand->var_ref.name);
if (s && s->is_def)
{
- zpanic_at(t, "Cannot take address of manifest constant '%s' (use 'var' if you need an address)", operand->var_ref.name);
+ zpanic_at(t,
+ "Cannot take address of manifest constant '%s' (use 'var' if you need an "
+ "address)",
+ operand->var_ref.name);
}
}
diff --git a/src/parser/parser_stmt.c b/src/parser/parser_stmt.c
index bc1849d..73ae249 100644
--- a/src/parser/parser_stmt.c
+++ b/src/parser/parser_stmt.c
@@ -1963,7 +1963,8 @@ ASTNode *parse_statement(ParserContext *ctx, Lexer *l)
if (strncmp(tk.start, "const", 5) == 0 && tk.len == 5)
{
- zpanic_at(tk, "'const' for declarations is deprecated. Use 'def' for constants or 'var x: const T' for read-only variables.");
+ zpanic_at(tk, "'const' for declarations is deprecated. Use 'def' for constants or 'var "
+ "x: const T' for read-only variables.");
}
if (strncmp(tk.start, "return", 6) == 0 && tk.len == 6)
{