You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Currently, the lexer allows to use hyphens - in identifiers. This clashes with the use of, say, the dynamic field removing operator -$, or any binary operator starting with an hyphen.
To Reproduce
Using the field removing operator without spaces after an identifier causes an error:
nickel <<< 'let field = "a" in let rec = {a=1} in rec-$field'
error: Unexpected token
┌─ <stdin>:1:43
│
1 │ let field = "a" in let rec = {a=1} in rec-$field
│ ^
while adding a space makes parsing succeed:
nickel <<< 'let field = "a" in let rec = {a=1} in rec -$ field'
[...]
Expected behavior
Do not consider the hyphen - character as valid identifier character. This is not standard and clashes with potentially any binary operator starting with a -. Parsing exp binop exp should not be whitespace sensitive.
The text was updated successfully, but these errors were encountered:
For the record, identifiers with a hyphen are standard in lisp languages. But they can only pull it off reasonably because of the very constrained syntax that they have. It is the most beautiful part of lisp in my eyes 🙂
Describe the bug
Currently, the lexer allows to use hyphens
-
in identifiers. This clashes with the use of, say, the dynamic field removing operator-$
, or any binary operator starting with an hyphen.To Reproduce
Using the field removing operator without spaces after an identifier causes an error:
while adding a space makes parsing succeed:
Expected behavior
Do not consider the hyphen
-
character as valid identifier character. This is not standard and clashes with potentially any binary operator starting with a-
. Parsingexp binop exp
should not be whitespace sensitive.The text was updated successfully, but these errors were encountered: