diff options
author | Carlos Maniero <carlos@maniero.me> | 2023-05-10 16:07:39 -0300 |
---|---|---|
committer | Carlos Maniero <carlos@maniero.me> | 2023-05-10 17:35:03 -0300 |
commit | 75639fbf01bd6ae1212521b6cf822025eb8b598d (patch) | |
tree | 49709154c437cfbc01568f1e0c9abc8574fd3a54 /src/parser.h | |
parent | 2cf0bcb409f3a1fd298b664103d57c945c6349f5 (diff) |
namespaces: Add a namespace structure that represents a file
We have been always parsing a single function. Since we want to have
multiple functions in a near future, this patch introduces an namespace
that represents an entire file.
To ensure a function is defined inside a namespace, a helper function
was created. Today our ast_node structure is highly exposed, and this is
something that Johnny and I have been discussed. So then, this is a
first step to try to protected the code generation from our ast tree.
Signed-off-by: Carlos Maniero <carlos@maniero.me>
Diffstat (limited to 'src/parser.h')
-rw-r--r-- | src/parser.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/parser.h b/src/parser.h index ef5dff5..7bebee7 100644 --- a/src/parser.h +++ b/src/parser.h @@ -46,4 +46,7 @@ parser_parse_function_declaration(parser_t *parser); ast_node_t * parser_parse_expression(parser_t *parser); +ast_node_t * +parser_parse_ns(parser_t *parser); + #endif /* PARSER_H */ |