-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mark duplicated arguments in argument-patterns as syntax error
To remain consistent with `nix-instantiate --parser`, expressions like { a, a }: a should be marked as invalid. Closes #45
- Loading branch information
Showing
3 changed files
with
73 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
error: argument `a' is duplicated in 8..9 | ||
error: error node at 8..9 | ||
NODE_ROOT 0..14 { | ||
NODE_LAMBDA 0..14 { | ||
NODE_PATTERN 0..11 { | ||
TOKEN_CURLY_B_OPEN("{") 0..1 | ||
TOKEN_WHITESPACE(" ") 1..2 | ||
NODE_PAT_ENTRY 2..3 { | ||
NODE_IDENT 2..3 { | ||
TOKEN_IDENT("a") 2..3 | ||
} | ||
} | ||
TOKEN_COMMA(",") 3..4 | ||
TOKEN_WHITESPACE(" ") 4..5 | ||
NODE_PAT_ENTRY 5..6 { | ||
NODE_IDENT 5..6 { | ||
TOKEN_IDENT("b") 5..6 | ||
} | ||
} | ||
TOKEN_COMMA(",") 6..7 | ||
TOKEN_WHITESPACE(" ") 7..8 | ||
NODE_PAT_ENTRY 8..9 { | ||
NODE_ERROR 8..9 { | ||
NODE_IDENT 8..9 { | ||
TOKEN_IDENT("a") 8..9 | ||
} | ||
} | ||
} | ||
TOKEN_WHITESPACE(" ") 9..10 | ||
TOKEN_CURLY_B_CLOSE("}") 10..11 | ||
} | ||
TOKEN_COLON(":") 11..12 | ||
TOKEN_WHITESPACE(" ") 12..13 | ||
NODE_IDENT 13..14 { | ||
TOKEN_IDENT("a") 13..14 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ a, b, a }: a |