diff options
author | Carlos Maniero <carlosmaniero@gmail.com> | 2023-04-27 00:57:30 -0300 |
---|---|---|
committer | Carlos Maniero <carlosmaniero@gmail.com> | 2023-04-29 15:59:26 -0300 |
commit | 817fbfef34908931ebeaa4da1a8d21ef79572e5a (patch) | |
tree | 7680571ecb86364cb1bb36c1defc5fd438639e4c /src/gas_assembly_generator.h | |
parent | 3bc44f85de340c8da88d74b561b75716162d84d0 (diff) |
scope: Add a scope stack for identifier resolutions
Before accepting an identifier, the parser should check if that
identifier will be available. With this implementation it will be
possible. Take the following code example:
main(): i32 {
return my_exit_code;
}
The parser must return an error informing that *my_exit_code* is not
defined in the example above. The ast scope is a support module for
parser and ast, simplifying identifier resolution.
Once a curly bracket ({) is open the *scope_enter()* is called and when
it is closed (}) we pop the entire stack with *scope_leave()*.
Signed-off-by: Carlos Maniero <carlosmaniero@gmail.com>
Diffstat (limited to 'src/gas_assembly_generator.h')
0 files changed, 0 insertions, 0 deletions