diff options
| author | gingerBill <bill@gingerbill.org> | 2019-12-01 14:10:59 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2019-12-01 14:10:59 +0000 |
| commit | 9db81498d8fbf4b24383cd7de94619943ad4e01a (patch) | |
| tree | 6263d1649607f44a1d8affc2baf1d39da906698f /src/parser.cpp | |
| parent | 7fbe0a6f2385e618ea4d3a724d2ed6147b6921bf (diff) | |
Make the `string` type elements "immutable", akin to `char const *` in C
Allows for extra security and optimization benefits
Diffstat (limited to 'src/parser.cpp')
| -rw-r--r-- | src/parser.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/parser.cpp b/src/parser.cpp index cfa6d7981..be3991add 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -379,7 +379,7 @@ Ast *clone_ast(Ast *node) { } -void error(Ast *node, char *fmt, ...) { +void error(Ast *node, char const *fmt, ...) { Token token = {}; if (node != nullptr) { token = ast_token(node); @@ -393,7 +393,7 @@ void error(Ast *node, char *fmt, ...) { } } -void error_no_newline(Ast *node, char *fmt, ...) { +void error_no_newline(Ast *node, char const *fmt, ...) { Token token = {}; if (node != nullptr) { token = ast_token(node); @@ -407,14 +407,14 @@ void error_no_newline(Ast *node, char *fmt, ...) { } } -void warning(Ast *node, char *fmt, ...) { +void warning(Ast *node, char const *fmt, ...) { va_list va; va_start(va, fmt); warning_va(ast_token(node), fmt, va); va_end(va); } -void syntax_error(Ast *node, char *fmt, ...) { +void syntax_error(Ast *node, char const *fmt, ...) { va_list va; va_start(va, fmt); syntax_error_va(ast_token(node), fmt, va); @@ -1178,7 +1178,7 @@ Token expect_token(AstFile *f, TokenKind kind) { return prev; } -Token expect_token_after(AstFile *f, TokenKind kind, char *msg) { +Token expect_token_after(AstFile *f, TokenKind kind, char const *msg) { Token prev = f->curr_token; if (prev.kind != kind) { String p = token_strings[prev.kind]; |