Fix the parser, make the function name optional.
This commit is contained in:
@@ -33,7 +33,11 @@ where
|
||||
TopLevel::Function(name, arg_names, body) => allocator
|
||||
.text("function")
|
||||
.append(allocator.space())
|
||||
.append(allocator.text(name.to_string()))
|
||||
.append(
|
||||
name.as_ref()
|
||||
.map(|x| allocator.text(x.to_string()))
|
||||
.unwrap_or_else(|| allocator.nil()),
|
||||
)
|
||||
.append(
|
||||
allocator
|
||||
.intersperse(
|
||||
|
||||
Reference in New Issue
Block a user