-
Notifications
You must be signed in to change notification settings - Fork 219
Closed
dhall-lang/dhall-lang
#222Description
Dhall fails to parse identifier when the identifier's name starts with a reserved keyword, for example:
➔ dhall <<< "let mergedRec = { a = 1 } // { b = 2 } in mergedRec"
Error: Invalid input
(stdin):2:1:
|
2 | <empty line>
| ^
unexpected end of input
expecting "!=", "&&", "++", "->", "//", "//\\", "/\", "==", "||", "→", "∧", "⩓", "⫽", '#', '(', '*', '+', '.', '?', '@', built-in expression, double literal, import, integer literal, label, list literal, natural literal, record type or literal, text literal, the rest of label, or union type or literalBut it works if I rename the variable name
➔ dhall <<< "let _mergedRec = { a = 1 } // { b = 2 } in _mergedRec"
{ b = 2, a = 1 }Also I found dhall format gives incorrect result when the identifier starts with constructors:
➔ dhall format <<< "let constructorsRec = { a = 1, b = 2 } in constructorsRec"
let constructorsRec = { a = 1, b = 2 } in constructors Rec
## ^ a space was insertedMetadata
Metadata
Assignees
Labels
No labels