-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
parser: consider physically separated chunks as separate singular exp…
…ressions This commit changes the parser's handling of singular expressions, i.e. ones that don't have any operators between them. Previously, the parser would eagerly continue parsing a singular expression until it matched the legal structure of an expression. Whilst this was legal, and handled accordingly at later phases of compilation, it certainly created odd (and unexpected) behaviour in the parser. Now, we consider singular expressions as a collection of tokens that must be "physically" connected. For example, before hand we consider: ```rs foo () // Or foo () ``` as a call to the function `foo`, however, now we consider them as separate expressions. Now, calling foo can only be done with: ```rs foo() ``` In addition to that, we also fix some newly "detected" issues in existing tests.
- Loading branch information
Showing
7 changed files
with
67 additions
and
16 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
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 |
---|---|---|
@@ -1,51 +1,77 @@ | ||
error[0081]: variable `c` is not bound in all patterns | ||
--> $DIR/548.hash:6:10 | ||
5 | // ~ERROR: variable `d` not declared in all patterns | ||
6 | (c | d) := 2; | ||
6 | (c | d) := 2; | ||
| ^ pattern doesn't bind `c` | ||
7 | | ||
|
||
--> $DIR/548.hash:6:6 | ||
5 | // ~ERROR: variable `d` not declared in all patterns | ||
6 | (c | d) := 2; | ||
6 | (c | d) := 2; | ||
| ^ variable not in all patterns | ||
7 | | ||
|
||
error[0081]: variable `d` is not bound in all patterns | ||
--> $DIR/548.hash:6:6 | ||
5 | // ~ERROR: variable `d` not declared in all patterns | ||
6 | (c | d) := 2; | ||
6 | (c | d) := 2; | ||
| ^ pattern doesn't bind `d` | ||
7 | | ||
|
||
--> $DIR/548.hash:6:10 | ||
5 | // ~ERROR: variable `d` not declared in all patterns | ||
6 | (c | d) := 2; | ||
6 | (c | d) := 2; | ||
| ^ variable not in all patterns | ||
7 | | ||
|
||
error[0081]: variable `b` is not bound in all patterns | ||
--> $DIR/548.hash:11:18 | ||
10 | match k { | ||
11 | (a, b) | (t, a) => {} | ||
11 | (a, b) | (t, a) => {}, | ||
| ^^^^^^ pattern doesn't bind `b` | ||
12 | (2, 3) | (a, b) => {} | ||
|
||
--> $DIR/548.hash:11:13 | ||
10 | match k { | ||
11 | (a, b) | (t, a) => {} | ||
11 | (a, b) | (t, a) => {}, | ||
| ^ variable not in all patterns | ||
12 | (2, 3) | (a, b) => {} | ||
|
||
error[0081]: variable `t` is not bound in all patterns | ||
--> $DIR/548.hash:11:9 | ||
10 | match k { | ||
11 | (a, b) | (t, a) => {} | ||
11 | (a, b) | (t, a) => {}, | ||
| ^^^^^^ pattern doesn't bind `t` | ||
12 | (2, 3) | (a, b) => {} | ||
|
||
--> $DIR/548.hash:11:19 | ||
10 | match k { | ||
11 | (a, b) | (t, a) => {} | ||
11 | (a, b) | (t, a) => {}, | ||
| ^ variable not in all patterns | ||
12 | (2, 3) | (a, b) => {} | ||
|
||
error[0081]: variable `a` is not bound in all patterns | ||
--> $DIR/548.hash:12:9 | ||
11 | (a, b) | (t, a) => {}, | ||
12 | (2, 3) | (a, b) => {} | ||
| ^^^^^^ pattern doesn't bind `a` | ||
13 | } | ||
|
||
--> $DIR/548.hash:12:19 | ||
11 | (a, b) | (t, a) => {}, | ||
12 | (2, 3) | (a, b) => {} | ||
| ^ variable not in all patterns | ||
13 | } | ||
|
||
error[0081]: variable `b` is not bound in all patterns | ||
--> $DIR/548.hash:12:9 | ||
11 | (a, b) | (t, a) => {}, | ||
12 | (2, 3) | (a, b) => {} | ||
| ^^^^^^ pattern doesn't bind `b` | ||
13 | } | ||
|
||
--> $DIR/548.hash:12:22 | ||
11 | (a, b) | (t, a) => {}, | ||
12 | (2, 3) | (a, b) => {} | ||
| ^ variable not in all patterns | ||
13 | } |