diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-03-27 03:18:48 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-03-27 03:18:48 +0300 |
| commit | 78cf00cb506cb86112cb715e4d2d69ec11b20c42 (patch) | |
| tree | 32a1fd3d1e60343cb1e654900c2d4dedca5e938b /src/ast.c | |
| parent | 9fb179ab999c3b98caabca09b30c409dc5dd3b3d (diff) | |
| download | ek-78cf00cb506cb86112cb715e4d2d69ec11b20c42.tar.gz ek-78cf00cb506cb86112cb715e4d2d69ec11b20c42.zip | |
change typeof to be a full time type
Diffstat (limited to 'src/ast.c')
| -rw-r--r-- | src/ast.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -30,9 +30,15 @@ static struct src_loc loc_span(struct ast_node *left, struct ast_node *right) { struct src_loc loc = {0}; - if (!left || !right) + if (!left && !right) return loc; + if (!left && right) + return right->loc; + + if (left && !right) + return left->loc; + /* this might eventually be a good thing to do, * but right now I'm still having issues with initializing all nodes * with some kind of even slightly accurate location |
