Fix the parser, make the function name optional.
This commit is contained in:
@@ -117,7 +117,9 @@ impl TopLevel {
|
||||
match self {
|
||||
TopLevel::Function(name, arguments, body) => {
|
||||
bound_variables.new_scope();
|
||||
bound_variables.insert(name.name.clone(), name.location.clone());
|
||||
if let Some(name) = name {
|
||||
bound_variables.insert(name.name.clone(), name.location.clone());
|
||||
}
|
||||
for arg in arguments.iter() {
|
||||
bound_variables.insert(arg.name.clone(), arg.location.clone());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user