diff options
author | Carlos Maniero <carlos@maniero.me> | 2023-05-08 23:53:42 -0300 |
---|---|---|
committer | Johnny Richard <johnny@johnnyrichard.com> | 2023-05-09 21:46:51 +0200 |
commit | 35425aa5837543e4cc3fc82266dc2ae429cb2779 (patch) | |
tree | 1d7dec87dc17785162c20206371818f5e28fd99b /src/scope.c | |
parent | 3842de0e22d72075f06bd8cc44b8744e86c21725 (diff) |
parser: Ensure the expression types
When assign a variable or returning a value it now ensures that the
expression matches the expected type.
To make this possible a %result_type% field was added to ast_node_t and
this field is used whenever to make the comparison.
Signed-off-by: Carlos Maniero <carlos@maniero.me>
Signed-off-by: Johnny Richard <johnny@johnnyrichard.com>
Diffstat (limited to 'src/scope.c')
-rw-r--r-- | src/scope.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/scope.c b/src/scope.c index 6338e60..5b0eb56 100644 --- a/src/scope.c +++ b/src/scope.c @@ -115,6 +115,7 @@ scope_get(scope_t *scope, string_view_t name) return NULL; } + void scope_push(scope_t *scope, ast_identifier_t *identifier, ast_node_t *node) { |