diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2021-11-25 13:35:31 +0200 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2021-11-25 19:01:31 +0200 |
| commit | 9a71e6a806563e5ee9aa7eef0c5c9fdc58a9c1c9 (patch) | |
| tree | 818343a67aea0407608963e84ab8b8ad2d686b4d /src | |
| parent | 3d68debb9b90875b91b86b935b8b311758d40747 (diff) | |
Throw error if trying to redefine symbol
Diffstat (limited to 'src')
| -rw-r--r-- | src/runtime.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/runtime.rs b/src/runtime.rs index 18e8e2e..71947fe 100644 --- a/src/runtime.rs +++ b/src/runtime.rs @@ -368,6 +368,9 @@ pub fn process( parameters, expression, } => { + if symbol_table.contains_key(symbol) { + return Err(format!("[runtime] symbol already defined: {}", symbol)); + } let bound_params: Vec<(ast::Symbol, usize)> = parameters .iter() .map(|param| (param.clone(), advance_v())) |
