diff options
author | Aleksey Kladov <[email protected]> | 2018-08-10 20:33:29 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-08-10 20:33:29 +0100 |
commit | 7c67612b8a894187fa3b64725531a5459f9211bf (patch) | |
tree | 9e2a536efa0c880d921fd8d4d74423afc9451fd4 /crates/libsyntax2/tests/data/parser/err | |
parent | 26262aaf05983c5b7f41cc438e287523268fe1eb (diff) |
organizize
Diffstat (limited to 'crates/libsyntax2/tests/data/parser/err')
26 files changed, 903 insertions, 0 deletions
diff --git a/crates/libsyntax2/tests/data/parser/err/0000_struct_field_missing_comma.rs b/crates/libsyntax2/tests/data/parser/err/0000_struct_field_missing_comma.rs new file mode 100644 index 000000000..fe5030d89 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/err/0000_struct_field_missing_comma.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | struct S { | ||
2 | a: u32 | ||
3 | b: u32 | ||
4 | } \ No newline at end of file | ||
diff --git a/crates/libsyntax2/tests/data/parser/err/0000_struct_field_missing_comma.txt b/crates/libsyntax2/tests/data/parser/err/0000_struct_field_missing_comma.txt new file mode 100644 index 000000000..1b5d722f8 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/err/0000_struct_field_missing_comma.txt | |||
@@ -0,0 +1,33 @@ | |||
1 | FILE@[0; 34) | ||
2 | STRUCT_ITEM@[0; 34) | ||
3 | STRUCT_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | NAME@[7; 8) | ||
6 | IDENT@[7; 8) "S" | ||
7 | WHITESPACE@[8; 9) | ||
8 | L_CURLY@[9; 10) | ||
9 | WHITESPACE@[10; 15) | ||
10 | NAMED_FIELD@[15; 21) | ||
11 | NAME@[15; 16) | ||
12 | IDENT@[15; 16) "a" | ||
13 | COLON@[16; 17) | ||
14 | WHITESPACE@[17; 18) | ||
15 | PATH_TYPE@[18; 21) | ||
16 | PATH@[18; 21) | ||
17 | PATH_SEGMENT@[18; 21) | ||
18 | NAME_REF@[18; 21) | ||
19 | IDENT@[18; 21) "u32" | ||
20 | err: `expected COMMA` | ||
21 | WHITESPACE@[21; 26) | ||
22 | NAMED_FIELD@[26; 32) | ||
23 | NAME@[26; 27) | ||
24 | IDENT@[26; 27) "b" | ||
25 | COLON@[27; 28) | ||
26 | WHITESPACE@[28; 29) | ||
27 | PATH_TYPE@[29; 32) | ||
28 | PATH@[29; 32) | ||
29 | PATH_SEGMENT@[29; 32) | ||
30 | NAME_REF@[29; 32) | ||
31 | IDENT@[29; 32) "u32" | ||
32 | WHITESPACE@[32; 33) | ||
33 | R_CURLY@[33; 34) | ||
diff --git a/crates/libsyntax2/tests/data/parser/err/0001_item_recovery_in_file.rs b/crates/libsyntax2/tests/data/parser/err/0001_item_recovery_in_file.rs new file mode 100644 index 000000000..98f23de1f --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/err/0001_item_recovery_in_file.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | if match | ||
2 | |||
3 | struct S {} \ No newline at end of file | ||
diff --git a/crates/libsyntax2/tests/data/parser/err/0001_item_recovery_in_file.txt b/crates/libsyntax2/tests/data/parser/err/0001_item_recovery_in_file.txt new file mode 100644 index 000000000..1aaf07625 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/err/0001_item_recovery_in_file.txt | |||
@@ -0,0 +1,17 @@ | |||
1 | FILE@[0; 21) | ||
2 | ERROR@[0; 2) | ||
3 | IF_KW@[0; 2) | ||
4 | err: `expected an item` | ||
5 | WHITESPACE@[2; 3) | ||
6 | err: `expected an item` | ||
7 | ERROR@[3; 8) | ||
8 | MATCH_KW@[3; 8) | ||
9 | WHITESPACE@[8; 10) | ||
10 | STRUCT_ITEM@[10; 21) | ||
11 | STRUCT_KW@[10; 16) | ||
12 | WHITESPACE@[16; 17) | ||
13 | NAME@[17; 18) | ||
14 | IDENT@[17; 18) "S" | ||
15 | WHITESPACE@[18; 19) | ||
16 | L_CURLY@[19; 20) | ||
17 | R_CURLY@[20; 21) | ||
diff --git a/crates/libsyntax2/tests/data/parser/err/0002_duplicate_shebang.rs b/crates/libsyntax2/tests/data/parser/err/0002_duplicate_shebang.rs new file mode 100644 index 000000000..48a3a3980 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/err/0002_duplicate_shebang.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | #!/use/bin/env rusti | ||
2 | #!/use/bin/env rusti | ||
diff --git a/crates/libsyntax2/tests/data/parser/err/0002_duplicate_shebang.txt b/crates/libsyntax2/tests/data/parser/err/0002_duplicate_shebang.txt new file mode 100644 index 000000000..0b6aa26eb --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/err/0002_duplicate_shebang.txt | |||
@@ -0,0 +1,7 @@ | |||
1 | FILE@[0; 42) | ||
2 | SHEBANG@[0; 20) | ||
3 | WHITESPACE@[20; 21) | ||
4 | err: `expected an item` | ||
5 | ERROR@[21; 41) | ||
6 | SHEBANG@[21; 41) | ||
7 | WHITESPACE@[41; 42) | ||
diff --git a/crates/libsyntax2/tests/data/parser/err/0003_C++_semicolon.rs b/crates/libsyntax2/tests/data/parser/err/0003_C++_semicolon.rs new file mode 100644 index 000000000..009312270 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/err/0003_C++_semicolon.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | struct S { | ||
2 | a: i32, | ||
3 | b: String, | ||
4 | }; \ No newline at end of file | ||
diff --git a/crates/libsyntax2/tests/data/parser/err/0003_C++_semicolon.txt b/crates/libsyntax2/tests/data/parser/err/0003_C++_semicolon.txt new file mode 100644 index 000000000..81777fec0 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/err/0003_C++_semicolon.txt | |||
@@ -0,0 +1,38 @@ | |||
1 | FILE@[0; 40) | ||
2 | STRUCT_ITEM@[0; 40) | ||
3 | STRUCT_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | NAME@[7; 8) | ||
6 | IDENT@[7; 8) "S" | ||
7 | WHITESPACE@[8; 9) | ||
8 | L_CURLY@[9; 10) | ||
9 | WHITESPACE@[10; 15) | ||
10 | NAMED_FIELD@[15; 21) | ||
11 | NAME@[15; 16) | ||
12 | IDENT@[15; 16) "a" | ||
13 | COLON@[16; 17) | ||
14 | WHITESPACE@[17; 18) | ||
15 | PATH_TYPE@[18; 21) | ||
16 | PATH@[18; 21) | ||
17 | PATH_SEGMENT@[18; 21) | ||
18 | NAME_REF@[18; 21) | ||
19 | IDENT@[18; 21) "i32" | ||
20 | COMMA@[21; 22) | ||
21 | WHITESPACE@[22; 27) | ||
22 | NAMED_FIELD@[27; 36) | ||
23 | NAME@[27; 28) | ||
24 | IDENT@[27; 28) "b" | ||
25 | COLON@[28; 29) | ||
26 | WHITESPACE@[29; 30) | ||
27 | PATH_TYPE@[30; 36) | ||
28 | PATH@[30; 36) | ||
29 | PATH_SEGMENT@[30; 36) | ||
30 | NAME_REF@[30; 36) | ||
31 | IDENT@[30; 36) "String" | ||
32 | COMMA@[36; 37) | ||
33 | WHITESPACE@[37; 38) | ||
34 | R_CURLY@[38; 39) | ||
35 | err: `expected item, found `;` | ||
36 | consider removing this semicolon` | ||
37 | ERROR@[39; 40) | ||
38 | SEMI@[39; 40) | ||
diff --git a/crates/libsyntax2/tests/data/parser/err/0004_use_path_bad_segment.rs b/crates/libsyntax2/tests/data/parser/err/0004_use_path_bad_segment.rs new file mode 100644 index 000000000..060e65d06 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/err/0004_use_path_bad_segment.rs | |||
@@ -0,0 +1 @@ | |||
use foo::92; \ No newline at end of file | |||
diff --git a/crates/libsyntax2/tests/data/parser/err/0004_use_path_bad_segment.txt b/crates/libsyntax2/tests/data/parser/err/0004_use_path_bad_segment.txt new file mode 100644 index 000000000..c6ae68103 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/err/0004_use_path_bad_segment.txt | |||
@@ -0,0 +1,20 @@ | |||
1 | FILE@[0; 12) | ||
2 | USE_ITEM@[0; 9) | ||
3 | USE_KW@[0; 3) | ||
4 | WHITESPACE@[3; 4) | ||
5 | USE_TREE@[4; 9) | ||
6 | PATH@[4; 9) | ||
7 | PATH@[4; 7) | ||
8 | PATH_SEGMENT@[4; 7) | ||
9 | NAME_REF@[4; 7) | ||
10 | IDENT@[4; 7) "foo" | ||
11 | COLONCOLON@[7; 9) | ||
12 | err: `expected identifier` | ||
13 | err: `expected SEMI` | ||
14 | err: `expected an item` | ||
15 | PATH_SEGMENT@[9; 9) | ||
16 | ERROR@[9; 11) | ||
17 | INT_NUMBER@[9; 11) "92" | ||
18 | err: `expected an item` | ||
19 | ERROR@[11; 12) | ||
20 | SEMI@[11; 12) | ||
diff --git a/crates/libsyntax2/tests/data/parser/err/0005_attribute_recover.rs b/crates/libsyntax2/tests/data/parser/err/0005_attribute_recover.rs new file mode 100644 index 000000000..de7f81628 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/err/0005_attribute_recover.rs | |||
@@ -0,0 +1,8 @@ | |||
1 | #[foo(foo, +, 92)] | ||
2 | fn foo() { | ||
3 | } | ||
4 | |||
5 | |||
6 | #[foo( | ||
7 | fn foo() { | ||
8 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/err/0005_attribute_recover.txt b/crates/libsyntax2/tests/data/parser/err/0005_attribute_recover.txt new file mode 100644 index 000000000..079b0d1f6 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/err/0005_attribute_recover.txt | |||
@@ -0,0 +1,60 @@ | |||
1 | FILE@[0; 54) | ||
2 | FUNCTION@[0; 31) | ||
3 | ATTR@[0; 18) | ||
4 | POUND@[0; 1) | ||
5 | L_BRACK@[1; 2) | ||
6 | META_ITEM@[2; 17) | ||
7 | IDENT@[2; 5) "foo" | ||
8 | L_PAREN@[5; 6) | ||
9 | META_ITEM@[6; 9) | ||
10 | IDENT@[6; 9) "foo" | ||
11 | COMMA@[9; 10) | ||
12 | WHITESPACE@[10; 11) | ||
13 | err: `expected attribute` | ||
14 | ERROR@[11; 12) | ||
15 | PLUS@[11; 12) | ||
16 | err: `expected attribute` | ||
17 | ERROR@[12; 13) | ||
18 | COMMA@[12; 13) | ||
19 | WHITESPACE@[13; 14) | ||
20 | LITERAL@[14; 16) | ||
21 | INT_NUMBER@[14; 16) "92" | ||
22 | R_PAREN@[16; 17) | ||
23 | R_BRACK@[17; 18) | ||
24 | WHITESPACE@[18; 19) | ||
25 | FN_KW@[19; 21) | ||
26 | WHITESPACE@[21; 22) | ||
27 | NAME@[22; 25) | ||
28 | IDENT@[22; 25) "foo" | ||
29 | PARAM_LIST@[25; 27) | ||
30 | L_PAREN@[25; 26) | ||
31 | R_PAREN@[26; 27) | ||
32 | WHITESPACE@[27; 28) | ||
33 | BLOCK_EXPR@[28; 31) | ||
34 | L_CURLY@[28; 29) | ||
35 | WHITESPACE@[29; 30) | ||
36 | R_CURLY@[30; 31) | ||
37 | WHITESPACE@[31; 34) | ||
38 | FUNCTION@[34; 53) | ||
39 | ATTR@[34; 40) | ||
40 | POUND@[34; 35) | ||
41 | L_BRACK@[35; 36) | ||
42 | META_ITEM@[36; 40) | ||
43 | IDENT@[36; 39) "foo" | ||
44 | L_PAREN@[39; 40) | ||
45 | err: `expected attribute` | ||
46 | err: `expected R_BRACK` | ||
47 | WHITESPACE@[40; 41) | ||
48 | FN_KW@[41; 43) | ||
49 | WHITESPACE@[43; 44) | ||
50 | NAME@[44; 47) | ||
51 | IDENT@[44; 47) "foo" | ||
52 | PARAM_LIST@[47; 49) | ||
53 | L_PAREN@[47; 48) | ||
54 | R_PAREN@[48; 49) | ||
55 | WHITESPACE@[49; 50) | ||
56 | BLOCK_EXPR@[50; 53) | ||
57 | L_CURLY@[50; 51) | ||
58 | WHITESPACE@[51; 52) | ||
59 | R_CURLY@[52; 53) | ||
60 | WHITESPACE@[53; 54) | ||
diff --git a/crates/libsyntax2/tests/data/parser/err/0006_named_field_recovery.rs b/crates/libsyntax2/tests/data/parser/err/0006_named_field_recovery.rs new file mode 100644 index 000000000..8069c111b --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/err/0006_named_field_recovery.rs | |||
@@ -0,0 +1,7 @@ | |||
1 | struct S { | ||
2 | f: u32, | ||
3 | pub 92 | ||
4 | + - * | ||
5 | pub x: u32, | ||
6 | z: f64, | ||
7 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/err/0006_named_field_recovery.txt b/crates/libsyntax2/tests/data/parser/err/0006_named_field_recovery.txt new file mode 100644 index 000000000..009b307b1 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/err/0006_named_field_recovery.txt | |||
@@ -0,0 +1,73 @@ | |||
1 | FILE@[0; 74) | ||
2 | STRUCT_ITEM@[0; 73) | ||
3 | STRUCT_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | NAME@[7; 8) | ||
6 | IDENT@[7; 8) "S" | ||
7 | WHITESPACE@[8; 9) | ||
8 | L_CURLY@[9; 10) | ||
9 | WHITESPACE@[10; 15) | ||
10 | NAMED_FIELD@[15; 21) | ||
11 | NAME@[15; 16) | ||
12 | IDENT@[15; 16) "f" | ||
13 | COLON@[16; 17) | ||
14 | WHITESPACE@[17; 18) | ||
15 | PATH_TYPE@[18; 21) | ||
16 | PATH@[18; 21) | ||
17 | PATH_SEGMENT@[18; 21) | ||
18 | NAME_REF@[18; 21) | ||
19 | IDENT@[18; 21) "u32" | ||
20 | COMMA@[21; 22) | ||
21 | WHITESPACE@[22; 27) | ||
22 | VISIBILITY@[27; 30) | ||
23 | PUB_KW@[27; 30) | ||
24 | WHITESPACE@[30; 31) | ||
25 | err: `expected field declaration` | ||
26 | ERROR@[31; 33) | ||
27 | INT_NUMBER@[31; 33) "92" | ||
28 | err: `expected COMMA` | ||
29 | WHITESPACE@[33; 38) | ||
30 | err: `expected field declaration` | ||
31 | ERROR@[38; 39) | ||
32 | PLUS@[38; 39) | ||
33 | err: `expected COMMA` | ||
34 | WHITESPACE@[39; 40) | ||
35 | err: `expected field declaration` | ||
36 | ERROR@[40; 41) | ||
37 | MINUS@[40; 41) | ||
38 | err: `expected COMMA` | ||
39 | WHITESPACE@[41; 42) | ||
40 | err: `expected field declaration` | ||
41 | ERROR@[42; 43) | ||
42 | STAR@[42; 43) | ||
43 | err: `expected COMMA` | ||
44 | WHITESPACE@[43; 48) | ||
45 | NAMED_FIELD@[48; 58) | ||
46 | VISIBILITY@[48; 51) | ||
47 | PUB_KW@[48; 51) | ||
48 | WHITESPACE@[51; 52) | ||
49 | NAME@[52; 53) | ||
50 | IDENT@[52; 53) "x" | ||
51 | COLON@[53; 54) | ||
52 | WHITESPACE@[54; 55) | ||
53 | PATH_TYPE@[55; 58) | ||
54 | PATH@[55; 58) | ||
55 | PATH_SEGMENT@[55; 58) | ||
56 | NAME_REF@[55; 58) | ||
57 | IDENT@[55; 58) "u32" | ||
58 | COMMA@[58; 59) | ||
59 | WHITESPACE@[59; 64) | ||
60 | NAMED_FIELD@[64; 70) | ||
61 | NAME@[64; 65) | ||
62 | IDENT@[64; 65) "z" | ||
63 | COLON@[65; 66) | ||
64 | WHITESPACE@[66; 67) | ||
65 | PATH_TYPE@[67; 70) | ||
66 | PATH@[67; 70) | ||
67 | PATH_SEGMENT@[67; 70) | ||
68 | NAME_REF@[67; 70) | ||
69 | IDENT@[67; 70) "f64" | ||
70 | COMMA@[70; 71) | ||
71 | WHITESPACE@[71; 72) | ||
72 | R_CURLY@[72; 73) | ||
73 | WHITESPACE@[73; 74) | ||
diff --git a/crates/libsyntax2/tests/data/parser/err/0007_stray_curly_in_file.rs b/crates/libsyntax2/tests/data/parser/err/0007_stray_curly_in_file.rs new file mode 100644 index 000000000..dc869fb78 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/err/0007_stray_curly_in_file.rs | |||
@@ -0,0 +1,9 @@ | |||
1 | } | ||
2 | |||
3 | struct S; | ||
4 | |||
5 | } | ||
6 | |||
7 | fn foo(){} | ||
8 | |||
9 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/err/0007_stray_curly_in_file.txt b/crates/libsyntax2/tests/data/parser/err/0007_stray_curly_in_file.txt new file mode 100644 index 000000000..b36decb46 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/err/0007_stray_curly_in_file.txt | |||
@@ -0,0 +1,32 @@ | |||
1 | FILE@[0; 31) | ||
2 | ERROR@[0; 1) | ||
3 | R_CURLY@[0; 1) | ||
4 | err: `expected an item` | ||
5 | WHITESPACE@[1; 3) | ||
6 | STRUCT_ITEM@[3; 12) | ||
7 | STRUCT_KW@[3; 9) | ||
8 | WHITESPACE@[9; 10) | ||
9 | NAME@[10; 11) | ||
10 | IDENT@[10; 11) "S" | ||
11 | SEMI@[11; 12) | ||
12 | WHITESPACE@[12; 14) | ||
13 | err: `expected an item` | ||
14 | ERROR@[14; 15) | ||
15 | R_CURLY@[14; 15) | ||
16 | WHITESPACE@[15; 17) | ||
17 | FUNCTION@[17; 27) | ||
18 | FN_KW@[17; 19) | ||
19 | WHITESPACE@[19; 20) | ||
20 | NAME@[20; 23) | ||
21 | IDENT@[20; 23) "foo" | ||
22 | PARAM_LIST@[23; 25) | ||
23 | L_PAREN@[23; 24) | ||
24 | R_PAREN@[24; 25) | ||
25 | BLOCK_EXPR@[25; 27) | ||
26 | L_CURLY@[25; 26) | ||
27 | R_CURLY@[26; 27) | ||
28 | WHITESPACE@[27; 29) | ||
29 | err: `expected an item` | ||
30 | ERROR@[29; 30) | ||
31 | R_CURLY@[29; 30) | ||
32 | WHITESPACE@[30; 31) | ||
diff --git a/crates/libsyntax2/tests/data/parser/err/0008_item_block_recovery.rs b/crates/libsyntax2/tests/data/parser/err/0008_item_block_recovery.rs new file mode 100644 index 000000000..9fcac19b5 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/err/0008_item_block_recovery.rs | |||
@@ -0,0 +1,13 @@ | |||
1 | fn foo() { | ||
2 | } | ||
3 | |||
4 | bar() { | ||
5 | if true { | ||
6 | 1 | ||
7 | } else { | ||
8 | 2 + 3 | ||
9 | } | ||
10 | } | ||
11 | |||
12 | fn baz() { | ||
13 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/err/0008_item_block_recovery.txt b/crates/libsyntax2/tests/data/parser/err/0008_item_block_recovery.txt new file mode 100644 index 000000000..f2a503cec --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/err/0008_item_block_recovery.txt | |||
@@ -0,0 +1,67 @@ | |||
1 | FILE@[0; 95) | ||
2 | FUNCTION@[0; 12) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 12) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 11) | ||
14 | R_CURLY@[11; 12) | ||
15 | WHITESPACE@[12; 14) | ||
16 | MACRO_CALL@[14; 19) | ||
17 | PATH@[14; 17) | ||
18 | PATH_SEGMENT@[14; 17) | ||
19 | NAME_REF@[14; 17) | ||
20 | IDENT@[14; 17) "bar" | ||
21 | err: `expected EXCL` | ||
22 | L_PAREN@[17; 18) | ||
23 | R_PAREN@[18; 19) | ||
24 | err: `expected SEMI` | ||
25 | WHITESPACE@[19; 20) | ||
26 | err: `expected an item` | ||
27 | ERROR@[20; 80) | ||
28 | L_CURLY@[20; 21) | ||
29 | WHITESPACE@[21; 26) | ||
30 | IF_KW@[26; 28) | ||
31 | WHITESPACE@[28; 29) | ||
32 | TRUE_KW@[29; 33) | ||
33 | WHITESPACE@[33; 34) | ||
34 | L_CURLY@[34; 35) | ||
35 | WHITESPACE@[35; 44) | ||
36 | INT_NUMBER@[44; 45) "1" | ||
37 | WHITESPACE@[45; 50) | ||
38 | R_CURLY@[50; 51) | ||
39 | WHITESPACE@[51; 52) | ||
40 | ELSE_KW@[52; 56) | ||
41 | WHITESPACE@[56; 57) | ||
42 | L_CURLY@[57; 58) | ||
43 | WHITESPACE@[58; 67) | ||
44 | INT_NUMBER@[67; 68) "2" | ||
45 | WHITESPACE@[68; 69) | ||
46 | PLUS@[69; 70) | ||
47 | WHITESPACE@[70; 71) | ||
48 | INT_NUMBER@[71; 72) "3" | ||
49 | WHITESPACE@[72; 77) | ||
50 | R_CURLY@[77; 78) | ||
51 | WHITESPACE@[78; 79) | ||
52 | R_CURLY@[79; 80) | ||
53 | WHITESPACE@[80; 82) | ||
54 | FUNCTION@[82; 94) | ||
55 | FN_KW@[82; 84) | ||
56 | WHITESPACE@[84; 85) | ||
57 | NAME@[85; 88) | ||
58 | IDENT@[85; 88) "baz" | ||
59 | PARAM_LIST@[88; 90) | ||
60 | L_PAREN@[88; 89) | ||
61 | R_PAREN@[89; 90) | ||
62 | WHITESPACE@[90; 91) | ||
63 | BLOCK_EXPR@[91; 94) | ||
64 | L_CURLY@[91; 92) | ||
65 | WHITESPACE@[92; 93) | ||
66 | R_CURLY@[93; 94) | ||
67 | WHITESPACE@[94; 95) | ||
diff --git a/crates/libsyntax2/tests/data/parser/err/0009_broken_struct_type_parameter.rs b/crates/libsyntax2/tests/data/parser/err/0009_broken_struct_type_parameter.rs new file mode 100644 index 000000000..0dd30d0bd --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/err/0009_broken_struct_type_parameter.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | struct S<90 + 2> { | ||
2 | f: u32 | ||
3 | } | ||
4 | |||
5 | struct T; | ||
diff --git a/crates/libsyntax2/tests/data/parser/err/0009_broken_struct_type_parameter.txt b/crates/libsyntax2/tests/data/parser/err/0009_broken_struct_type_parameter.txt new file mode 100644 index 000000000..fc736f0e9 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/err/0009_broken_struct_type_parameter.txt | |||
@@ -0,0 +1,44 @@ | |||
1 | FILE@[0; 43) | ||
2 | STRUCT_ITEM@[0; 11) | ||
3 | STRUCT_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | NAME@[7; 8) | ||
6 | IDENT@[7; 8) "S" | ||
7 | TYPE_PARAM_LIST@[8; 11) | ||
8 | L_ANGLE@[8; 9) | ||
9 | err: `expected type parameter` | ||
10 | ERROR@[9; 11) | ||
11 | INT_NUMBER@[9; 11) "90" | ||
12 | err: `expected COMMA` | ||
13 | err: `expected R_ANGLE` | ||
14 | err: `expected `;`, `{`, or `(`` | ||
15 | WHITESPACE@[11; 12) | ||
16 | err: `expected an item` | ||
17 | ERROR@[12; 13) | ||
18 | PLUS@[12; 13) | ||
19 | WHITESPACE@[13; 14) | ||
20 | err: `expected an item` | ||
21 | ERROR@[14; 15) | ||
22 | INT_NUMBER@[14; 15) "2" | ||
23 | err: `expected an item` | ||
24 | ERROR@[15; 16) | ||
25 | R_ANGLE@[15; 16) | ||
26 | WHITESPACE@[16; 17) | ||
27 | err: `expected an item` | ||
28 | ERROR@[17; 31) | ||
29 | L_CURLY@[17; 18) | ||
30 | WHITESPACE@[18; 23) | ||
31 | IDENT@[23; 24) "f" | ||
32 | COLON@[24; 25) | ||
33 | WHITESPACE@[25; 26) | ||
34 | IDENT@[26; 29) "u32" | ||
35 | WHITESPACE@[29; 30) | ||
36 | R_CURLY@[30; 31) | ||
37 | WHITESPACE@[31; 33) | ||
38 | STRUCT_ITEM@[33; 42) | ||
39 | STRUCT_KW@[33; 39) | ||
40 | WHITESPACE@[39; 40) | ||
41 | NAME@[40; 41) | ||
42 | IDENT@[40; 41) "T" | ||
43 | SEMI@[41; 42) | ||
44 | WHITESPACE@[42; 43) | ||
diff --git a/crates/libsyntax2/tests/data/parser/err/0010_unsafe_lambda_block.rs b/crates/libsyntax2/tests/data/parser/err/0010_unsafe_lambda_block.rs new file mode 100644 index 000000000..985775282 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/err/0010_unsafe_lambda_block.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn main() { | ||
2 | || -> () unsafe { () }; | ||
3 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/err/0010_unsafe_lambda_block.txt b/crates/libsyntax2/tests/data/parser/err/0010_unsafe_lambda_block.txt new file mode 100644 index 000000000..95d4af424 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/err/0010_unsafe_lambda_block.txt | |||
@@ -0,0 +1,40 @@ | |||
1 | FILE@[0; 42) | ||
2 | FUNCTION@[0; 41) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 7) | ||
6 | IDENT@[3; 7) "main" | ||
7 | PARAM_LIST@[7; 9) | ||
8 | L_PAREN@[7; 8) | ||
9 | R_PAREN@[8; 9) | ||
10 | WHITESPACE@[9; 10) | ||
11 | BLOCK_EXPR@[10; 41) | ||
12 | L_CURLY@[10; 11) | ||
13 | WHITESPACE@[11; 16) | ||
14 | LAMBDA_EXPR@[16; 24) | ||
15 | PARAM_LIST@[16; 18) | ||
16 | PIPE@[16; 17) | ||
17 | PIPE@[17; 18) | ||
18 | WHITESPACE@[18; 19) | ||
19 | THIN_ARROW@[19; 21) | ||
20 | WHITESPACE@[21; 22) | ||
21 | TUPLE_TYPE@[22; 24) | ||
22 | L_PAREN@[22; 23) | ||
23 | R_PAREN@[23; 24) | ||
24 | err: `expected block` | ||
25 | WHITESPACE@[24; 25) | ||
26 | EXPR_STMT@[25; 39) | ||
27 | BLOCK_EXPR@[25; 38) | ||
28 | UNSAFE_KW@[25; 31) | ||
29 | WHITESPACE@[31; 32) | ||
30 | L_CURLY@[32; 33) | ||
31 | WHITESPACE@[33; 34) | ||
32 | TUPLE_EXPR@[34; 36) | ||
33 | L_PAREN@[34; 35) | ||
34 | R_PAREN@[35; 36) | ||
35 | WHITESPACE@[36; 37) | ||
36 | R_CURLY@[37; 38) | ||
37 | SEMI@[38; 39) | ||
38 | WHITESPACE@[39; 40) | ||
39 | R_CURLY@[40; 41) | ||
40 | WHITESPACE@[41; 42) | ||
diff --git a/crates/libsyntax2/tests/data/parser/err/0011_extern_struct.rs b/crates/libsyntax2/tests/data/parser/err/0011_extern_struct.rs new file mode 100644 index 000000000..c1bd0a2d1 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/err/0011_extern_struct.rs | |||
@@ -0,0 +1 @@ | |||
extern struct Foo; | |||
diff --git a/crates/libsyntax2/tests/data/parser/err/0011_extern_struct.txt b/crates/libsyntax2/tests/data/parser/err/0011_extern_struct.txt new file mode 100644 index 000000000..3c5b678a1 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/err/0011_extern_struct.txt | |||
@@ -0,0 +1,13 @@ | |||
1 | FILE@[0; 19) | ||
2 | ERROR@[0; 6) | ||
3 | ABI@[0; 6) | ||
4 | EXTERN_KW@[0; 6) | ||
5 | err: `expected fn, trait or impl` | ||
6 | WHITESPACE@[6; 7) | ||
7 | STRUCT_ITEM@[7; 18) | ||
8 | STRUCT_KW@[7; 13) | ||
9 | WHITESPACE@[13; 14) | ||
10 | NAME@[14; 17) | ||
11 | IDENT@[14; 17) "Foo" | ||
12 | SEMI@[17; 18) | ||
13 | WHITESPACE@[18; 19) | ||
diff --git a/crates/libsyntax2/tests/data/parser/err/0012_broken_lambda.rs b/crates/libsyntax2/tests/data/parser/err/0012_broken_lambda.rs new file mode 100644 index 000000000..ad0d8eb4c --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/err/0012_broken_lambda.rs | |||
@@ -0,0 +1,12 @@ | |||
1 | pub(super) fn process<'a, S: Sink<'a>>(builder: &mut S, tokens: &[Token], events: Vec<Event>) { | ||
2 | let mut next_tok_idx = 0; | ||
3 | let eat_ws = |idx: &mut usize, &mut | { | ||
4 | while let Some(token) = tokens.get(*idx) { | ||
5 | if !token.kind.is_trivia() { | ||
6 | break; | ||
7 | } | ||
8 | builder.leaf(token.kind, token.len); | ||
9 | *idx += 1 | ||
10 | } | ||
11 | }; | ||
12 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/err/0012_broken_lambda.txt b/crates/libsyntax2/tests/data/parser/err/0012_broken_lambda.txt new file mode 100644 index 000000000..cf6e68a78 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/err/0012_broken_lambda.txt | |||
@@ -0,0 +1,387 @@ | |||
1 | FILE@[0; 389) | ||
2 | FUNCTION@[0; 389) | ||
3 | VISIBILITY@[0; 10) | ||
4 | PUB_KW@[0; 3) | ||
5 | L_PAREN@[3; 4) | ||
6 | SUPER_KW@[4; 9) | ||
7 | R_PAREN@[9; 10) | ||
8 | WHITESPACE@[10; 11) | ||
9 | FN_KW@[11; 13) | ||
10 | WHITESPACE@[13; 14) | ||
11 | NAME@[14; 21) | ||
12 | IDENT@[14; 21) "process" | ||
13 | TYPE_PARAM_LIST@[21; 38) | ||
14 | L_ANGLE@[21; 22) | ||
15 | LIFETIME_PARAM@[22; 24) | ||
16 | LIFETIME@[22; 24) "'a" | ||
17 | COMMA@[24; 25) | ||
18 | WHITESPACE@[25; 26) | ||
19 | TYPE_PARAM@[26; 37) | ||
20 | NAME@[26; 27) | ||
21 | IDENT@[26; 27) "S" | ||
22 | COLON@[27; 28) | ||
23 | WHITESPACE@[28; 29) | ||
24 | PATH@[29; 37) | ||
25 | PATH_SEGMENT@[29; 37) | ||
26 | NAME_REF@[29; 33) | ||
27 | IDENT@[29; 33) "Sink" | ||
28 | TYPE_ARG_LIST@[33; 37) | ||
29 | L_ANGLE@[33; 34) | ||
30 | LIFETIME_ARG@[34; 36) | ||
31 | LIFETIME@[34; 36) "'a" | ||
32 | R_ANGLE@[36; 37) | ||
33 | R_ANGLE@[37; 38) | ||
34 | PARAM_LIST@[38; 93) | ||
35 | L_PAREN@[38; 39) | ||
36 | PARAM@[39; 54) | ||
37 | BIND_PAT@[39; 46) | ||
38 | NAME@[39; 46) | ||
39 | IDENT@[39; 46) "builder" | ||
40 | COLON@[46; 47) | ||
41 | WHITESPACE@[47; 48) | ||
42 | REFERENCE_TYPE@[48; 54) | ||
43 | AMP@[48; 49) | ||
44 | MUT_KW@[49; 52) | ||
45 | WHITESPACE@[52; 53) | ||
46 | PATH_TYPE@[53; 54) | ||
47 | PATH@[53; 54) | ||
48 | PATH_SEGMENT@[53; 54) | ||
49 | NAME_REF@[53; 54) | ||
50 | IDENT@[53; 54) "S" | ||
51 | COMMA@[54; 55) | ||
52 | WHITESPACE@[55; 56) | ||
53 | PARAM@[56; 72) | ||
54 | BIND_PAT@[56; 62) | ||
55 | NAME@[56; 62) | ||
56 | IDENT@[56; 62) "tokens" | ||
57 | COLON@[62; 63) | ||
58 | WHITESPACE@[63; 64) | ||
59 | REFERENCE_TYPE@[64; 72) | ||
60 | AMP@[64; 65) | ||
61 | SLICE_TYPE@[65; 72) | ||
62 | L_BRACK@[65; 66) | ||
63 | PATH_TYPE@[66; 71) | ||
64 | PATH@[66; 71) | ||
65 | PATH_SEGMENT@[66; 71) | ||
66 | NAME_REF@[66; 71) | ||
67 | IDENT@[66; 71) "Token" | ||
68 | R_BRACK@[71; 72) | ||
69 | COMMA@[72; 73) | ||
70 | WHITESPACE@[73; 74) | ||
71 | PARAM@[74; 92) | ||
72 | BIND_PAT@[74; 80) | ||
73 | NAME@[74; 80) | ||
74 | IDENT@[74; 80) "events" | ||
75 | COLON@[80; 81) | ||
76 | WHITESPACE@[81; 82) | ||
77 | PATH_TYPE@[82; 92) | ||
78 | PATH@[82; 92) | ||
79 | PATH_SEGMENT@[82; 92) | ||
80 | NAME_REF@[82; 85) | ||
81 | IDENT@[82; 85) "Vec" | ||
82 | TYPE_ARG_LIST@[85; 92) | ||
83 | L_ANGLE@[85; 86) | ||
84 | TYPE_ARG@[86; 91) | ||
85 | PATH_TYPE@[86; 91) | ||
86 | PATH@[86; 91) | ||
87 | PATH_SEGMENT@[86; 91) | ||
88 | NAME_REF@[86; 91) | ||
89 | IDENT@[86; 91) "Event" | ||
90 | R_ANGLE@[91; 92) | ||
91 | R_PAREN@[92; 93) | ||
92 | WHITESPACE@[93; 94) | ||
93 | BLOCK_EXPR@[94; 389) | ||
94 | L_CURLY@[94; 95) | ||
95 | WHITESPACE@[95; 100) | ||
96 | LET_STMT@[100; 125) | ||
97 | LET_KW@[100; 103) | ||
98 | WHITESPACE@[103; 104) | ||
99 | BIND_PAT@[104; 120) | ||
100 | MUT_KW@[104; 107) | ||
101 | WHITESPACE@[107; 108) | ||
102 | NAME@[108; 120) | ||
103 | IDENT@[108; 120) "next_tok_idx" | ||
104 | WHITESPACE@[120; 121) | ||
105 | EQ@[121; 122) | ||
106 | WHITESPACE@[122; 123) | ||
107 | LITERAL@[123; 124) | ||
108 | INT_NUMBER@[123; 124) "0" | ||
109 | SEMI@[124; 125) | ||
110 | WHITESPACE@[125; 130) | ||
111 | LET_STMT@[130; 389) | ||
112 | LET_KW@[130; 133) | ||
113 | WHITESPACE@[133; 134) | ||
114 | BIND_PAT@[134; 140) | ||
115 | NAME@[134; 140) | ||
116 | IDENT@[134; 140) "eat_ws" | ||
117 | WHITESPACE@[140; 141) | ||
118 | EQ@[141; 142) | ||
119 | WHITESPACE@[142; 143) | ||
120 | LAMBDA_EXPR@[143; 389) | ||
121 | PARAM_LIST@[143; 388) | ||
122 | PIPE@[143; 144) | ||
123 | PARAM@[144; 159) | ||
124 | BIND_PAT@[144; 147) | ||
125 | NAME@[144; 147) | ||
126 | IDENT@[144; 147) "idx" | ||
127 | COLON@[147; 148) | ||
128 | WHITESPACE@[148; 149) | ||
129 | REFERENCE_TYPE@[149; 159) | ||
130 | AMP@[149; 150) | ||
131 | MUT_KW@[150; 153) | ||
132 | WHITESPACE@[153; 154) | ||
133 | PATH_TYPE@[154; 159) | ||
134 | PATH@[154; 159) | ||
135 | PATH_SEGMENT@[154; 159) | ||
136 | NAME_REF@[154; 159) | ||
137 | IDENT@[154; 159) "usize" | ||
138 | COMMA@[159; 160) | ||
139 | WHITESPACE@[160; 161) | ||
140 | PARAM@[161; 167) | ||
141 | REF_PAT@[161; 167) | ||
142 | AMP@[161; 162) | ||
143 | MUT_KW@[162; 165) | ||
144 | WHITESPACE@[165; 166) | ||
145 | err: `expected pattern` | ||
146 | ERROR@[166; 167) | ||
147 | PIPE@[166; 167) | ||
148 | err: `expected COMMA` | ||
149 | WHITESPACE@[167; 168) | ||
150 | err: `expected pattern` | ||
151 | PARAM@[168; 169) | ||
152 | ERROR@[168; 169) | ||
153 | L_CURLY@[168; 169) | ||
154 | err: `expected COMMA` | ||
155 | WHITESPACE@[169; 178) | ||
156 | err: `expected pattern` | ||
157 | PARAM@[178; 183) | ||
158 | ERROR@[178; 183) | ||
159 | WHILE_KW@[178; 183) | ||
160 | err: `expected COMMA` | ||
161 | WHITESPACE@[183; 184) | ||
162 | err: `expected pattern` | ||
163 | PARAM@[184; 187) | ||
164 | ERROR@[184; 187) | ||
165 | LET_KW@[184; 187) | ||
166 | err: `expected COMMA` | ||
167 | WHITESPACE@[187; 188) | ||
168 | PARAM@[188; 199) | ||
169 | TUPLE_STRUCT_PAT@[188; 199) | ||
170 | PATH@[188; 192) | ||
171 | PATH_SEGMENT@[188; 192) | ||
172 | NAME_REF@[188; 192) | ||
173 | IDENT@[188; 192) "Some" | ||
174 | L_PAREN@[192; 193) | ||
175 | BIND_PAT@[193; 198) | ||
176 | NAME@[193; 198) | ||
177 | IDENT@[193; 198) "token" | ||
178 | R_PAREN@[198; 199) | ||
179 | err: `expected COMMA` | ||
180 | WHITESPACE@[199; 200) | ||
181 | err: `expected pattern` | ||
182 | PARAM@[200; 201) | ||
183 | ERROR@[200; 201) | ||
184 | EQ@[200; 201) | ||
185 | err: `expected COMMA` | ||
186 | WHITESPACE@[201; 202) | ||
187 | PARAM@[202; 208) | ||
188 | BIND_PAT@[202; 208) | ||
189 | NAME@[202; 208) | ||
190 | IDENT@[202; 208) "tokens" | ||
191 | err: `expected COMMA` | ||
192 | err: `expected pattern` | ||
193 | PARAM@[208; 209) | ||
194 | ERROR@[208; 209) | ||
195 | DOT@[208; 209) | ||
196 | err: `expected COMMA` | ||
197 | PARAM@[209; 218) | ||
198 | TUPLE_STRUCT_PAT@[209; 218) | ||
199 | PATH@[209; 212) | ||
200 | PATH_SEGMENT@[209; 212) | ||
201 | NAME_REF@[209; 212) | ||
202 | IDENT@[209; 212) "get" | ||
203 | L_PAREN@[212; 213) | ||
204 | err: `expected pattern` | ||
205 | ERROR@[213; 214) | ||
206 | STAR@[213; 214) | ||
207 | err: `expected COMMA` | ||
208 | BIND_PAT@[214; 217) | ||
209 | NAME@[214; 217) | ||
210 | IDENT@[214; 217) "idx" | ||
211 | R_PAREN@[217; 218) | ||
212 | err: `expected COMMA` | ||
213 | WHITESPACE@[218; 219) | ||
214 | err: `expected pattern` | ||
215 | PARAM@[219; 220) | ||
216 | ERROR@[219; 220) | ||
217 | L_CURLY@[219; 220) | ||
218 | err: `expected COMMA` | ||
219 | WHITESPACE@[220; 233) | ||
220 | err: `expected pattern` | ||
221 | PARAM@[233; 235) | ||
222 | ERROR@[233; 235) | ||
223 | IF_KW@[233; 235) | ||
224 | err: `expected COMMA` | ||
225 | WHITESPACE@[235; 236) | ||
226 | err: `expected pattern` | ||
227 | PARAM@[236; 237) | ||
228 | ERROR@[236; 237) | ||
229 | EXCL@[236; 237) | ||
230 | err: `expected COMMA` | ||
231 | PARAM@[237; 242) | ||
232 | BIND_PAT@[237; 242) | ||
233 | NAME@[237; 242) | ||
234 | IDENT@[237; 242) "token" | ||
235 | err: `expected COMMA` | ||
236 | err: `expected pattern` | ||
237 | PARAM@[242; 243) | ||
238 | ERROR@[242; 243) | ||
239 | DOT@[242; 243) | ||
240 | err: `expected COMMA` | ||
241 | PARAM@[243; 247) | ||
242 | BIND_PAT@[243; 247) | ||
243 | NAME@[243; 247) | ||
244 | IDENT@[243; 247) "kind" | ||
245 | err: `expected COMMA` | ||
246 | err: `expected pattern` | ||
247 | PARAM@[247; 248) | ||
248 | ERROR@[247; 248) | ||
249 | DOT@[247; 248) | ||
250 | err: `expected COMMA` | ||
251 | PARAM@[248; 259) | ||
252 | TUPLE_STRUCT_PAT@[248; 259) | ||
253 | PATH@[248; 257) | ||
254 | PATH_SEGMENT@[248; 257) | ||
255 | NAME_REF@[248; 257) | ||
256 | IDENT@[248; 257) "is_trivia" | ||
257 | L_PAREN@[257; 258) | ||
258 | R_PAREN@[258; 259) | ||
259 | err: `expected COMMA` | ||
260 | WHITESPACE@[259; 260) | ||
261 | err: `expected pattern` | ||
262 | PARAM@[260; 261) | ||
263 | ERROR@[260; 261) | ||
264 | L_CURLY@[260; 261) | ||
265 | err: `expected COMMA` | ||
266 | WHITESPACE@[261; 278) | ||
267 | PARAM@[278; 283) | ||
268 | BIND_PAT@[278; 283) | ||
269 | NAME@[278; 283) | ||
270 | IDENT@[278; 283) "break" | ||
271 | err: `expected COMMA` | ||
272 | err: `expected pattern` | ||
273 | PARAM@[283; 284) | ||
274 | ERROR@[283; 284) | ||
275 | SEMI@[283; 284) | ||
276 | err: `expected COMMA` | ||
277 | WHITESPACE@[284; 297) | ||
278 | err: `expected pattern` | ||
279 | PARAM@[297; 298) | ||
280 | ERROR@[297; 298) | ||
281 | R_CURLY@[297; 298) | ||
282 | err: `expected COMMA` | ||
283 | WHITESPACE@[298; 311) | ||
284 | PARAM@[311; 318) | ||
285 | BIND_PAT@[311; 318) | ||
286 | NAME@[311; 318) | ||
287 | IDENT@[311; 318) "builder" | ||
288 | err: `expected COMMA` | ||
289 | err: `expected pattern` | ||
290 | PARAM@[318; 319) | ||
291 | ERROR@[318; 319) | ||
292 | DOT@[318; 319) | ||
293 | err: `expected COMMA` | ||
294 | PARAM@[319; 346) | ||
295 | TUPLE_STRUCT_PAT@[319; 346) | ||
296 | PATH@[319; 323) | ||
297 | PATH_SEGMENT@[319; 323) | ||
298 | NAME_REF@[319; 323) | ||
299 | IDENT@[319; 323) "leaf" | ||
300 | L_PAREN@[323; 324) | ||
301 | BIND_PAT@[324; 329) | ||
302 | NAME@[324; 329) | ||
303 | IDENT@[324; 329) "token" | ||
304 | err: `expected COMMA` | ||
305 | err: `expected pattern` | ||
306 | ERROR@[329; 330) | ||
307 | DOT@[329; 330) | ||
308 | err: `expected COMMA` | ||
309 | BIND_PAT@[330; 334) | ||
310 | NAME@[330; 334) | ||
311 | IDENT@[330; 334) "kind" | ||
312 | COMMA@[334; 335) | ||
313 | WHITESPACE@[335; 336) | ||
314 | BIND_PAT@[336; 341) | ||
315 | NAME@[336; 341) | ||
316 | IDENT@[336; 341) "token" | ||
317 | err: `expected COMMA` | ||
318 | err: `expected pattern` | ||
319 | ERROR@[341; 342) | ||
320 | DOT@[341; 342) | ||
321 | err: `expected COMMA` | ||
322 | BIND_PAT@[342; 345) | ||
323 | NAME@[342; 345) | ||
324 | IDENT@[342; 345) "len" | ||
325 | R_PAREN@[345; 346) | ||
326 | err: `expected COMMA` | ||
327 | err: `expected pattern` | ||
328 | PARAM@[346; 347) | ||
329 | ERROR@[346; 347) | ||
330 | SEMI@[346; 347) | ||
331 | err: `expected COMMA` | ||
332 | WHITESPACE@[347; 360) | ||
333 | err: `expected pattern` | ||
334 | PARAM@[360; 361) | ||
335 | ERROR@[360; 361) | ||
336 | STAR@[360; 361) | ||
337 | err: `expected COMMA` | ||
338 | PARAM@[361; 364) | ||
339 | BIND_PAT@[361; 364) | ||
340 | NAME@[361; 364) | ||
341 | IDENT@[361; 364) "idx" | ||
342 | err: `expected COMMA` | ||
343 | WHITESPACE@[364; 365) | ||
344 | err: `expected pattern` | ||
345 | PARAM@[365; 366) | ||
346 | ERROR@[365; 366) | ||
347 | PLUS@[365; 366) | ||
348 | err: `expected COMMA` | ||
349 | err: `expected pattern` | ||
350 | PARAM@[366; 367) | ||
351 | ERROR@[366; 367) | ||
352 | EQ@[366; 367) | ||
353 | err: `expected COMMA` | ||
354 | WHITESPACE@[367; 368) | ||
355 | PARAM@[368; 369) | ||
356 | LITERAL@[368; 369) | ||
357 | INT_NUMBER@[368; 369) "1" | ||
358 | err: `expected COMMA` | ||
359 | WHITESPACE@[369; 378) | ||
360 | err: `expected pattern` | ||
361 | PARAM@[378; 379) | ||
362 | ERROR@[378; 379) | ||
363 | R_CURLY@[378; 379) | ||
364 | err: `expected COMMA` | ||
365 | WHITESPACE@[379; 384) | ||
366 | err: `expected pattern` | ||
367 | PARAM@[384; 385) | ||
368 | ERROR@[384; 385) | ||
369 | R_CURLY@[384; 385) | ||
370 | err: `expected COMMA` | ||
371 | err: `expected pattern` | ||
372 | PARAM@[385; 386) | ||
373 | ERROR@[385; 386) | ||
374 | SEMI@[385; 386) | ||
375 | err: `expected COMMA` | ||
376 | WHITESPACE@[386; 387) | ||
377 | err: `expected pattern` | ||
378 | PARAM@[387; 388) | ||
379 | ERROR@[387; 388) | ||
380 | R_CURLY@[387; 388) | ||
381 | err: `expected COMMA` | ||
382 | err: `expected PIPE` | ||
383 | WHITESPACE@[388; 389) | ||
384 | err: `expected expression` | ||
385 | err: `expected SEMI` | ||
386 | err: `expected R_CURLY` | ||
387 | ERROR@[389; 389) | ||