Closed AlienKevin closed 5 years ago
I also don't understand how you disambiguate function expressions in Neo. Let's say we are parsing a variable named 'f'
if 'f' is defined in scope:
**'f' may be a variable or start of function expression**
there is no way to disambiguate this case
because variable names can contain spaces
and function arguments immediately follows 'f' keyword
else:
'f' must be start of function expression
An example of ambiguity would be:
var f: f n (n * 2)
def bar: f (10)
I can say bar
is a
f
which will double the input and return 20.I think maybe 'f' should be the only reserved word in Neo. That means no variable names can be 'f' or a spaced separated name starting with 'f'. Otherwise, parsing is going to be very complex.
Use 'ƒ' to make functions.
I passed this source string to
parse(tokenize(source))
and parser returns an error object:
Do I have the wrong function syntax or the parser breaks?