diff options
author | Johnny Richard <johnny@johnnyrichard.com> | 2023-04-30 01:48:18 +0200 |
---|---|---|
committer | Johnny Richard <johnny@johnnyrichard.com> | 2023-04-30 01:55:29 +0200 |
commit | ef07fab261cce781ca750c1288574d4001f14bcf (patch) | |
tree | 9b4da44aee7cc64cec448adeee31b38e12d29e6d /src/scope.h | |
parent | 88a08db927629032d6d4c662e00f0dce2c112ce4 (diff) |
parser: Registry identifiers on scope
We are parsing variables/functions and checking if they are defined on
scope. Otherwise we fail the parsing with a nice message.
Signed-off-by: Johnny Richard <johnny@johnnyrichard.com>
Co-authored-by: Carlos Maniero <carlosmaniero@gmail.com>
Diffstat (limited to 'src/scope.h')
-rw-r--r-- | src/scope.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/scope.h b/src/scope.h index c221703..2636990 100644 --- a/src/scope.h +++ b/src/scope.h @@ -14,6 +14,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ +#ifndef SCOPE_H +#define SCOPE_H + #include "ast.h" #include "string_view.h" #include "vector.h" @@ -41,6 +44,8 @@ void scope_leave(scope_t *scope); ast_node_t * -scope_get(scope_t *scope, ast_identifier_t *identifier); +scope_get(scope_t *scope, string_view_t name); void scope_push(scope_t *scope, ast_identifier_t *identifier, ast_node_t *node); + +#endif /* SCOPE_H */ |