diff options
author | Philip Herron <philip.herron@embecosm.com> | 2020-12-24 21:26:26 +0000 |
---|---|---|
committer | Philip Herron <herron.philip@googlemail.com> | 2020-12-25 18:23:22 +0000 |
commit | 467141184aa274126ff7e2a41d08bb621b7a3fdf (patch) | |
tree | f15fd81fb434787967d3837651891bfaa73fee80 /gcc/rust/resolve/rust-ast-resolve-toplevel.h | |
parent | 8d34ac3c1602d8506ae4b65d92075be86f5a6c9a (diff) | |
download | gcc-467141184aa274126ff7e2a41d08bb621b7a3fdf.zip gcc-467141184aa274126ff7e2a41d08bb621b7a3fdf.tar.gz gcc-467141184aa274126ff7e2a41d08bb621b7a3fdf.tar.bz2 |
Implement constant expressions
Diffstat (limited to 'gcc/rust/resolve/rust-ast-resolve-toplevel.h')
-rw-r--r-- | gcc/rust/resolve/rust-ast-resolve-toplevel.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/rust/resolve/rust-ast-resolve-toplevel.h b/gcc/rust/resolve/rust-ast-resolve-toplevel.h index fcc9663..0b6256e 100644 --- a/gcc/rust/resolve/rust-ast-resolve-toplevel.h +++ b/gcc/rust/resolve/rust-ast-resolve-toplevel.h @@ -36,6 +36,15 @@ public: ~ResolveTopLevel () {} + void visit (AST::ConstantItem &constant) + { + resolver->get_name_scope ().insert (constant.get_identifier (), + constant.get_node_id ()); + resolver->insert_new_definition (constant.get_node_id (), + Definition{constant.get_node_id (), + constant.get_node_id ()}); + } + void visit (AST::Function &function) { // function_names are simple std::String identifiers so this can be a |