aboutsummaryrefslogtreecommitdiff
path: root/src/ast.c
diff options
context:
space:
mode:
authorMustafa Quraish <[email protected]>2022-02-02 03:03:01 -0500
committerMustafa Quraish <[email protected]>2022-02-02 03:03:01 -0500
commitec29bfb9563bcec1cc2a054cc2c1942fd5c65cb1 (patch)
tree7911b1e6fe12c4154656ed4915e5be7c95729707 /src/ast.c
parentRefactor variable access+assignment in terms of `generate_lvalue()` (diff)
downloadcup-ec29bfb9563bcec1cc2a054cc2c1942fd5c65cb1.tar.xz
cup-ec29bfb9563bcec1cc2a054cc2c1942fd5c65cb1.zip
Add support for pointers! (tests missing)
This commit adds initial support for taking pointers / dereferencing. The type system is still a bit of a hot mess, so all type information is actually not looked at, but the functionality still seems to be there. Still need to add some tests for pointers/dereferencing to ensure that it works in some edge cases as well.
Diffstat (limited to 'src/ast.c')
-rw-r--r--src/ast.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/ast.c b/src/ast.c
index 2a388bb..4d4eb9b 100644
--- a/src/ast.c
+++ b/src/ast.c
@@ -140,6 +140,7 @@ bool is_lvalue(NodeType type)
{
case AST_LOCAL_VAR:
case AST_GLOBAL_VAR:
+ case OP_DEREF: // FIXME: Should this be the case?
return true;
default: return false;
}