This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 659
feat: unknown bindings and unknown patterns #1804
Merged
ematipico
merged 14 commits into
feature/unknown-nodes-errors
from
fature/unknown-binding-nodes-2
Nov 23, 2021
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
f5c5b46
feat: pass error kind via parameter (#1788)
ematipico f43dfcc
feat: unknown statements (#1794)
ematipico 397e567
chore: rebase
ematipico e53bcd5
fix: test and format
ematipico 79d644f
chore: new error test cases
ematipico 6792b69
feat: unknown binding
ematipico ab35618
feat: correctly flag unknown binding inside patterns
ematipico d32218c
feat: correct unknown pattern
ematipico c2835fd
chore: format
ematipico a3f1fd2
feat: better pattern coverage
ematipico 8c62e9a
chore: code gen tests
ematipico 33fa14f
chore: restored tests
ematipico d745c25
Merge branch 'feature/unknown-nodes-errors' into fature/unknown-bindi…
ematipico 053b5fc
chore: code review
ematipico File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
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,5 @@ | ||
function foo() { | ||
debugger { | ||
var something = "lorem"; | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
crates/rslint_parser/test_data/inline/err/debugger_stmt.rast
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,53 @@ | ||
0: JS_ROOT@0..61 | ||
0: (empty) | ||
1: LIST@0..0 | ||
2: LIST@0..60 | ||
0: JS_FUNCTION_DECLARATION@0..60 | ||
0: FUNCTION_KW@0..9 "function" [] [Whitespace(" ")] | ||
1: JS_IDENTIFIER_BINDING@9..12 | ||
0: IDENT@9..12 "foo" [] [] | ||
2: JS_PARAMETER_LIST@12..15 | ||
0: L_PAREN@12..13 "(" [] [] | ||
1: LIST@13..13 | ||
2: R_PAREN@13..15 ")" [] [Whitespace(" ")] | ||
3: JS_FUNCTION_BODY@15..60 | ||
0: L_CURLY@15..16 "{" [] [] | ||
1: LIST@16..16 | ||
2: LIST@16..58 | ||
0: JS_DEBUGGER_STATEMENT@16..27 | ||
0: DEBUGGER_KW@16..27 "debugger" [Whitespace("\n\t")] [Whitespace(" ")] | ||
1: (empty) | ||
1: JS_BLOCK_STATEMENT@27..58 | ||
0: L_CURLY@27..28 "{" [] [] | ||
1: LIST@28..55 | ||
0: JS_VARIABLE_DECLARATION_STATEMENT@28..55 | ||
0: JS_VARIABLE_DECLARATION@28..54 | ||
0: VAR_KW@28..35 "var" [Whitespace("\n\t\t")] [Whitespace(" ")] | ||
1: LIST@35..54 | ||
0: JS_VARIABLE_DECLARATOR@35..54 | ||
0: SINGLE_PATTERN@35..45 | ||
0: NAME@35..45 | ||
0: IDENT@35..45 "something" [] [Whitespace(" ")] | ||
1: JS_EQUAL_VALUE_CLAUSE@45..54 | ||
0: EQ@45..47 "=" [] [Whitespace(" ")] | ||
1: JS_STRING_LITERAL@47..54 | ||
0: JS_STRING_LITERAL_TOKEN@47..54 "\"lorem\"" [] [] | ||
1: SEMICOLON@54..55 ";" [] [] | ||
2: R_CURLY@55..58 "}" [Whitespace("\n\t")] [] | ||
3: R_CURLY@58..60 "}" [Whitespace("\n")] [] | ||
3: EOF@60..61 "" [Whitespace("\n")] [] | ||
-- | ||
error[SyntaxError]: Expected a semicolon or an implicit semicolon after a statement, but found none | ||
┌─ debugger_stmt.js:2:11 | ||
│ | ||
2 │ debugger { | ||
│ -------- ^ An explicit or implicit semicolon is expected here... | ||
│ │ | ||
│ ...Which is required to end this statement | ||
|
||
-- | ||
function foo() { | ||
debugger { | ||
var something = "lorem"; | ||
} | ||
} |
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,5 @@ | ||
label1: { | ||
label2: { | ||
label1: {} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There were some more unknown bindings ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry @MichaReiser , I make this change later in another PR