diff options
| author | gingerBill <bill@gingerbill.org> | 2021-05-19 14:15:57 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-05-19 14:15:57 +0100 |
| commit | 9c54ed57924bf8ff241b0bffebaeabfa541db24c (patch) | |
| tree | b698e43332538a764fd21cd61da3e0946ab9001e /src/check_builtin.cpp | |
| parent | 5108ebf015e460e9c226a2067f6109785a20a143 (diff) | |
Add range-based error messages to `-verbose-errors`
Example:
Cannot convert '(1 + 2)' to 'untyped bool' from 'untyped integer'
x := (1 + 2) * true;
^~~~~~^
Diffstat (limited to 'src/check_builtin.cpp')
| -rw-r--r-- | src/check_builtin.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/check_builtin.cpp b/src/check_builtin.cpp index c9b911f92..1acb9732f 100644 --- a/src/check_builtin.cpp +++ b/src/check_builtin.cpp @@ -87,7 +87,7 @@ bool check_builtin_procedure(CheckerContext *c, Operand *operand, Ast *call, i32 case BuiltinProc_DIRECTIVE: { ast_node(bd, BasicDirective, ce->proc); - String name = bd->name; + String name = bd->name.string; if (name == "defined") { break; } @@ -124,7 +124,7 @@ bool check_builtin_procedure(CheckerContext *c, Operand *operand, Ast *call, i32 case BuiltinProc_DIRECTIVE: { ast_node(bd, BasicDirective, ce->proc); - String name = bd->name; + String name = bd->name.string; if (name == "location") { if (ce->args.count > 1) { error(ce->args[0], "'#location' expects either 0 or 1 arguments, got %td", ce->args.count); |