diff options
Diffstat (limited to 'crates/libsyntax2/tests/data')
305 files changed, 8037 insertions, 0 deletions
diff --git a/crates/libsyntax2/tests/data/lexer/00012_block_comment.rs b/crates/libsyntax2/tests/data/lexer/00012_block_comment.rs new file mode 100644 index 000000000..708aac197 --- /dev/null +++ b/crates/libsyntax2/tests/data/lexer/00012_block_comment.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | /* */ | ||
2 | /**/ | ||
3 | /* /* */ */ | ||
4 | /* | ||
diff --git a/crates/libsyntax2/tests/data/lexer/00012_block_comment.txt b/crates/libsyntax2/tests/data/lexer/00012_block_comment.txt new file mode 100644 index 000000000..9958b2518 --- /dev/null +++ b/crates/libsyntax2/tests/data/lexer/00012_block_comment.txt | |||
@@ -0,0 +1,7 @@ | |||
1 | COMMENT 5 "/* */" | ||
2 | WHITESPACE 1 "\n" | ||
3 | COMMENT 4 "/**/" | ||
4 | WHITESPACE 1 "\n" | ||
5 | COMMENT 11 "/* /* */ */" | ||
6 | WHITESPACE 1 "\n" | ||
7 | COMMENT 3 "/*\n" | ||
diff --git a/crates/libsyntax2/tests/data/lexer/0001_hello.rs b/crates/libsyntax2/tests/data/lexer/0001_hello.rs new file mode 100644 index 000000000..95d09f2b1 --- /dev/null +++ b/crates/libsyntax2/tests/data/lexer/0001_hello.rs | |||
@@ -0,0 +1 @@ | |||
hello world \ No newline at end of file | |||
diff --git a/crates/libsyntax2/tests/data/lexer/0001_hello.txt b/crates/libsyntax2/tests/data/lexer/0001_hello.txt new file mode 100644 index 000000000..27a5940a9 --- /dev/null +++ b/crates/libsyntax2/tests/data/lexer/0001_hello.txt | |||
@@ -0,0 +1,3 @@ | |||
1 | IDENT 5 "hello" | ||
2 | WHITESPACE 1 " " | ||
3 | IDENT 5 "world" | ||
diff --git a/crates/libsyntax2/tests/data/lexer/0002_whitespace.rs b/crates/libsyntax2/tests/data/lexer/0002_whitespace.rs new file mode 100644 index 000000000..08fce1418 --- /dev/null +++ b/crates/libsyntax2/tests/data/lexer/0002_whitespace.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | a b c | ||
2 | d | ||
3 | |||
4 | e f | ||
diff --git a/crates/libsyntax2/tests/data/lexer/0002_whitespace.txt b/crates/libsyntax2/tests/data/lexer/0002_whitespace.txt new file mode 100644 index 000000000..01d260918 --- /dev/null +++ b/crates/libsyntax2/tests/data/lexer/0002_whitespace.txt | |||
@@ -0,0 +1,12 @@ | |||
1 | IDENT 1 "a" | ||
2 | WHITESPACE 1 " " | ||
3 | IDENT 1 "b" | ||
4 | WHITESPACE 2 " " | ||
5 | IDENT 1 "c" | ||
6 | WHITESPACE 1 "\n" | ||
7 | IDENT 1 "d" | ||
8 | WHITESPACE 2 "\n\n" | ||
9 | IDENT 1 "e" | ||
10 | WHITESPACE 1 "\t" | ||
11 | IDENT 1 "f" | ||
12 | WHITESPACE 1 "\n" | ||
diff --git a/crates/libsyntax2/tests/data/lexer/0003_ident.rs b/crates/libsyntax2/tests/data/lexer/0003_ident.rs new file mode 100644 index 000000000..c05c9c009 --- /dev/null +++ b/crates/libsyntax2/tests/data/lexer/0003_ident.rs | |||
@@ -0,0 +1 @@ | |||
foo foo_ _foo _ __ x привет | |||
diff --git a/crates/libsyntax2/tests/data/lexer/0003_ident.txt b/crates/libsyntax2/tests/data/lexer/0003_ident.txt new file mode 100644 index 000000000..4a0d5c053 --- /dev/null +++ b/crates/libsyntax2/tests/data/lexer/0003_ident.txt | |||
@@ -0,0 +1,14 @@ | |||
1 | IDENT 3 "foo" | ||
2 | WHITESPACE 1 " " | ||
3 | IDENT 4 "foo_" | ||
4 | WHITESPACE 1 " " | ||
5 | IDENT 4 "_foo" | ||
6 | WHITESPACE 1 " " | ||
7 | UNDERSCORE 1 "_" | ||
8 | WHITESPACE 1 " " | ||
9 | IDENT 2 "__" | ||
10 | WHITESPACE 1 " " | ||
11 | IDENT 1 "x" | ||
12 | WHITESPACE 1 " " | ||
13 | IDENT 12 "привет" | ||
14 | WHITESPACE 1 "\n" | ||
diff --git a/crates/libsyntax2/tests/data/lexer/0004_numbers.rs b/crates/libsyntax2/tests/data/lexer/0004_numbers.rs new file mode 100644 index 000000000..dc974b553 --- /dev/null +++ b/crates/libsyntax2/tests/data/lexer/0004_numbers.rs | |||
@@ -0,0 +1,9 @@ | |||
1 | 0 0b 0o 0x 00 0_ 0. 0e 0E 0z | ||
2 | 01790 0b1790 0o1790 0x1790aAbBcCdDeEfF 001279 0_1279 0.1279 0e1279 0E1279 | ||
3 | 0..2 | ||
4 | 0.foo() | ||
5 | 0e+1 | ||
6 | 0.e+1 | ||
7 | 0.0E-2 | ||
8 | 0___0.10000____0000e+111__ | ||
9 | 1i64 92.0f32 11__s \ No newline at end of file | ||
diff --git a/crates/libsyntax2/tests/data/lexer/0004_numbers.txt b/crates/libsyntax2/tests/data/lexer/0004_numbers.txt new file mode 100644 index 000000000..4b5fd9f71 --- /dev/null +++ b/crates/libsyntax2/tests/data/lexer/0004_numbers.txt | |||
@@ -0,0 +1,67 @@ | |||
1 | INT_NUMBER 1 "0" | ||
2 | WHITESPACE 1 " " | ||
3 | INT_NUMBER 2 "0b" | ||
4 | WHITESPACE 1 " " | ||
5 | INT_NUMBER 2 "0o" | ||
6 | WHITESPACE 1 " " | ||
7 | INT_NUMBER 2 "0x" | ||
8 | WHITESPACE 1 " " | ||
9 | INT_NUMBER 2 "00" | ||
10 | WHITESPACE 1 " " | ||
11 | INT_NUMBER 2 "0_" | ||
12 | WHITESPACE 1 " " | ||
13 | FLOAT_NUMBER 2 "0." | ||
14 | WHITESPACE 1 " " | ||
15 | INT_NUMBER 2 "0e" | ||
16 | WHITESPACE 1 " " | ||
17 | INT_NUMBER 2 "0E" | ||
18 | WHITESPACE 1 " " | ||
19 | INT_NUMBER 2 "0z" | ||
20 | WHITESPACE 1 "\n" | ||
21 | INT_NUMBER 5 "01790" | ||
22 | WHITESPACE 1 " " | ||
23 | INT_NUMBER 6 "0b1790" | ||
24 | WHITESPACE 1 " " | ||
25 | INT_NUMBER 6 "0o1790" | ||
26 | WHITESPACE 1 " " | ||
27 | INT_NUMBER 18 "0x1790aAbBcCdDeEfF" | ||
28 | WHITESPACE 1 " " | ||
29 | INT_NUMBER 6 "001279" | ||
30 | WHITESPACE 1 " " | ||
31 | INT_NUMBER 6 "0_1279" | ||
32 | WHITESPACE 1 " " | ||
33 | FLOAT_NUMBER 6 "0.1279" | ||
34 | WHITESPACE 1 " " | ||
35 | INT_NUMBER 6 "0e1279" | ||
36 | WHITESPACE 1 " " | ||
37 | INT_NUMBER 6 "0E1279" | ||
38 | WHITESPACE 1 "\n" | ||
39 | INT_NUMBER 1 "0" | ||
40 | DOTDOT 2 ".." | ||
41 | INT_NUMBER 1 "2" | ||
42 | WHITESPACE 1 "\n" | ||
43 | INT_NUMBER 1 "0" | ||
44 | DOT 1 "." | ||
45 | IDENT 3 "foo" | ||
46 | L_PAREN 1 "(" | ||
47 | R_PAREN 1 ")" | ||
48 | WHITESPACE 1 "\n" | ||
49 | INT_NUMBER 2 "0e" | ||
50 | PLUS 1 "+" | ||
51 | INT_NUMBER 1 "1" | ||
52 | WHITESPACE 1 "\n" | ||
53 | INT_NUMBER 1 "0" | ||
54 | DOT 1 "." | ||
55 | IDENT 1 "e" | ||
56 | PLUS 1 "+" | ||
57 | INT_NUMBER 1 "1" | ||
58 | WHITESPACE 1 "\n" | ||
59 | FLOAT_NUMBER 6 "0.0E-2" | ||
60 | WHITESPACE 1 "\n" | ||
61 | FLOAT_NUMBER 26 "0___0.10000____0000e+111__" | ||
62 | WHITESPACE 1 "\n" | ||
63 | INT_NUMBER 4 "1i64" | ||
64 | WHITESPACE 1 " " | ||
65 | FLOAT_NUMBER 7 "92.0f32" | ||
66 | WHITESPACE 1 " " | ||
67 | INT_NUMBER 5 "11__s" | ||
diff --git a/crates/libsyntax2/tests/data/lexer/0005_symbols.rs b/crates/libsyntax2/tests/data/lexer/0005_symbols.rs new file mode 100644 index 000000000..487569b5a --- /dev/null +++ b/crates/libsyntax2/tests/data/lexer/0005_symbols.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | ; , ( ) { } [ ] < > @ # ~ ? $ & | + * / ^ % | ||
2 | . .. ... ..= | ||
3 | : :: | ||
4 | = => | ||
5 | ! != | ||
6 | - -> | ||
diff --git a/crates/libsyntax2/tests/data/lexer/0005_symbols.txt b/crates/libsyntax2/tests/data/lexer/0005_symbols.txt new file mode 100644 index 000000000..a6bc83a6f --- /dev/null +++ b/crates/libsyntax2/tests/data/lexer/0005_symbols.txt | |||
@@ -0,0 +1,68 @@ | |||
1 | SEMI 1 ";" | ||
2 | WHITESPACE 1 " " | ||
3 | COMMA 1 "," | ||
4 | WHITESPACE 1 " " | ||
5 | L_PAREN 1 "(" | ||
6 | WHITESPACE 1 " " | ||
7 | R_PAREN 1 ")" | ||
8 | WHITESPACE 1 " " | ||
9 | L_CURLY 1 "{" | ||
10 | WHITESPACE 1 " " | ||
11 | R_CURLY 1 "}" | ||
12 | WHITESPACE 1 " " | ||
13 | L_BRACK 1 "[" | ||
14 | WHITESPACE 1 " " | ||
15 | R_BRACK 1 "]" | ||
16 | WHITESPACE 1 " " | ||
17 | L_ANGLE 1 "<" | ||
18 | WHITESPACE 1 " " | ||
19 | R_ANGLE 1 ">" | ||
20 | WHITESPACE 1 " " | ||
21 | AT 1 "@" | ||
22 | WHITESPACE 1 " " | ||
23 | POUND 1 "#" | ||
24 | WHITESPACE 1 " " | ||
25 | TILDE 1 "~" | ||
26 | WHITESPACE 1 " " | ||
27 | QUESTION 1 "?" | ||
28 | WHITESPACE 1 " " | ||
29 | DOLLAR 1 "$" | ||
30 | WHITESPACE 1 " " | ||
31 | AMP 1 "&" | ||
32 | WHITESPACE 1 " " | ||
33 | PIPE 1 "|" | ||
34 | WHITESPACE 1 " " | ||
35 | PLUS 1 "+" | ||
36 | WHITESPACE 1 " " | ||
37 | STAR 1 "*" | ||
38 | WHITESPACE 1 " " | ||
39 | SLASH 1 "/" | ||
40 | WHITESPACE 1 " " | ||
41 | CARET 1 "^" | ||
42 | WHITESPACE 1 " " | ||
43 | PERCENT 1 "%" | ||
44 | WHITESPACE 1 "\n" | ||
45 | DOT 1 "." | ||
46 | WHITESPACE 1 " " | ||
47 | DOTDOT 2 ".." | ||
48 | WHITESPACE 1 " " | ||
49 | DOTDOTDOT 3 "..." | ||
50 | WHITESPACE 1 " " | ||
51 | DOTDOTEQ 3 "..=" | ||
52 | WHITESPACE 1 "\n" | ||
53 | COLON 1 ":" | ||
54 | WHITESPACE 1 " " | ||
55 | COLONCOLON 2 "::" | ||
56 | WHITESPACE 1 "\n" | ||
57 | EQ 1 "=" | ||
58 | WHITESPACE 1 " " | ||
59 | FAT_ARROW 2 "=>" | ||
60 | WHITESPACE 1 "\n" | ||
61 | EXCL 1 "!" | ||
62 | WHITESPACE 1 " " | ||
63 | NEQ 2 "!=" | ||
64 | WHITESPACE 1 "\n" | ||
65 | MINUS 1 "-" | ||
66 | WHITESPACE 1 " " | ||
67 | THIN_ARROW 2 "->" | ||
68 | WHITESPACE 1 "\n" | ||
diff --git a/crates/libsyntax2/tests/data/lexer/0006_chars.rs b/crates/libsyntax2/tests/data/lexer/0006_chars.rs new file mode 100644 index 000000000..03598d908 --- /dev/null +++ b/crates/libsyntax2/tests/data/lexer/0006_chars.rs | |||
@@ -0,0 +1 @@ | |||
'x' ' ' '0' | |||
diff --git a/crates/libsyntax2/tests/data/lexer/0006_chars.txt b/crates/libsyntax2/tests/data/lexer/0006_chars.txt new file mode 100644 index 000000000..ecaf22355 --- /dev/null +++ b/crates/libsyntax2/tests/data/lexer/0006_chars.txt | |||
@@ -0,0 +1,6 @@ | |||
1 | CHAR 3 "\'x\'" | ||
2 | WHITESPACE 1 " " | ||
3 | CHAR 3 "\' \'" | ||
4 | WHITESPACE 1 " " | ||
5 | CHAR 3 "\'0\'" | ||
6 | WHITESPACE 1 "\n" | ||
diff --git a/crates/libsyntax2/tests/data/lexer/0007_lifetimes.rs b/crates/libsyntax2/tests/data/lexer/0007_lifetimes.rs new file mode 100644 index 000000000..b764f1dce --- /dev/null +++ b/crates/libsyntax2/tests/data/lexer/0007_lifetimes.rs | |||
@@ -0,0 +1 @@ | |||
'a 'foo 'foo_bar_baz '_ | |||
diff --git a/crates/libsyntax2/tests/data/lexer/0007_lifetimes.txt b/crates/libsyntax2/tests/data/lexer/0007_lifetimes.txt new file mode 100644 index 000000000..005c29100 --- /dev/null +++ b/crates/libsyntax2/tests/data/lexer/0007_lifetimes.txt | |||
@@ -0,0 +1,8 @@ | |||
1 | LIFETIME 2 "\'a" | ||
2 | WHITESPACE 1 " " | ||
3 | LIFETIME 4 "\'foo" | ||
4 | WHITESPACE 1 " " | ||
5 | LIFETIME 12 "\'foo_bar_baz" | ||
6 | WHITESPACE 1 " " | ||
7 | LIFETIME 2 "\'_" | ||
8 | WHITESPACE 1 "\n" | ||
diff --git a/crates/libsyntax2/tests/data/lexer/0008_byte_strings.rs b/crates/libsyntax2/tests/data/lexer/0008_byte_strings.rs new file mode 100644 index 000000000..9dd1570de --- /dev/null +++ b/crates/libsyntax2/tests/data/lexer/0008_byte_strings.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | b'' b'x' b"foo" br"" | ||
2 | b''suf b""ix br""br | ||
diff --git a/crates/libsyntax2/tests/data/lexer/0008_byte_strings.txt b/crates/libsyntax2/tests/data/lexer/0008_byte_strings.txt new file mode 100644 index 000000000..ed8cd4bab --- /dev/null +++ b/crates/libsyntax2/tests/data/lexer/0008_byte_strings.txt | |||
@@ -0,0 +1,14 @@ | |||
1 | BYTE 3 "b\'\'" | ||
2 | WHITESPACE 1 " " | ||
3 | BYTE 4 "b\'x\'" | ||
4 | WHITESPACE 1 " " | ||
5 | BYTE_STRING 6 "b\"foo\"" | ||
6 | WHITESPACE 1 " " | ||
7 | RAW_BYTE_STRING 4 "br\"\"" | ||
8 | WHITESPACE 1 "\n" | ||
9 | BYTE 6 "b\'\'suf" | ||
10 | WHITESPACE 1 " " | ||
11 | BYTE_STRING 5 "b\"\"ix" | ||
12 | WHITESPACE 1 " " | ||
13 | RAW_BYTE_STRING 6 "br\"\"br" | ||
14 | WHITESPACE 1 "\n" | ||
diff --git a/crates/libsyntax2/tests/data/lexer/0009_strings.rs b/crates/libsyntax2/tests/data/lexer/0009_strings.rs new file mode 100644 index 000000000..7b7faa5d8 --- /dev/null +++ b/crates/libsyntax2/tests/data/lexer/0009_strings.rs | |||
@@ -0,0 +1 @@ | |||
"hello" r"world" | |||
diff --git a/crates/libsyntax2/tests/data/lexer/0009_strings.txt b/crates/libsyntax2/tests/data/lexer/0009_strings.txt new file mode 100644 index 000000000..7fb6b7b36 --- /dev/null +++ b/crates/libsyntax2/tests/data/lexer/0009_strings.txt | |||
@@ -0,0 +1,4 @@ | |||
1 | STRING 7 "\"hello\"" | ||
2 | WHITESPACE 1 " " | ||
3 | RAW_STRING 8 "r\"world\"" | ||
4 | WHITESPACE 1 "\n" | ||
diff --git a/crates/libsyntax2/tests/data/lexer/0010_comments.rs b/crates/libsyntax2/tests/data/lexer/0010_comments.rs new file mode 100644 index 000000000..71bdd1f9c --- /dev/null +++ b/crates/libsyntax2/tests/data/lexer/0010_comments.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | // hello | ||
3 | //! World | ||
diff --git a/crates/libsyntax2/tests/data/lexer/0010_comments.txt b/crates/libsyntax2/tests/data/lexer/0010_comments.txt new file mode 100644 index 000000000..3c997de3f --- /dev/null +++ b/crates/libsyntax2/tests/data/lexer/0010_comments.txt | |||
@@ -0,0 +1,6 @@ | |||
1 | SHEBANG 19 "#!/usr/bin/env bash" | ||
2 | WHITESPACE 1 "\n" | ||
3 | COMMENT 8 "// hello" | ||
4 | WHITESPACE 1 "\n" | ||
5 | COMMENT 9 "//! World" | ||
6 | WHITESPACE 1 "\n" | ||
diff --git a/crates/libsyntax2/tests/data/lexer/0011_keywords.rs b/crates/libsyntax2/tests/data/lexer/0011_keywords.rs new file mode 100644 index 000000000..e6bf64d4d --- /dev/null +++ b/crates/libsyntax2/tests/data/lexer/0011_keywords.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn use struct trait enum impl true false as extern crate | ||
2 | mod pub self super in where for loop while if match const | ||
3 | static mut type ref let else move return | ||
diff --git a/crates/libsyntax2/tests/data/lexer/0011_keywords.txt b/crates/libsyntax2/tests/data/lexer/0011_keywords.txt new file mode 100644 index 000000000..d6a1abe8a --- /dev/null +++ b/crates/libsyntax2/tests/data/lexer/0011_keywords.txt | |||
@@ -0,0 +1,62 @@ | |||
1 | FN_KW 2 "fn" | ||
2 | WHITESPACE 1 " " | ||
3 | USE_KW 3 "use" | ||
4 | WHITESPACE 1 " " | ||
5 | STRUCT_KW 6 "struct" | ||
6 | WHITESPACE 1 " " | ||
7 | TRAIT_KW 5 "trait" | ||
8 | WHITESPACE 1 " " | ||
9 | ENUM_KW 4 "enum" | ||
10 | WHITESPACE 1 " " | ||
11 | IMPL_KW 4 "impl" | ||
12 | WHITESPACE 1 " " | ||
13 | TRUE_KW 4 "true" | ||
14 | WHITESPACE 1 " " | ||
15 | FALSE_KW 5 "false" | ||
16 | WHITESPACE 1 " " | ||
17 | AS_KW 2 "as" | ||
18 | WHITESPACE 1 " " | ||
19 | EXTERN_KW 6 "extern" | ||
20 | WHITESPACE 1 " " | ||
21 | CRATE_KW 5 "crate" | ||
22 | WHITESPACE 1 "\n" | ||
23 | MOD_KW 3 "mod" | ||
24 | WHITESPACE 1 " " | ||
25 | PUB_KW 3 "pub" | ||
26 | WHITESPACE 1 " " | ||
27 | SELF_KW 4 "self" | ||
28 | WHITESPACE 1 " " | ||
29 | SUPER_KW 5 "super" | ||
30 | WHITESPACE 1 " " | ||
31 | IN_KW 2 "in" | ||
32 | WHITESPACE 1 " " | ||
33 | WHERE_KW 5 "where" | ||
34 | WHITESPACE 1 " " | ||
35 | FOR_KW 3 "for" | ||
36 | WHITESPACE 1 " " | ||
37 | LOOP_KW 4 "loop" | ||
38 | WHITESPACE 1 " " | ||
39 | WHILE_KW 5 "while" | ||
40 | WHITESPACE 1 " " | ||
41 | IF_KW 2 "if" | ||
42 | WHITESPACE 1 " " | ||
43 | MATCH_KW 5 "match" | ||
44 | WHITESPACE 1 " " | ||
45 | CONST_KW 5 "const" | ||
46 | WHITESPACE 1 "\n" | ||
47 | STATIC_KW 6 "static" | ||
48 | WHITESPACE 1 " " | ||
49 | MUT_KW 3 "mut" | ||
50 | WHITESPACE 1 " " | ||
51 | TYPE_KW 4 "type" | ||
52 | WHITESPACE 1 " " | ||
53 | REF_KW 3 "ref" | ||
54 | WHITESPACE 1 " " | ||
55 | LET_KW 3 "let" | ||
56 | WHITESPACE 1 " " | ||
57 | ELSE_KW 4 "else" | ||
58 | WHITESPACE 1 " " | ||
59 | MOVE_KW 4 "move" | ||
60 | WHITESPACE 1 " " | ||
61 | RETURN_KW 6 "return" | ||
62 | WHITESPACE 1 "\n" | ||
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) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0001_const_unsafe_fn.rs b/crates/libsyntax2/tests/data/parser/inline/0001_const_unsafe_fn.rs new file mode 100644 index 000000000..31a1e435f --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0001_const_unsafe_fn.rs | |||
@@ -0,0 +1 @@ | |||
const unsafe fn foo() {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0001_const_unsafe_fn.txt b/crates/libsyntax2/tests/data/parser/inline/0001_const_unsafe_fn.txt new file mode 100644 index 000000000..3932d033c --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0001_const_unsafe_fn.txt | |||
@@ -0,0 +1,18 @@ | |||
1 | FILE@[0; 25) | ||
2 | FUNCTION@[0; 24) | ||
3 | CONST_KW@[0; 5) | ||
4 | WHITESPACE@[5; 6) | ||
5 | UNSAFE_KW@[6; 12) | ||
6 | WHITESPACE@[12; 13) | ||
7 | FN_KW@[13; 15) | ||
8 | WHITESPACE@[15; 16) | ||
9 | NAME@[16; 19) | ||
10 | IDENT@[16; 19) "foo" | ||
11 | PARAM_LIST@[19; 21) | ||
12 | L_PAREN@[19; 20) | ||
13 | R_PAREN@[20; 21) | ||
14 | WHITESPACE@[21; 22) | ||
15 | BLOCK_EXPR@[22; 24) | ||
16 | L_CURLY@[22; 23) | ||
17 | R_CURLY@[23; 24) | ||
18 | WHITESPACE@[24; 25) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0002_const_fn.rs b/crates/libsyntax2/tests/data/parser/inline/0002_const_fn.rs new file mode 100644 index 000000000..8c84d9cd7 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0002_const_fn.rs | |||
@@ -0,0 +1 @@ | |||
const fn foo() {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0002_const_fn.txt b/crates/libsyntax2/tests/data/parser/inline/0002_const_fn.txt new file mode 100644 index 000000000..bc72ab235 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0002_const_fn.txt | |||
@@ -0,0 +1,16 @@ | |||
1 | FILE@[0; 18) | ||
2 | FUNCTION@[0; 17) | ||
3 | CONST_KW@[0; 5) | ||
4 | WHITESPACE@[5; 6) | ||
5 | FN_KW@[6; 8) | ||
6 | WHITESPACE@[8; 9) | ||
7 | NAME@[9; 12) | ||
8 | IDENT@[9; 12) "foo" | ||
9 | PARAM_LIST@[12; 14) | ||
10 | L_PAREN@[12; 13) | ||
11 | R_PAREN@[13; 14) | ||
12 | WHITESPACE@[14; 15) | ||
13 | BLOCK_EXPR@[15; 17) | ||
14 | L_CURLY@[15; 16) | ||
15 | R_CURLY@[16; 17) | ||
16 | WHITESPACE@[17; 18) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0003_extern_block.rs b/crates/libsyntax2/tests/data/parser/inline/0003_extern_block.rs new file mode 100644 index 000000000..26a9ccd1e --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0003_extern_block.rs | |||
@@ -0,0 +1 @@ | |||
extern {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0003_extern_block.txt b/crates/libsyntax2/tests/data/parser/inline/0003_extern_block.txt new file mode 100644 index 000000000..cbe9a1ebc --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0003_extern_block.txt | |||
@@ -0,0 +1,8 @@ | |||
1 | FILE@[0; 10) | ||
2 | EXTERN_BLOCK_EXPR@[0; 9) | ||
3 | ABI@[0; 6) | ||
4 | EXTERN_KW@[0; 6) | ||
5 | WHITESPACE@[6; 7) | ||
6 | L_CURLY@[7; 8) | ||
7 | R_CURLY@[8; 9) | ||
8 | WHITESPACE@[9; 10) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0004_extern_fn.rs b/crates/libsyntax2/tests/data/parser/inline/0004_extern_fn.rs new file mode 100644 index 000000000..394a049f0 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0004_extern_fn.rs | |||
@@ -0,0 +1 @@ | |||
extern fn foo() {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0004_extern_fn.txt b/crates/libsyntax2/tests/data/parser/inline/0004_extern_fn.txt new file mode 100644 index 000000000..e7787d4ab --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0004_extern_fn.txt | |||
@@ -0,0 +1,17 @@ | |||
1 | FILE@[0; 19) | ||
2 | FUNCTION@[0; 18) | ||
3 | ABI@[0; 6) | ||
4 | EXTERN_KW@[0; 6) | ||
5 | WHITESPACE@[6; 7) | ||
6 | FN_KW@[7; 9) | ||
7 | WHITESPACE@[9; 10) | ||
8 | NAME@[10; 13) | ||
9 | IDENT@[10; 13) "foo" | ||
10 | PARAM_LIST@[13; 15) | ||
11 | L_PAREN@[13; 14) | ||
12 | R_PAREN@[14; 15) | ||
13 | WHITESPACE@[15; 16) | ||
14 | BLOCK_EXPR@[16; 18) | ||
15 | L_CURLY@[16; 17) | ||
16 | R_CURLY@[17; 18) | ||
17 | WHITESPACE@[18; 19) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0005_extern_crate.rs b/crates/libsyntax2/tests/data/parser/inline/0005_extern_crate.rs new file mode 100644 index 000000000..49af74e1b --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0005_extern_crate.rs | |||
@@ -0,0 +1 @@ | |||
extern crate foo; | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0005_extern_crate.txt b/crates/libsyntax2/tests/data/parser/inline/0005_extern_crate.txt new file mode 100644 index 000000000..eac8656ac --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0005_extern_crate.txt | |||
@@ -0,0 +1,10 @@ | |||
1 | FILE@[0; 18) | ||
2 | EXTERN_CRATE_ITEM@[0; 17) | ||
3 | EXTERN_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | CRATE_KW@[7; 12) | ||
6 | WHITESPACE@[12; 13) | ||
7 | NAME@[13; 16) | ||
8 | IDENT@[13; 16) "foo" | ||
9 | SEMI@[16; 17) | ||
10 | WHITESPACE@[17; 18) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0007_unsafe_trait.rs b/crates/libsyntax2/tests/data/parser/inline/0007_unsafe_trait.rs new file mode 100644 index 000000000..04e021550 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0007_unsafe_trait.rs | |||
@@ -0,0 +1 @@ | |||
unsafe trait T {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0007_unsafe_trait.txt b/crates/libsyntax2/tests/data/parser/inline/0007_unsafe_trait.txt new file mode 100644 index 000000000..afa6637d3 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0007_unsafe_trait.txt | |||
@@ -0,0 +1,12 @@ | |||
1 | FILE@[0; 18) | ||
2 | TRAIT_ITEM@[0; 17) | ||
3 | UNSAFE_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | TRAIT_KW@[7; 12) | ||
6 | WHITESPACE@[12; 13) | ||
7 | NAME@[13; 14) | ||
8 | IDENT@[13; 14) "T" | ||
9 | WHITESPACE@[14; 15) | ||
10 | L_CURLY@[15; 16) | ||
11 | R_CURLY@[16; 17) | ||
12 | WHITESPACE@[17; 18) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0008_unsafe_impl.rs b/crates/libsyntax2/tests/data/parser/inline/0008_unsafe_impl.rs new file mode 100644 index 000000000..41055f41d --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0008_unsafe_impl.rs | |||
@@ -0,0 +1 @@ | |||
unsafe impl Foo {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0008_unsafe_impl.txt b/crates/libsyntax2/tests/data/parser/inline/0008_unsafe_impl.txt new file mode 100644 index 000000000..6fd3f868f --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0008_unsafe_impl.txt | |||
@@ -0,0 +1,15 @@ | |||
1 | FILE@[0; 19) | ||
2 | IMPL_ITEM@[0; 18) | ||
3 | UNSAFE_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | IMPL_KW@[7; 11) | ||
6 | WHITESPACE@[11; 12) | ||
7 | PATH_TYPE@[12; 15) | ||
8 | PATH@[12; 15) | ||
9 | PATH_SEGMENT@[12; 15) | ||
10 | NAME_REF@[12; 15) | ||
11 | IDENT@[12; 15) "Foo" | ||
12 | WHITESPACE@[15; 16) | ||
13 | L_CURLY@[16; 17) | ||
14 | R_CURLY@[17; 18) | ||
15 | WHITESPACE@[18; 19) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0009_unsafe_auto_trait.rs b/crates/libsyntax2/tests/data/parser/inline/0009_unsafe_auto_trait.rs new file mode 100644 index 000000000..03d29f324 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0009_unsafe_auto_trait.rs | |||
@@ -0,0 +1 @@ | |||
unsafe auto trait T {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0009_unsafe_auto_trait.txt b/crates/libsyntax2/tests/data/parser/inline/0009_unsafe_auto_trait.txt new file mode 100644 index 000000000..825a56f17 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0009_unsafe_auto_trait.txt | |||
@@ -0,0 +1,14 @@ | |||
1 | FILE@[0; 23) | ||
2 | TRAIT_ITEM@[0; 22) | ||
3 | UNSAFE_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | AUTO_KW@[7; 11) | ||
6 | WHITESPACE@[11; 12) | ||
7 | TRAIT_KW@[12; 17) | ||
8 | WHITESPACE@[17; 18) | ||
9 | NAME@[18; 19) | ||
10 | IDENT@[18; 19) "T" | ||
11 | WHITESPACE@[19; 20) | ||
12 | L_CURLY@[20; 21) | ||
13 | R_CURLY@[21; 22) | ||
14 | WHITESPACE@[22; 23) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0010_unsafe_default_impl.rs b/crates/libsyntax2/tests/data/parser/inline/0010_unsafe_default_impl.rs new file mode 100644 index 000000000..9cd6c57bd --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0010_unsafe_default_impl.rs | |||
@@ -0,0 +1 @@ | |||
unsafe default impl Foo {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0010_unsafe_default_impl.txt b/crates/libsyntax2/tests/data/parser/inline/0010_unsafe_default_impl.txt new file mode 100644 index 000000000..ab12d5fc0 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0010_unsafe_default_impl.txt | |||
@@ -0,0 +1,17 @@ | |||
1 | FILE@[0; 27) | ||
2 | IMPL_ITEM@[0; 26) | ||
3 | UNSAFE_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | DEFAULT_KW@[7; 14) | ||
6 | WHITESPACE@[14; 15) | ||
7 | IMPL_KW@[15; 19) | ||
8 | WHITESPACE@[19; 20) | ||
9 | PATH_TYPE@[20; 23) | ||
10 | PATH@[20; 23) | ||
11 | PATH_SEGMENT@[20; 23) | ||
12 | NAME_REF@[20; 23) | ||
13 | IDENT@[20; 23) "Foo" | ||
14 | WHITESPACE@[23; 24) | ||
15 | L_CURLY@[24; 25) | ||
16 | R_CURLY@[25; 26) | ||
17 | WHITESPACE@[26; 27) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0011_unsafe_fn.rs b/crates/libsyntax2/tests/data/parser/inline/0011_unsafe_fn.rs new file mode 100644 index 000000000..33cfc4cd7 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0011_unsafe_fn.rs | |||
@@ -0,0 +1 @@ | |||
unsafe fn foo() {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0011_unsafe_fn.txt b/crates/libsyntax2/tests/data/parser/inline/0011_unsafe_fn.txt new file mode 100644 index 000000000..9e5dcafa6 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0011_unsafe_fn.txt | |||
@@ -0,0 +1,16 @@ | |||
1 | FILE@[0; 19) | ||
2 | FUNCTION@[0; 18) | ||
3 | UNSAFE_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | FN_KW@[7; 9) | ||
6 | WHITESPACE@[9; 10) | ||
7 | NAME@[10; 13) | ||
8 | IDENT@[10; 13) "foo" | ||
9 | PARAM_LIST@[13; 15) | ||
10 | L_PAREN@[13; 14) | ||
11 | R_PAREN@[14; 15) | ||
12 | WHITESPACE@[15; 16) | ||
13 | BLOCK_EXPR@[16; 18) | ||
14 | L_CURLY@[16; 17) | ||
15 | R_CURLY@[17; 18) | ||
16 | WHITESPACE@[18; 19) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0012_unsafe_extern_fn.rs b/crates/libsyntax2/tests/data/parser/inline/0012_unsafe_extern_fn.rs new file mode 100644 index 000000000..1295c2cd2 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0012_unsafe_extern_fn.rs | |||
@@ -0,0 +1 @@ | |||
unsafe extern "C" fn foo() {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0012_unsafe_extern_fn.txt b/crates/libsyntax2/tests/data/parser/inline/0012_unsafe_extern_fn.txt new file mode 100644 index 000000000..7ed4d42c1 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0012_unsafe_extern_fn.txt | |||
@@ -0,0 +1,21 @@ | |||
1 | FILE@[0; 30) | ||
2 | FUNCTION@[0; 29) | ||
3 | UNSAFE_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | ABI@[7; 17) | ||
6 | EXTERN_KW@[7; 13) | ||
7 | WHITESPACE@[13; 14) | ||
8 | STRING@[14; 17) | ||
9 | WHITESPACE@[17; 18) | ||
10 | FN_KW@[18; 20) | ||
11 | WHITESPACE@[20; 21) | ||
12 | NAME@[21; 24) | ||
13 | IDENT@[21; 24) "foo" | ||
14 | PARAM_LIST@[24; 26) | ||
15 | L_PAREN@[24; 25) | ||
16 | R_PAREN@[25; 26) | ||
17 | WHITESPACE@[26; 27) | ||
18 | BLOCK_EXPR@[27; 29) | ||
19 | L_CURLY@[27; 28) | ||
20 | R_CURLY@[28; 29) | ||
21 | WHITESPACE@[29; 30) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0013_unsafe_block_in_mod.rs b/crates/libsyntax2/tests/data/parser/inline/0013_unsafe_block_in_mod.rs new file mode 100644 index 000000000..26141e904 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0013_unsafe_block_in_mod.rs | |||
@@ -0,0 +1 @@ | |||
fn foo(){} unsafe { } fn bar(){} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0013_unsafe_block_in_mod.txt b/crates/libsyntax2/tests/data/parser/inline/0013_unsafe_block_in_mod.txt new file mode 100644 index 000000000..d1bcffe77 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0013_unsafe_block_in_mod.txt | |||
@@ -0,0 +1,35 @@ | |||
1 | FILE@[0; 33) | ||
2 | FUNCTION@[0; 10) | ||
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 | BLOCK_EXPR@[8; 10) | ||
11 | L_CURLY@[8; 9) | ||
12 | R_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 11) | ||
14 | err: `expected an item` | ||
15 | ERROR@[11; 17) | ||
16 | UNSAFE_KW@[11; 17) | ||
17 | WHITESPACE@[17; 18) | ||
18 | err: `expected an item` | ||
19 | ERROR@[18; 21) | ||
20 | L_CURLY@[18; 19) | ||
21 | WHITESPACE@[19; 20) | ||
22 | R_CURLY@[20; 21) | ||
23 | WHITESPACE@[21; 22) | ||
24 | FUNCTION@[22; 32) | ||
25 | FN_KW@[22; 24) | ||
26 | WHITESPACE@[24; 25) | ||
27 | NAME@[25; 28) | ||
28 | IDENT@[25; 28) "bar" | ||
29 | PARAM_LIST@[28; 30) | ||
30 | L_PAREN@[28; 29) | ||
31 | R_PAREN@[29; 30) | ||
32 | BLOCK_EXPR@[30; 32) | ||
33 | L_CURLY@[30; 31) | ||
34 | R_CURLY@[31; 32) | ||
35 | WHITESPACE@[32; 33) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0014_type_item_type_params.rs b/crates/libsyntax2/tests/data/parser/inline/0014_type_item_type_params.rs new file mode 100644 index 000000000..defd110c4 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0014_type_item_type_params.rs | |||
@@ -0,0 +1 @@ | |||
type Result<T> = (); | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0014_type_item_type_params.txt b/crates/libsyntax2/tests/data/parser/inline/0014_type_item_type_params.txt new file mode 100644 index 000000000..e39e57889 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0014_type_item_type_params.txt | |||
@@ -0,0 +1,20 @@ | |||
1 | FILE@[0; 21) | ||
2 | TYPE_ITEM@[0; 20) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 11) | ||
6 | IDENT@[5; 11) "Result" | ||
7 | TYPE_PARAM_LIST@[11; 14) | ||
8 | L_ANGLE@[11; 12) | ||
9 | TYPE_PARAM@[12; 13) | ||
10 | NAME@[12; 13) | ||
11 | IDENT@[12; 13) "T" | ||
12 | R_ANGLE@[13; 14) | ||
13 | WHITESPACE@[14; 15) | ||
14 | EQ@[15; 16) | ||
15 | WHITESPACE@[16; 17) | ||
16 | TUPLE_TYPE@[17; 19) | ||
17 | L_PAREN@[17; 18) | ||
18 | R_PAREN@[18; 19) | ||
19 | SEMI@[19; 20) | ||
20 | WHITESPACE@[20; 21) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0015_type_item.rs b/crates/libsyntax2/tests/data/parser/inline/0015_type_item.rs new file mode 100644 index 000000000..04c0344fa --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0015_type_item.rs | |||
@@ -0,0 +1 @@ | |||
type Foo = Bar; | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0015_type_item.txt b/crates/libsyntax2/tests/data/parser/inline/0015_type_item.txt new file mode 100644 index 000000000..964071aa1 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0015_type_item.txt | |||
@@ -0,0 +1,16 @@ | |||
1 | FILE@[0; 16) | ||
2 | TYPE_ITEM@[0; 15) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 8) | ||
6 | IDENT@[5; 8) "Foo" | ||
7 | WHITESPACE@[8; 9) | ||
8 | EQ@[9; 10) | ||
9 | WHITESPACE@[10; 11) | ||
10 | PATH_TYPE@[11; 14) | ||
11 | PATH@[11; 14) | ||
12 | PATH_SEGMENT@[11; 14) | ||
13 | NAME_REF@[11; 14) | ||
14 | IDENT@[11; 14) "Bar" | ||
15 | SEMI@[14; 15) | ||
16 | WHITESPACE@[15; 16) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0016_type_item_where_clause.rs b/crates/libsyntax2/tests/data/parser/inline/0016_type_item_where_clause.rs new file mode 100644 index 000000000..a602d07f0 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0016_type_item_where_clause.rs | |||
@@ -0,0 +1 @@ | |||
type Foo where Foo: Copy = (); | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0016_type_item_where_clause.txt b/crates/libsyntax2/tests/data/parser/inline/0016_type_item_where_clause.txt new file mode 100644 index 000000000..2f3c52960 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0016_type_item_where_clause.txt | |||
@@ -0,0 +1,31 @@ | |||
1 | FILE@[0; 31) | ||
2 | TYPE_ITEM@[0; 30) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 8) | ||
6 | IDENT@[5; 8) "Foo" | ||
7 | WHITESPACE@[8; 9) | ||
8 | WHERE_CLAUSE@[9; 24) | ||
9 | WHERE_KW@[9; 14) | ||
10 | WHITESPACE@[14; 15) | ||
11 | WHERE_PRED@[15; 24) | ||
12 | PATH_TYPE@[15; 18) | ||
13 | PATH@[15; 18) | ||
14 | PATH_SEGMENT@[15; 18) | ||
15 | NAME_REF@[15; 18) | ||
16 | IDENT@[15; 18) "Foo" | ||
17 | COLON@[18; 19) | ||
18 | WHITESPACE@[19; 20) | ||
19 | PATH@[20; 24) | ||
20 | PATH_SEGMENT@[20; 24) | ||
21 | NAME_REF@[20; 24) | ||
22 | IDENT@[20; 24) "Copy" | ||
23 | err: `expected COMMA` | ||
24 | WHITESPACE@[24; 25) | ||
25 | EQ@[25; 26) | ||
26 | WHITESPACE@[26; 27) | ||
27 | TUPLE_TYPE@[27; 29) | ||
28 | L_PAREN@[27; 28) | ||
29 | R_PAREN@[28; 29) | ||
30 | SEMI@[29; 30) | ||
31 | WHITESPACE@[30; 31) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0017_paren_type.rs b/crates/libsyntax2/tests/data/parser/inline/0017_paren_type.rs new file mode 100644 index 000000000..6e1b25101 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0017_paren_type.rs | |||
@@ -0,0 +1 @@ | |||
type T = (i32); | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0017_paren_type.txt b/crates/libsyntax2/tests/data/parser/inline/0017_paren_type.txt new file mode 100644 index 000000000..1194fb02c --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0017_paren_type.txt | |||
@@ -0,0 +1,19 @@ | |||
1 | FILE@[0; 16) | ||
2 | TYPE_ITEM@[0; 15) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "T" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | PAREN_TYPE@[9; 14) | ||
11 | L_PAREN@[9; 10) | ||
12 | PATH_TYPE@[10; 13) | ||
13 | PATH@[10; 13) | ||
14 | PATH_SEGMENT@[10; 13) | ||
15 | NAME_REF@[10; 13) | ||
16 | IDENT@[10; 13) "i32" | ||
17 | R_PAREN@[13; 14) | ||
18 | SEMI@[14; 15) | ||
19 | WHITESPACE@[15; 16) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0018_unit_type.rs b/crates/libsyntax2/tests/data/parser/inline/0018_unit_type.rs new file mode 100644 index 000000000..c039cf7d3 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0018_unit_type.rs | |||
@@ -0,0 +1 @@ | |||
type T = (); | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0018_unit_type.txt b/crates/libsyntax2/tests/data/parser/inline/0018_unit_type.txt new file mode 100644 index 000000000..e52af7b1e --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0018_unit_type.txt | |||
@@ -0,0 +1,14 @@ | |||
1 | FILE@[0; 13) | ||
2 | TYPE_ITEM@[0; 12) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "T" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | TUPLE_TYPE@[9; 11) | ||
11 | L_PAREN@[9; 10) | ||
12 | R_PAREN@[10; 11) | ||
13 | SEMI@[11; 12) | ||
14 | WHITESPACE@[12; 13) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0019_singleton_tuple_type.rs b/crates/libsyntax2/tests/data/parser/inline/0019_singleton_tuple_type.rs new file mode 100644 index 000000000..cb66bad24 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0019_singleton_tuple_type.rs | |||
@@ -0,0 +1 @@ | |||
type T = (i32,); | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0019_singleton_tuple_type.txt b/crates/libsyntax2/tests/data/parser/inline/0019_singleton_tuple_type.txt new file mode 100644 index 000000000..7b8e06c25 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0019_singleton_tuple_type.txt | |||
@@ -0,0 +1,20 @@ | |||
1 | FILE@[0; 17) | ||
2 | TYPE_ITEM@[0; 16) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "T" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | TUPLE_TYPE@[9; 15) | ||
11 | L_PAREN@[9; 10) | ||
12 | PATH_TYPE@[10; 13) | ||
13 | PATH@[10; 13) | ||
14 | PATH_SEGMENT@[10; 13) | ||
15 | NAME_REF@[10; 13) | ||
16 | IDENT@[10; 13) "i32" | ||
17 | COMMA@[13; 14) | ||
18 | R_PAREN@[14; 15) | ||
19 | SEMI@[15; 16) | ||
20 | WHITESPACE@[16; 17) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0020_never_type.rs b/crates/libsyntax2/tests/data/parser/inline/0020_never_type.rs new file mode 100644 index 000000000..de399fcf4 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0020_never_type.rs | |||
@@ -0,0 +1 @@ | |||
type Never = !; | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0020_never_type.txt b/crates/libsyntax2/tests/data/parser/inline/0020_never_type.txt new file mode 100644 index 000000000..89f8a9eea --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0020_never_type.txt | |||
@@ -0,0 +1,13 @@ | |||
1 | FILE@[0; 16) | ||
2 | TYPE_ITEM@[0; 15) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 10) | ||
6 | IDENT@[5; 10) "Never" | ||
7 | WHITESPACE@[10; 11) | ||
8 | EQ@[11; 12) | ||
9 | WHITESPACE@[12; 13) | ||
10 | NEVER_TYPE@[13; 14) | ||
11 | EXCL@[13; 14) | ||
12 | SEMI@[14; 15) | ||
13 | WHITESPACE@[15; 16) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0021_pointer_type_no_mutability.rs b/crates/libsyntax2/tests/data/parser/inline/0021_pointer_type_no_mutability.rs new file mode 100644 index 000000000..fae705131 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0021_pointer_type_no_mutability.rs | |||
@@ -0,0 +1 @@ | |||
type T = *(); | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0021_pointer_type_no_mutability.txt b/crates/libsyntax2/tests/data/parser/inline/0021_pointer_type_no_mutability.txt new file mode 100644 index 000000000..d86fc6388 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0021_pointer_type_no_mutability.txt | |||
@@ -0,0 +1,17 @@ | |||
1 | FILE@[0; 14) | ||
2 | TYPE_ITEM@[0; 13) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "T" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | POINTER_TYPE@[9; 12) | ||
11 | STAR@[9; 10) | ||
12 | err: `expected mut or const in raw pointer type (use `*mut T` or `*const T` as appropriate)` | ||
13 | TUPLE_TYPE@[10; 12) | ||
14 | L_PAREN@[10; 11) | ||
15 | R_PAREN@[11; 12) | ||
16 | SEMI@[12; 13) | ||
17 | WHITESPACE@[13; 14) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0022_pointer_type_mut.rs b/crates/libsyntax2/tests/data/parser/inline/0022_pointer_type_mut.rs new file mode 100644 index 000000000..04b2bb9ba --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0022_pointer_type_mut.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | type M = *mut (); | ||
2 | type C = *mut (); | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0022_pointer_type_mut.txt b/crates/libsyntax2/tests/data/parser/inline/0022_pointer_type_mut.txt new file mode 100644 index 000000000..fbeba506e --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0022_pointer_type_mut.txt | |||
@@ -0,0 +1,35 @@ | |||
1 | FILE@[0; 36) | ||
2 | TYPE_ITEM@[0; 17) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "M" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | POINTER_TYPE@[9; 16) | ||
11 | STAR@[9; 10) | ||
12 | MUT_KW@[10; 13) | ||
13 | WHITESPACE@[13; 14) | ||
14 | TUPLE_TYPE@[14; 16) | ||
15 | L_PAREN@[14; 15) | ||
16 | R_PAREN@[15; 16) | ||
17 | SEMI@[16; 17) | ||
18 | WHITESPACE@[17; 18) | ||
19 | TYPE_ITEM@[18; 35) | ||
20 | TYPE_KW@[18; 22) | ||
21 | WHITESPACE@[22; 23) | ||
22 | NAME@[23; 24) | ||
23 | IDENT@[23; 24) "C" | ||
24 | WHITESPACE@[24; 25) | ||
25 | EQ@[25; 26) | ||
26 | WHITESPACE@[26; 27) | ||
27 | POINTER_TYPE@[27; 34) | ||
28 | STAR@[27; 28) | ||
29 | MUT_KW@[28; 31) | ||
30 | WHITESPACE@[31; 32) | ||
31 | TUPLE_TYPE@[32; 34) | ||
32 | L_PAREN@[32; 33) | ||
33 | R_PAREN@[33; 34) | ||
34 | SEMI@[34; 35) | ||
35 | WHITESPACE@[35; 36) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0023_array_type_missing_semi.rs b/crates/libsyntax2/tests/data/parser/inline/0023_array_type_missing_semi.rs new file mode 100644 index 000000000..a94851443 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0023_array_type_missing_semi.rs | |||
@@ -0,0 +1 @@ | |||
type T = [() 92]; | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0023_array_type_missing_semi.txt b/crates/libsyntax2/tests/data/parser/inline/0023_array_type_missing_semi.txt new file mode 100644 index 000000000..4d90d52c7 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0023_array_type_missing_semi.txt | |||
@@ -0,0 +1,27 @@ | |||
1 | FILE@[0; 18) | ||
2 | TYPE_ITEM@[0; 12) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "T" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | SLICE_TYPE@[9; 12) | ||
11 | L_BRACK@[9; 10) | ||
12 | TUPLE_TYPE@[10; 12) | ||
13 | L_PAREN@[10; 11) | ||
14 | R_PAREN@[11; 12) | ||
15 | err: `expected `;` or `]`` | ||
16 | err: `expected SEMI` | ||
17 | WHITESPACE@[12; 13) | ||
18 | err: `expected an item` | ||
19 | ERROR@[13; 15) | ||
20 | INT_NUMBER@[13; 15) "92" | ||
21 | err: `expected an item` | ||
22 | ERROR@[15; 16) | ||
23 | R_BRACK@[15; 16) | ||
24 | err: `expected an item` | ||
25 | ERROR@[16; 17) | ||
26 | SEMI@[16; 17) | ||
27 | WHITESPACE@[17; 18) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0024_array_type.rs b/crates/libsyntax2/tests/data/parser/inline/0024_array_type.rs new file mode 100644 index 000000000..27eb22f22 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0024_array_type.rs | |||
@@ -0,0 +1 @@ | |||
type T = [(); 92]; | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0024_array_type.txt b/crates/libsyntax2/tests/data/parser/inline/0024_array_type.txt new file mode 100644 index 000000000..5a6b76904 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0024_array_type.txt | |||
@@ -0,0 +1,21 @@ | |||
1 | FILE@[0; 19) | ||
2 | TYPE_ITEM@[0; 18) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "T" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | ARRAY_TYPE@[9; 17) | ||
11 | L_BRACK@[9; 10) | ||
12 | TUPLE_TYPE@[10; 12) | ||
13 | L_PAREN@[10; 11) | ||
14 | R_PAREN@[11; 12) | ||
15 | SEMI@[12; 13) | ||
16 | WHITESPACE@[13; 14) | ||
17 | LITERAL@[14; 16) | ||
18 | INT_NUMBER@[14; 16) "92" | ||
19 | R_BRACK@[16; 17) | ||
20 | SEMI@[17; 18) | ||
21 | WHITESPACE@[18; 19) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0025_slice_type.rs b/crates/libsyntax2/tests/data/parser/inline/0025_slice_type.rs new file mode 100644 index 000000000..4da1af827 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0025_slice_type.rs | |||
@@ -0,0 +1 @@ | |||
type T = [()]; | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0025_slice_type.txt b/crates/libsyntax2/tests/data/parser/inline/0025_slice_type.txt new file mode 100644 index 000000000..52508cda4 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0025_slice_type.txt | |||
@@ -0,0 +1,17 @@ | |||
1 | FILE@[0; 15) | ||
2 | TYPE_ITEM@[0; 14) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "T" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | SLICE_TYPE@[9; 13) | ||
11 | L_BRACK@[9; 10) | ||
12 | TUPLE_TYPE@[10; 12) | ||
13 | L_PAREN@[10; 11) | ||
14 | R_PAREN@[11; 12) | ||
15 | R_BRACK@[12; 13) | ||
16 | SEMI@[13; 14) | ||
17 | WHITESPACE@[14; 15) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0026_reference_type;.rs b/crates/libsyntax2/tests/data/parser/inline/0026_reference_type;.rs new file mode 100644 index 000000000..3ac0badab --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0026_reference_type;.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | type A = &(); | ||
2 | type B = &'static (); | ||
3 | type C = &mut (); | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0026_reference_type;.txt b/crates/libsyntax2/tests/data/parser/inline/0026_reference_type;.txt new file mode 100644 index 000000000..b6bd6a48c --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0026_reference_type;.txt | |||
@@ -0,0 +1,50 @@ | |||
1 | FILE@[0; 54) | ||
2 | TYPE_ITEM@[0; 13) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "A" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | REFERENCE_TYPE@[9; 12) | ||
11 | AMP@[9; 10) | ||
12 | TUPLE_TYPE@[10; 12) | ||
13 | L_PAREN@[10; 11) | ||
14 | R_PAREN@[11; 12) | ||
15 | SEMI@[12; 13) | ||
16 | WHITESPACE@[13; 14) | ||
17 | TYPE_ITEM@[14; 35) | ||
18 | TYPE_KW@[14; 18) | ||
19 | WHITESPACE@[18; 19) | ||
20 | NAME@[19; 20) | ||
21 | IDENT@[19; 20) "B" | ||
22 | WHITESPACE@[20; 21) | ||
23 | EQ@[21; 22) | ||
24 | WHITESPACE@[22; 23) | ||
25 | REFERENCE_TYPE@[23; 34) | ||
26 | AMP@[23; 24) | ||
27 | LIFETIME@[24; 31) "'static" | ||
28 | WHITESPACE@[31; 32) | ||
29 | TUPLE_TYPE@[32; 34) | ||
30 | L_PAREN@[32; 33) | ||
31 | R_PAREN@[33; 34) | ||
32 | SEMI@[34; 35) | ||
33 | WHITESPACE@[35; 36) | ||
34 | TYPE_ITEM@[36; 53) | ||
35 | TYPE_KW@[36; 40) | ||
36 | WHITESPACE@[40; 41) | ||
37 | NAME@[41; 42) | ||
38 | IDENT@[41; 42) "C" | ||
39 | WHITESPACE@[42; 43) | ||
40 | EQ@[43; 44) | ||
41 | WHITESPACE@[44; 45) | ||
42 | REFERENCE_TYPE@[45; 52) | ||
43 | AMP@[45; 46) | ||
44 | MUT_KW@[46; 49) | ||
45 | WHITESPACE@[49; 50) | ||
46 | TUPLE_TYPE@[50; 52) | ||
47 | L_PAREN@[50; 51) | ||
48 | R_PAREN@[51; 52) | ||
49 | SEMI@[52; 53) | ||
50 | WHITESPACE@[53; 54) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0027_placeholder_type.rs b/crates/libsyntax2/tests/data/parser/inline/0027_placeholder_type.rs new file mode 100644 index 000000000..7952dbd57 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0027_placeholder_type.rs | |||
@@ -0,0 +1 @@ | |||
type Placeholder = _; | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0027_placeholder_type.txt b/crates/libsyntax2/tests/data/parser/inline/0027_placeholder_type.txt new file mode 100644 index 000000000..5e6e6c397 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0027_placeholder_type.txt | |||
@@ -0,0 +1,13 @@ | |||
1 | FILE@[0; 22) | ||
2 | TYPE_ITEM@[0; 21) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 16) | ||
6 | IDENT@[5; 16) "Placeholder" | ||
7 | WHITESPACE@[16; 17) | ||
8 | EQ@[17; 18) | ||
9 | WHITESPACE@[18; 19) | ||
10 | PLACEHOLDER_TYPE@[19; 20) | ||
11 | UNDERSCORE@[19; 20) | ||
12 | SEMI@[20; 21) | ||
13 | WHITESPACE@[21; 22) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0028_fn_pointer_type.rs b/crates/libsyntax2/tests/data/parser/inline/0028_fn_pointer_type.rs new file mode 100644 index 000000000..c9bf3bdb4 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0028_fn_pointer_type.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | type A = fn(); | ||
2 | type B = unsafe fn(); | ||
3 | type C = unsafe extern "C" fn(); | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0028_fn_pointer_type.txt b/crates/libsyntax2/tests/data/parser/inline/0028_fn_pointer_type.txt new file mode 100644 index 000000000..31818365a --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0028_fn_pointer_type.txt | |||
@@ -0,0 +1,55 @@ | |||
1 | FILE@[0; 70) | ||
2 | TYPE_ITEM@[0; 14) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "A" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | FN_POINTER_TYPE@[9; 13) | ||
11 | FN_KW@[9; 11) | ||
12 | PARAM_LIST@[11; 13) | ||
13 | L_PAREN@[11; 12) | ||
14 | R_PAREN@[12; 13) | ||
15 | SEMI@[13; 14) | ||
16 | WHITESPACE@[14; 15) | ||
17 | TYPE_ITEM@[15; 36) | ||
18 | TYPE_KW@[15; 19) | ||
19 | WHITESPACE@[19; 20) | ||
20 | NAME@[20; 21) | ||
21 | IDENT@[20; 21) "B" | ||
22 | WHITESPACE@[21; 22) | ||
23 | EQ@[22; 23) | ||
24 | WHITESPACE@[23; 24) | ||
25 | FN_POINTER_TYPE@[24; 35) | ||
26 | UNSAFE_KW@[24; 30) | ||
27 | WHITESPACE@[30; 31) | ||
28 | FN_KW@[31; 33) | ||
29 | PARAM_LIST@[33; 35) | ||
30 | L_PAREN@[33; 34) | ||
31 | R_PAREN@[34; 35) | ||
32 | SEMI@[35; 36) | ||
33 | WHITESPACE@[36; 37) | ||
34 | TYPE_ITEM@[37; 69) | ||
35 | TYPE_KW@[37; 41) | ||
36 | WHITESPACE@[41; 42) | ||
37 | NAME@[42; 43) | ||
38 | IDENT@[42; 43) "C" | ||
39 | WHITESPACE@[43; 44) | ||
40 | EQ@[44; 45) | ||
41 | WHITESPACE@[45; 46) | ||
42 | FN_POINTER_TYPE@[46; 68) | ||
43 | UNSAFE_KW@[46; 52) | ||
44 | WHITESPACE@[52; 53) | ||
45 | ABI@[53; 63) | ||
46 | EXTERN_KW@[53; 59) | ||
47 | WHITESPACE@[59; 60) | ||
48 | STRING@[60; 63) | ||
49 | WHITESPACE@[63; 64) | ||
50 | FN_KW@[64; 66) | ||
51 | PARAM_LIST@[66; 68) | ||
52 | L_PAREN@[66; 67) | ||
53 | R_PAREN@[67; 68) | ||
54 | SEMI@[68; 69) | ||
55 | WHITESPACE@[69; 70) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0029_fn_pointer_type_missing_fn.rs b/crates/libsyntax2/tests/data/parser/inline/0029_fn_pointer_type_missing_fn.rs new file mode 100644 index 000000000..f014914ff --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0029_fn_pointer_type_missing_fn.rs | |||
@@ -0,0 +1 @@ | |||
type F = unsafe (); | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0029_fn_pointer_type_missing_fn.txt b/crates/libsyntax2/tests/data/parser/inline/0029_fn_pointer_type_missing_fn.txt new file mode 100644 index 000000000..ddec1b866 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0029_fn_pointer_type_missing_fn.txt | |||
@@ -0,0 +1,23 @@ | |||
1 | FILE@[0; 20) | ||
2 | TYPE_ITEM@[0; 15) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "F" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | UNSAFE_KW@[9; 15) | ||
11 | err: `expected `fn`` | ||
12 | err: `expected SEMI` | ||
13 | WHITESPACE@[15; 16) | ||
14 | err: `expected an item` | ||
15 | ERROR@[16; 17) | ||
16 | L_PAREN@[16; 17) | ||
17 | err: `expected an item` | ||
18 | ERROR@[17; 18) | ||
19 | R_PAREN@[17; 18) | ||
20 | err: `expected an item` | ||
21 | ERROR@[18; 19) | ||
22 | SEMI@[18; 19) | ||
23 | WHITESPACE@[19; 20) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0030_fn_pointer_type_with_ret.rs b/crates/libsyntax2/tests/data/parser/inline/0030_fn_pointer_type_with_ret.rs new file mode 100644 index 000000000..e3ba5e87f --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0030_fn_pointer_type_with_ret.rs | |||
@@ -0,0 +1 @@ | |||
type F = fn() -> (); | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0030_fn_pointer_type_with_ret.txt b/crates/libsyntax2/tests/data/parser/inline/0030_fn_pointer_type_with_ret.txt new file mode 100644 index 000000000..447b1ed3f --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0030_fn_pointer_type_with_ret.txt | |||
@@ -0,0 +1,22 @@ | |||
1 | FILE@[0; 21) | ||
2 | TYPE_ITEM@[0; 20) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "F" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | FN_POINTER_TYPE@[9; 19) | ||
11 | FN_KW@[9; 11) | ||
12 | PARAM_LIST@[11; 13) | ||
13 | L_PAREN@[11; 12) | ||
14 | R_PAREN@[12; 13) | ||
15 | WHITESPACE@[13; 14) | ||
16 | THIN_ARROW@[14; 16) | ||
17 | WHITESPACE@[16; 17) | ||
18 | TUPLE_TYPE@[17; 19) | ||
19 | L_PAREN@[17; 18) | ||
20 | R_PAREN@[18; 19) | ||
21 | SEMI@[19; 20) | ||
22 | WHITESPACE@[20; 21) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0031_for_type.rs b/crates/libsyntax2/tests/data/parser/inline/0031_for_type.rs new file mode 100644 index 000000000..4d6a18c6b --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0031_for_type.rs | |||
@@ -0,0 +1 @@ | |||
type A = for<'a> fn() -> (); | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0031_for_type.txt b/crates/libsyntax2/tests/data/parser/inline/0031_for_type.txt new file mode 100644 index 000000000..65753a702 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0031_for_type.txt | |||
@@ -0,0 +1,30 @@ | |||
1 | FILE@[0; 29) | ||
2 | TYPE_ITEM@[0; 28) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "A" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | FOR_TYPE@[9; 27) | ||
11 | FOR_KW@[9; 12) | ||
12 | TYPE_PARAM_LIST@[12; 16) | ||
13 | L_ANGLE@[12; 13) | ||
14 | LIFETIME_PARAM@[13; 15) | ||
15 | LIFETIME@[13; 15) "'a" | ||
16 | R_ANGLE@[15; 16) | ||
17 | WHITESPACE@[16; 17) | ||
18 | FN_POINTER_TYPE@[17; 27) | ||
19 | FN_KW@[17; 19) | ||
20 | PARAM_LIST@[19; 21) | ||
21 | L_PAREN@[19; 20) | ||
22 | R_PAREN@[20; 21) | ||
23 | WHITESPACE@[21; 22) | ||
24 | THIN_ARROW@[22; 24) | ||
25 | WHITESPACE@[24; 25) | ||
26 | TUPLE_TYPE@[25; 27) | ||
27 | L_PAREN@[25; 26) | ||
28 | R_PAREN@[26; 27) | ||
29 | SEMI@[27; 28) | ||
30 | WHITESPACE@[28; 29) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0032_path_type.rs b/crates/libsyntax2/tests/data/parser/inline/0032_path_type.rs new file mode 100644 index 000000000..bf94f32e1 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0032_path_type.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | type A = Foo; | ||
2 | type B = ::Foo; | ||
3 | type C = self::Foo; | ||
4 | type D = super::Foo; | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0032_path_type.txt b/crates/libsyntax2/tests/data/parser/inline/0032_path_type.txt new file mode 100644 index 000000000..d9085118a --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0032_path_type.txt | |||
@@ -0,0 +1,70 @@ | |||
1 | FILE@[0; 71) | ||
2 | TYPE_ITEM@[0; 13) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "A" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | PATH_TYPE@[9; 12) | ||
11 | PATH@[9; 12) | ||
12 | PATH_SEGMENT@[9; 12) | ||
13 | NAME_REF@[9; 12) | ||
14 | IDENT@[9; 12) "Foo" | ||
15 | SEMI@[12; 13) | ||
16 | WHITESPACE@[13; 14) | ||
17 | TYPE_ITEM@[14; 29) | ||
18 | TYPE_KW@[14; 18) | ||
19 | WHITESPACE@[18; 19) | ||
20 | NAME@[19; 20) | ||
21 | IDENT@[19; 20) "B" | ||
22 | WHITESPACE@[20; 21) | ||
23 | EQ@[21; 22) | ||
24 | WHITESPACE@[22; 23) | ||
25 | PATH_TYPE@[23; 28) | ||
26 | PATH@[23; 28) | ||
27 | PATH_SEGMENT@[23; 28) | ||
28 | COLONCOLON@[23; 25) | ||
29 | NAME_REF@[25; 28) | ||
30 | IDENT@[25; 28) "Foo" | ||
31 | SEMI@[28; 29) | ||
32 | WHITESPACE@[29; 30) | ||
33 | TYPE_ITEM@[30; 49) | ||
34 | TYPE_KW@[30; 34) | ||
35 | WHITESPACE@[34; 35) | ||
36 | NAME@[35; 36) | ||
37 | IDENT@[35; 36) "C" | ||
38 | WHITESPACE@[36; 37) | ||
39 | EQ@[37; 38) | ||
40 | WHITESPACE@[38; 39) | ||
41 | PATH_TYPE@[39; 48) | ||
42 | PATH@[39; 48) | ||
43 | PATH@[39; 43) | ||
44 | PATH_SEGMENT@[39; 43) | ||
45 | SELF_KW@[39; 43) | ||
46 | COLONCOLON@[43; 45) | ||
47 | PATH_SEGMENT@[45; 48) | ||
48 | NAME_REF@[45; 48) | ||
49 | IDENT@[45; 48) "Foo" | ||
50 | SEMI@[48; 49) | ||
51 | WHITESPACE@[49; 50) | ||
52 | TYPE_ITEM@[50; 70) | ||
53 | TYPE_KW@[50; 54) | ||
54 | WHITESPACE@[54; 55) | ||
55 | NAME@[55; 56) | ||
56 | IDENT@[55; 56) "D" | ||
57 | WHITESPACE@[56; 57) | ||
58 | EQ@[57; 58) | ||
59 | WHITESPACE@[58; 59) | ||
60 | PATH_TYPE@[59; 69) | ||
61 | PATH@[59; 69) | ||
62 | PATH@[59; 64) | ||
63 | PATH_SEGMENT@[59; 64) | ||
64 | SUPER_KW@[59; 64) | ||
65 | COLONCOLON@[64; 66) | ||
66 | PATH_SEGMENT@[66; 69) | ||
67 | NAME_REF@[66; 69) | ||
68 | IDENT@[66; 69) "Foo" | ||
69 | SEMI@[69; 70) | ||
70 | WHITESPACE@[70; 71) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0034_bind_pat.rs b/crates/libsyntax2/tests/data/parser/inline/0034_bind_pat.rs new file mode 100644 index 000000000..820a9e72c --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0034_bind_pat.rs | |||
@@ -0,0 +1,8 @@ | |||
1 | fn main() { | ||
2 | let a = (); | ||
3 | let mut b = (); | ||
4 | let ref c = (); | ||
5 | let ref mut d = (); | ||
6 | let e @ _ = (); | ||
7 | let ref mut f @ g @ _ = (); | ||
8 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0034_bind_pat.txt b/crates/libsyntax2/tests/data/parser/inline/0034_bind_pat.txt new file mode 100644 index 000000000..e8e4e4c2b --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0034_bind_pat.txt | |||
@@ -0,0 +1,127 @@ | |||
1 | FILE@[0; 146) | ||
2 | FUNCTION@[0; 145) | ||
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; 145) | ||
12 | L_CURLY@[10; 11) | ||
13 | WHITESPACE@[11; 16) | ||
14 | LET_STMT@[16; 27) | ||
15 | LET_KW@[16; 19) | ||
16 | WHITESPACE@[19; 20) | ||
17 | BIND_PAT@[20; 21) | ||
18 | NAME@[20; 21) | ||
19 | IDENT@[20; 21) "a" | ||
20 | WHITESPACE@[21; 22) | ||
21 | EQ@[22; 23) | ||
22 | WHITESPACE@[23; 24) | ||
23 | TUPLE_EXPR@[24; 26) | ||
24 | L_PAREN@[24; 25) | ||
25 | R_PAREN@[25; 26) | ||
26 | SEMI@[26; 27) | ||
27 | WHITESPACE@[27; 32) | ||
28 | LET_STMT@[32; 47) | ||
29 | LET_KW@[32; 35) | ||
30 | WHITESPACE@[35; 36) | ||
31 | BIND_PAT@[36; 41) | ||
32 | MUT_KW@[36; 39) | ||
33 | WHITESPACE@[39; 40) | ||
34 | NAME@[40; 41) | ||
35 | IDENT@[40; 41) "b" | ||
36 | WHITESPACE@[41; 42) | ||
37 | EQ@[42; 43) | ||
38 | WHITESPACE@[43; 44) | ||
39 | TUPLE_EXPR@[44; 46) | ||
40 | L_PAREN@[44; 45) | ||
41 | R_PAREN@[45; 46) | ||
42 | SEMI@[46; 47) | ||
43 | WHITESPACE@[47; 52) | ||
44 | LET_STMT@[52; 67) | ||
45 | LET_KW@[52; 55) | ||
46 | WHITESPACE@[55; 56) | ||
47 | BIND_PAT@[56; 61) | ||
48 | REF_KW@[56; 59) | ||
49 | WHITESPACE@[59; 60) | ||
50 | NAME@[60; 61) | ||
51 | IDENT@[60; 61) "c" | ||
52 | WHITESPACE@[61; 62) | ||
53 | EQ@[62; 63) | ||
54 | WHITESPACE@[63; 64) | ||
55 | TUPLE_EXPR@[64; 66) | ||
56 | L_PAREN@[64; 65) | ||
57 | R_PAREN@[65; 66) | ||
58 | SEMI@[66; 67) | ||
59 | WHITESPACE@[67; 72) | ||
60 | LET_STMT@[72; 91) | ||
61 | LET_KW@[72; 75) | ||
62 | WHITESPACE@[75; 76) | ||
63 | BIND_PAT@[76; 85) | ||
64 | REF_KW@[76; 79) | ||
65 | WHITESPACE@[79; 80) | ||
66 | MUT_KW@[80; 83) | ||
67 | WHITESPACE@[83; 84) | ||
68 | NAME@[84; 85) | ||
69 | IDENT@[84; 85) "d" | ||
70 | WHITESPACE@[85; 86) | ||
71 | EQ@[86; 87) | ||
72 | WHITESPACE@[87; 88) | ||
73 | TUPLE_EXPR@[88; 90) | ||
74 | L_PAREN@[88; 89) | ||
75 | R_PAREN@[89; 90) | ||
76 | SEMI@[90; 91) | ||
77 | WHITESPACE@[91; 96) | ||
78 | LET_STMT@[96; 111) | ||
79 | LET_KW@[96; 99) | ||
80 | WHITESPACE@[99; 100) | ||
81 | BIND_PAT@[100; 105) | ||
82 | NAME@[100; 101) | ||
83 | IDENT@[100; 101) "e" | ||
84 | WHITESPACE@[101; 102) | ||
85 | AT@[102; 103) | ||
86 | WHITESPACE@[103; 104) | ||
87 | PLACEHOLDER_PAT@[104; 105) | ||
88 | UNDERSCORE@[104; 105) | ||
89 | WHITESPACE@[105; 106) | ||
90 | EQ@[106; 107) | ||
91 | WHITESPACE@[107; 108) | ||
92 | TUPLE_EXPR@[108; 110) | ||
93 | L_PAREN@[108; 109) | ||
94 | R_PAREN@[109; 110) | ||
95 | SEMI@[110; 111) | ||
96 | WHITESPACE@[111; 116) | ||
97 | LET_STMT@[116; 143) | ||
98 | LET_KW@[116; 119) | ||
99 | WHITESPACE@[119; 120) | ||
100 | BIND_PAT@[120; 137) | ||
101 | REF_KW@[120; 123) | ||
102 | WHITESPACE@[123; 124) | ||
103 | MUT_KW@[124; 127) | ||
104 | WHITESPACE@[127; 128) | ||
105 | NAME@[128; 129) | ||
106 | IDENT@[128; 129) "f" | ||
107 | WHITESPACE@[129; 130) | ||
108 | AT@[130; 131) | ||
109 | WHITESPACE@[131; 132) | ||
110 | BIND_PAT@[132; 137) | ||
111 | NAME@[132; 133) | ||
112 | IDENT@[132; 133) "g" | ||
113 | WHITESPACE@[133; 134) | ||
114 | AT@[134; 135) | ||
115 | WHITESPACE@[135; 136) | ||
116 | PLACEHOLDER_PAT@[136; 137) | ||
117 | UNDERSCORE@[136; 137) | ||
118 | WHITESPACE@[137; 138) | ||
119 | EQ@[138; 139) | ||
120 | WHITESPACE@[139; 140) | ||
121 | TUPLE_EXPR@[140; 142) | ||
122 | L_PAREN@[140; 141) | ||
123 | R_PAREN@[141; 142) | ||
124 | SEMI@[142; 143) | ||
125 | WHITESPACE@[143; 144) | ||
126 | R_CURLY@[144; 145) | ||
127 | WHITESPACE@[145; 146) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0035_ref_pat.rs b/crates/libsyntax2/tests/data/parser/inline/0035_ref_pat.rs new file mode 100644 index 000000000..de41f5cae --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0035_ref_pat.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn main() { | ||
2 | let &a = (); | ||
3 | let &mut b = (); | ||
4 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0035_ref_pat.txt b/crates/libsyntax2/tests/data/parser/inline/0035_ref_pat.txt new file mode 100644 index 000000000..6fbffd8b7 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0035_ref_pat.txt | |||
@@ -0,0 +1,49 @@ | |||
1 | FILE@[0; 52) | ||
2 | FUNCTION@[0; 51) | ||
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; 51) | ||
12 | L_CURLY@[10; 11) | ||
13 | WHITESPACE@[11; 16) | ||
14 | LET_STMT@[16; 28) | ||
15 | LET_KW@[16; 19) | ||
16 | WHITESPACE@[19; 20) | ||
17 | REF_PAT@[20; 22) | ||
18 | AMP@[20; 21) | ||
19 | BIND_PAT@[21; 22) | ||
20 | NAME@[21; 22) | ||
21 | IDENT@[21; 22) "a" | ||
22 | WHITESPACE@[22; 23) | ||
23 | EQ@[23; 24) | ||
24 | WHITESPACE@[24; 25) | ||
25 | TUPLE_EXPR@[25; 27) | ||
26 | L_PAREN@[25; 26) | ||
27 | R_PAREN@[26; 27) | ||
28 | SEMI@[27; 28) | ||
29 | WHITESPACE@[28; 33) | ||
30 | LET_STMT@[33; 49) | ||
31 | LET_KW@[33; 36) | ||
32 | WHITESPACE@[36; 37) | ||
33 | REF_PAT@[37; 43) | ||
34 | AMP@[37; 38) | ||
35 | MUT_KW@[38; 41) | ||
36 | WHITESPACE@[41; 42) | ||
37 | BIND_PAT@[42; 43) | ||
38 | NAME@[42; 43) | ||
39 | IDENT@[42; 43) "b" | ||
40 | WHITESPACE@[43; 44) | ||
41 | EQ@[44; 45) | ||
42 | WHITESPACE@[45; 46) | ||
43 | TUPLE_EXPR@[46; 48) | ||
44 | L_PAREN@[46; 47) | ||
45 | R_PAREN@[47; 48) | ||
46 | SEMI@[48; 49) | ||
47 | WHITESPACE@[49; 50) | ||
48 | R_CURLY@[50; 51) | ||
49 | WHITESPACE@[51; 52) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0036_placeholder_pat.rs b/crates/libsyntax2/tests/data/parser/inline/0036_placeholder_pat.rs new file mode 100644 index 000000000..4d719c433 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0036_placeholder_pat.rs | |||
@@ -0,0 +1 @@ | |||
fn main() { let _ = (); } | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0036_placeholder_pat.txt b/crates/libsyntax2/tests/data/parser/inline/0036_placeholder_pat.txt new file mode 100644 index 000000000..8c63cdfae --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0036_placeholder_pat.txt | |||
@@ -0,0 +1,28 @@ | |||
1 | FILE@[0; 26) | ||
2 | FUNCTION@[0; 25) | ||
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; 25) | ||
12 | L_CURLY@[10; 11) | ||
13 | WHITESPACE@[11; 12) | ||
14 | LET_STMT@[12; 23) | ||
15 | LET_KW@[12; 15) | ||
16 | WHITESPACE@[15; 16) | ||
17 | PLACEHOLDER_PAT@[16; 17) | ||
18 | UNDERSCORE@[16; 17) | ||
19 | WHITESPACE@[17; 18) | ||
20 | EQ@[18; 19) | ||
21 | WHITESPACE@[19; 20) | ||
22 | TUPLE_EXPR@[20; 22) | ||
23 | L_PAREN@[20; 21) | ||
24 | R_PAREN@[21; 22) | ||
25 | SEMI@[22; 23) | ||
26 | WHITESPACE@[23; 24) | ||
27 | R_CURLY@[24; 25) | ||
28 | WHITESPACE@[25; 26) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0037_crate_visibility.rs b/crates/libsyntax2/tests/data/parser/inline/0037_crate_visibility.rs new file mode 100644 index 000000000..faeefde94 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0037_crate_visibility.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | pub(crate) struct S; | ||
2 | pub(self) struct S; | ||
3 | pub(self) struct S; | ||
4 | pub(self) struct S; | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0037_crate_visibility.txt b/crates/libsyntax2/tests/data/parser/inline/0037_crate_visibility.txt new file mode 100644 index 000000000..113ac59e2 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0037_crate_visibility.txt | |||
@@ -0,0 +1,53 @@ | |||
1 | FILE@[0; 81) | ||
2 | STRUCT_ITEM@[0; 20) | ||
3 | VISIBILITY@[0; 10) | ||
4 | PUB_KW@[0; 3) | ||
5 | L_PAREN@[3; 4) | ||
6 | CRATE_KW@[4; 9) | ||
7 | R_PAREN@[9; 10) | ||
8 | WHITESPACE@[10; 11) | ||
9 | STRUCT_KW@[11; 17) | ||
10 | WHITESPACE@[17; 18) | ||
11 | NAME@[18; 19) | ||
12 | IDENT@[18; 19) "S" | ||
13 | SEMI@[19; 20) | ||
14 | WHITESPACE@[20; 21) | ||
15 | STRUCT_ITEM@[21; 40) | ||
16 | VISIBILITY@[21; 30) | ||
17 | PUB_KW@[21; 24) | ||
18 | L_PAREN@[24; 25) | ||
19 | SELF_KW@[25; 29) | ||
20 | R_PAREN@[29; 30) | ||
21 | WHITESPACE@[30; 31) | ||
22 | STRUCT_KW@[31; 37) | ||
23 | WHITESPACE@[37; 38) | ||
24 | NAME@[38; 39) | ||
25 | IDENT@[38; 39) "S" | ||
26 | SEMI@[39; 40) | ||
27 | WHITESPACE@[40; 41) | ||
28 | STRUCT_ITEM@[41; 60) | ||
29 | VISIBILITY@[41; 50) | ||
30 | PUB_KW@[41; 44) | ||
31 | L_PAREN@[44; 45) | ||
32 | SELF_KW@[45; 49) | ||
33 | R_PAREN@[49; 50) | ||
34 | WHITESPACE@[50; 51) | ||
35 | STRUCT_KW@[51; 57) | ||
36 | WHITESPACE@[57; 58) | ||
37 | NAME@[58; 59) | ||
38 | IDENT@[58; 59) "S" | ||
39 | SEMI@[59; 60) | ||
40 | WHITESPACE@[60; 61) | ||
41 | STRUCT_ITEM@[61; 80) | ||
42 | VISIBILITY@[61; 70) | ||
43 | PUB_KW@[61; 64) | ||
44 | L_PAREN@[64; 65) | ||
45 | SELF_KW@[65; 69) | ||
46 | R_PAREN@[69; 70) | ||
47 | WHITESPACE@[70; 71) | ||
48 | STRUCT_KW@[71; 77) | ||
49 | WHITESPACE@[77; 78) | ||
50 | NAME@[78; 79) | ||
51 | IDENT@[78; 79) "S" | ||
52 | SEMI@[79; 80) | ||
53 | WHITESPACE@[80; 81) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0038_function_ret_type.rs b/crates/libsyntax2/tests/data/parser/inline/0038_function_ret_type.rs new file mode 100644 index 000000000..d22d8cada --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0038_function_ret_type.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | fn foo() {} | ||
2 | fn bar() -> () {} | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0038_function_ret_type.txt b/crates/libsyntax2/tests/data/parser/inline/0038_function_ret_type.txt new file mode 100644 index 000000000..58583eefe --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0038_function_ret_type.txt | |||
@@ -0,0 +1,33 @@ | |||
1 | FILE@[0; 30) | ||
2 | FUNCTION@[0; 11) | ||
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; 11) | ||
12 | L_CURLY@[9; 10) | ||
13 | R_CURLY@[10; 11) | ||
14 | WHITESPACE@[11; 12) | ||
15 | FUNCTION@[12; 29) | ||
16 | FN_KW@[12; 14) | ||
17 | WHITESPACE@[14; 15) | ||
18 | NAME@[15; 18) | ||
19 | IDENT@[15; 18) "bar" | ||
20 | PARAM_LIST@[18; 20) | ||
21 | L_PAREN@[18; 19) | ||
22 | R_PAREN@[19; 20) | ||
23 | WHITESPACE@[20; 21) | ||
24 | THIN_ARROW@[21; 23) | ||
25 | WHITESPACE@[23; 24) | ||
26 | TUPLE_TYPE@[24; 26) | ||
27 | L_PAREN@[24; 25) | ||
28 | R_PAREN@[25; 26) | ||
29 | WHITESPACE@[26; 27) | ||
30 | BLOCK_EXPR@[27; 29) | ||
31 | L_CURLY@[27; 28) | ||
32 | R_CURLY@[28; 29) | ||
33 | WHITESPACE@[29; 30) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0039_path_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0039_path_expr.rs new file mode 100644 index 000000000..333ebabef --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0039_path_expr.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | let _ = a; | ||
3 | let _ = a::b; | ||
4 | let _ = ::a::<b>; | ||
5 | let _ = format!(); | ||
6 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0039_path_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0039_path_expr.txt new file mode 100644 index 000000000..8b505774f --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0039_path_expr.txt | |||
@@ -0,0 +1,94 @@ | |||
1 | FILE@[0; 91) | ||
2 | FUNCTION@[0; 90) | ||
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; 90) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | LET_STMT@[15; 25) | ||
15 | LET_KW@[15; 18) | ||
16 | WHITESPACE@[18; 19) | ||
17 | PLACEHOLDER_PAT@[19; 20) | ||
18 | UNDERSCORE@[19; 20) | ||
19 | WHITESPACE@[20; 21) | ||
20 | EQ@[21; 22) | ||
21 | WHITESPACE@[22; 23) | ||
22 | PATH_EXPR@[23; 24) | ||
23 | PATH@[23; 24) | ||
24 | PATH_SEGMENT@[23; 24) | ||
25 | NAME_REF@[23; 24) | ||
26 | IDENT@[23; 24) "a" | ||
27 | SEMI@[24; 25) | ||
28 | WHITESPACE@[25; 30) | ||
29 | LET_STMT@[30; 43) | ||
30 | LET_KW@[30; 33) | ||
31 | WHITESPACE@[33; 34) | ||
32 | PLACEHOLDER_PAT@[34; 35) | ||
33 | UNDERSCORE@[34; 35) | ||
34 | WHITESPACE@[35; 36) | ||
35 | EQ@[36; 37) | ||
36 | WHITESPACE@[37; 38) | ||
37 | PATH_EXPR@[38; 42) | ||
38 | PATH@[38; 42) | ||
39 | PATH@[38; 39) | ||
40 | PATH_SEGMENT@[38; 39) | ||
41 | NAME_REF@[38; 39) | ||
42 | IDENT@[38; 39) "a" | ||
43 | COLONCOLON@[39; 41) | ||
44 | PATH_SEGMENT@[41; 42) | ||
45 | NAME_REF@[41; 42) | ||
46 | IDENT@[41; 42) "b" | ||
47 | SEMI@[42; 43) | ||
48 | WHITESPACE@[43; 48) | ||
49 | LET_STMT@[48; 65) | ||
50 | LET_KW@[48; 51) | ||
51 | WHITESPACE@[51; 52) | ||
52 | PLACEHOLDER_PAT@[52; 53) | ||
53 | UNDERSCORE@[52; 53) | ||
54 | WHITESPACE@[53; 54) | ||
55 | EQ@[54; 55) | ||
56 | WHITESPACE@[55; 56) | ||
57 | PATH_EXPR@[56; 64) | ||
58 | PATH@[56; 64) | ||
59 | PATH_SEGMENT@[56; 64) | ||
60 | COLONCOLON@[56; 58) | ||
61 | NAME_REF@[58; 59) | ||
62 | IDENT@[58; 59) "a" | ||
63 | TYPE_ARG_LIST@[59; 64) | ||
64 | COLONCOLON@[59; 61) | ||
65 | L_ANGLE@[61; 62) | ||
66 | TYPE_ARG@[62; 63) | ||
67 | PATH_TYPE@[62; 63) | ||
68 | PATH@[62; 63) | ||
69 | PATH_SEGMENT@[62; 63) | ||
70 | NAME_REF@[62; 63) | ||
71 | IDENT@[62; 63) "b" | ||
72 | R_ANGLE@[63; 64) | ||
73 | SEMI@[64; 65) | ||
74 | WHITESPACE@[65; 70) | ||
75 | LET_STMT@[70; 88) | ||
76 | LET_KW@[70; 73) | ||
77 | WHITESPACE@[73; 74) | ||
78 | PLACEHOLDER_PAT@[74; 75) | ||
79 | UNDERSCORE@[74; 75) | ||
80 | WHITESPACE@[75; 76) | ||
81 | EQ@[76; 77) | ||
82 | WHITESPACE@[77; 78) | ||
83 | MACRO_CALL@[78; 87) | ||
84 | PATH@[78; 84) | ||
85 | PATH_SEGMENT@[78; 84) | ||
86 | NAME_REF@[78; 84) | ||
87 | IDENT@[78; 84) "format" | ||
88 | EXCL@[84; 85) | ||
89 | L_PAREN@[85; 86) | ||
90 | R_PAREN@[86; 87) | ||
91 | SEMI@[87; 88) | ||
92 | WHITESPACE@[88; 89) | ||
93 | R_CURLY@[89; 90) | ||
94 | WHITESPACE@[90; 91) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0040_expr_literals.rs b/crates/libsyntax2/tests/data/parser/inline/0040_expr_literals.rs new file mode 100644 index 000000000..2e11a5a6e --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0040_expr_literals.rs | |||
@@ -0,0 +1,12 @@ | |||
1 | fn foo() { | ||
2 | let _ = true; | ||
3 | let _ = false; | ||
4 | let _ = 1; | ||
5 | let _ = 2.0; | ||
6 | let _ = b'a'; | ||
7 | let _ = 'b'; | ||
8 | let _ = "c"; | ||
9 | let _ = r"d"; | ||
10 | let _ = b"e"; | ||
11 | let _ = br"f"; | ||
12 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0040_expr_literals.txt b/crates/libsyntax2/tests/data/parser/inline/0040_expr_literals.txt new file mode 100644 index 000000000..192b62211 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0040_expr_literals.txt | |||
@@ -0,0 +1,135 @@ | |||
1 | FILE@[0; 189) | ||
2 | FUNCTION@[0; 188) | ||
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; 188) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | LET_STMT@[15; 28) | ||
15 | LET_KW@[15; 18) | ||
16 | WHITESPACE@[18; 19) | ||
17 | PLACEHOLDER_PAT@[19; 20) | ||
18 | UNDERSCORE@[19; 20) | ||
19 | WHITESPACE@[20; 21) | ||
20 | EQ@[21; 22) | ||
21 | WHITESPACE@[22; 23) | ||
22 | LITERAL@[23; 27) | ||
23 | TRUE_KW@[23; 27) | ||
24 | SEMI@[27; 28) | ||
25 | WHITESPACE@[28; 33) | ||
26 | LET_STMT@[33; 47) | ||
27 | LET_KW@[33; 36) | ||
28 | WHITESPACE@[36; 37) | ||
29 | PLACEHOLDER_PAT@[37; 38) | ||
30 | UNDERSCORE@[37; 38) | ||
31 | WHITESPACE@[38; 39) | ||
32 | EQ@[39; 40) | ||
33 | WHITESPACE@[40; 41) | ||
34 | LITERAL@[41; 46) | ||
35 | FALSE_KW@[41; 46) | ||
36 | SEMI@[46; 47) | ||
37 | WHITESPACE@[47; 52) | ||
38 | LET_STMT@[52; 62) | ||
39 | LET_KW@[52; 55) | ||
40 | WHITESPACE@[55; 56) | ||
41 | PLACEHOLDER_PAT@[56; 57) | ||
42 | UNDERSCORE@[56; 57) | ||
43 | WHITESPACE@[57; 58) | ||
44 | EQ@[58; 59) | ||
45 | WHITESPACE@[59; 60) | ||
46 | LITERAL@[60; 61) | ||
47 | INT_NUMBER@[60; 61) "1" | ||
48 | SEMI@[61; 62) | ||
49 | WHITESPACE@[62; 67) | ||
50 | LET_STMT@[67; 79) | ||
51 | LET_KW@[67; 70) | ||
52 | WHITESPACE@[70; 71) | ||
53 | PLACEHOLDER_PAT@[71; 72) | ||
54 | UNDERSCORE@[71; 72) | ||
55 | WHITESPACE@[72; 73) | ||
56 | EQ@[73; 74) | ||
57 | WHITESPACE@[74; 75) | ||
58 | LITERAL@[75; 78) | ||
59 | FLOAT_NUMBER@[75; 78) "2.0" | ||
60 | SEMI@[78; 79) | ||
61 | WHITESPACE@[79; 84) | ||
62 | LET_STMT@[84; 97) | ||
63 | LET_KW@[84; 87) | ||
64 | WHITESPACE@[87; 88) | ||
65 | PLACEHOLDER_PAT@[88; 89) | ||
66 | UNDERSCORE@[88; 89) | ||
67 | WHITESPACE@[89; 90) | ||
68 | EQ@[90; 91) | ||
69 | WHITESPACE@[91; 92) | ||
70 | LITERAL@[92; 96) | ||
71 | BYTE@[92; 96) | ||
72 | SEMI@[96; 97) | ||
73 | WHITESPACE@[97; 102) | ||
74 | LET_STMT@[102; 114) | ||
75 | LET_KW@[102; 105) | ||
76 | WHITESPACE@[105; 106) | ||
77 | PLACEHOLDER_PAT@[106; 107) | ||
78 | UNDERSCORE@[106; 107) | ||
79 | WHITESPACE@[107; 108) | ||
80 | EQ@[108; 109) | ||
81 | WHITESPACE@[109; 110) | ||
82 | LITERAL@[110; 113) | ||
83 | CHAR@[110; 113) | ||
84 | SEMI@[113; 114) | ||
85 | WHITESPACE@[114; 119) | ||
86 | LET_STMT@[119; 131) | ||
87 | LET_KW@[119; 122) | ||
88 | WHITESPACE@[122; 123) | ||
89 | PLACEHOLDER_PAT@[123; 124) | ||
90 | UNDERSCORE@[123; 124) | ||
91 | WHITESPACE@[124; 125) | ||
92 | EQ@[125; 126) | ||
93 | WHITESPACE@[126; 127) | ||
94 | LITERAL@[127; 130) | ||
95 | STRING@[127; 130) | ||
96 | SEMI@[130; 131) | ||
97 | WHITESPACE@[131; 136) | ||
98 | LET_STMT@[136; 149) | ||
99 | LET_KW@[136; 139) | ||
100 | WHITESPACE@[139; 140) | ||
101 | PLACEHOLDER_PAT@[140; 141) | ||
102 | UNDERSCORE@[140; 141) | ||
103 | WHITESPACE@[141; 142) | ||
104 | EQ@[142; 143) | ||
105 | WHITESPACE@[143; 144) | ||
106 | LITERAL@[144; 148) | ||
107 | RAW_STRING@[144; 148) | ||
108 | SEMI@[148; 149) | ||
109 | WHITESPACE@[149; 154) | ||
110 | LET_STMT@[154; 167) | ||
111 | LET_KW@[154; 157) | ||
112 | WHITESPACE@[157; 158) | ||
113 | PLACEHOLDER_PAT@[158; 159) | ||
114 | UNDERSCORE@[158; 159) | ||
115 | WHITESPACE@[159; 160) | ||
116 | EQ@[160; 161) | ||
117 | WHITESPACE@[161; 162) | ||
118 | LITERAL@[162; 166) | ||
119 | BYTE_STRING@[162; 166) | ||
120 | SEMI@[166; 167) | ||
121 | WHITESPACE@[167; 172) | ||
122 | LET_STMT@[172; 186) | ||
123 | LET_KW@[172; 175) | ||
124 | WHITESPACE@[175; 176) | ||
125 | PLACEHOLDER_PAT@[176; 177) | ||
126 | UNDERSCORE@[176; 177) | ||
127 | WHITESPACE@[177; 178) | ||
128 | EQ@[178; 179) | ||
129 | WHITESPACE@[179; 180) | ||
130 | LITERAL@[180; 185) | ||
131 | RAW_BYTE_STRING@[180; 185) | ||
132 | SEMI@[185; 186) | ||
133 | WHITESPACE@[186; 187) | ||
134 | R_CURLY@[187; 188) | ||
135 | WHITESPACE@[188; 189) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0041_type_param_bounds.rs b/crates/libsyntax2/tests/data/parser/inline/0041_type_param_bounds.rs new file mode 100644 index 000000000..919bde0ee --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0041_type_param_bounds.rs | |||
@@ -0,0 +1 @@ | |||
struct S<T: 'a + ?Sized + (Copy)>; | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0041_type_param_bounds.txt b/crates/libsyntax2/tests/data/parser/inline/0041_type_param_bounds.txt new file mode 100644 index 000000000..4996d6ace --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0041_type_param_bounds.txt | |||
@@ -0,0 +1,34 @@ | |||
1 | FILE@[0; 35) | ||
2 | STRUCT_ITEM@[0; 34) | ||
3 | STRUCT_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | NAME@[7; 8) | ||
6 | IDENT@[7; 8) "S" | ||
7 | TYPE_PARAM_LIST@[8; 33) | ||
8 | L_ANGLE@[8; 9) | ||
9 | TYPE_PARAM@[9; 32) | ||
10 | NAME@[9; 10) | ||
11 | IDENT@[9; 10) "T" | ||
12 | COLON@[10; 11) | ||
13 | WHITESPACE@[11; 12) | ||
14 | LIFETIME@[12; 14) "'a" | ||
15 | WHITESPACE@[14; 15) | ||
16 | PLUS@[15; 16) | ||
17 | WHITESPACE@[16; 17) | ||
18 | QUESTION@[17; 18) | ||
19 | PATH@[18; 23) | ||
20 | PATH_SEGMENT@[18; 23) | ||
21 | NAME_REF@[18; 23) | ||
22 | IDENT@[18; 23) "Sized" | ||
23 | WHITESPACE@[23; 24) | ||
24 | PLUS@[24; 25) | ||
25 | WHITESPACE@[25; 26) | ||
26 | L_PAREN@[26; 27) | ||
27 | PATH@[27; 31) | ||
28 | PATH_SEGMENT@[27; 31) | ||
29 | NAME_REF@[27; 31) | ||
30 | IDENT@[27; 31) "Copy" | ||
31 | R_PAREN@[31; 32) | ||
32 | R_ANGLE@[32; 33) | ||
33 | SEMI@[33; 34) | ||
34 | WHITESPACE@[34; 35) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0042_type_param_default.rs b/crates/libsyntax2/tests/data/parser/inline/0042_type_param_default.rs new file mode 100644 index 000000000..540eacb02 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0042_type_param_default.rs | |||
@@ -0,0 +1 @@ | |||
struct S<T = i32>; | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0042_type_param_default.txt b/crates/libsyntax2/tests/data/parser/inline/0042_type_param_default.txt new file mode 100644 index 000000000..ec875e9a2 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0042_type_param_default.txt | |||
@@ -0,0 +1,22 @@ | |||
1 | FILE@[0; 19) | ||
2 | STRUCT_ITEM@[0; 18) | ||
3 | STRUCT_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | NAME@[7; 8) | ||
6 | IDENT@[7; 8) "S" | ||
7 | TYPE_PARAM_LIST@[8; 17) | ||
8 | L_ANGLE@[8; 9) | ||
9 | TYPE_PARAM@[9; 16) | ||
10 | NAME@[9; 10) | ||
11 | IDENT@[9; 10) "T" | ||
12 | WHITESPACE@[10; 11) | ||
13 | EQ@[11; 12) | ||
14 | WHITESPACE@[12; 13) | ||
15 | PATH_TYPE@[13; 16) | ||
16 | PATH@[13; 16) | ||
17 | PATH_SEGMENT@[13; 16) | ||
18 | NAME_REF@[13; 16) | ||
19 | IDENT@[13; 16) "i32" | ||
20 | R_ANGLE@[16; 17) | ||
21 | SEMI@[17; 18) | ||
22 | WHITESPACE@[18; 19) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0043_call_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0043_call_expr.rs new file mode 100644 index 000000000..0c9a20718 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0043_call_expr.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | let _ = f(); | ||
3 | let _ = f()(1)(1, 2,); | ||
4 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0043_call_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0043_call_expr.txt new file mode 100644 index 000000000..f4789d2d9 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0043_call_expr.txt | |||
@@ -0,0 +1,70 @@ | |||
1 | FILE@[0; 57) | ||
2 | FUNCTION@[0; 56) | ||
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; 56) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | LET_STMT@[15; 27) | ||
15 | LET_KW@[15; 18) | ||
16 | WHITESPACE@[18; 19) | ||
17 | PLACEHOLDER_PAT@[19; 20) | ||
18 | UNDERSCORE@[19; 20) | ||
19 | WHITESPACE@[20; 21) | ||
20 | EQ@[21; 22) | ||
21 | WHITESPACE@[22; 23) | ||
22 | CALL_EXPR@[23; 26) | ||
23 | PATH_EXPR@[23; 24) | ||
24 | PATH@[23; 24) | ||
25 | PATH_SEGMENT@[23; 24) | ||
26 | NAME_REF@[23; 24) | ||
27 | IDENT@[23; 24) "f" | ||
28 | ARG_LIST@[24; 26) | ||
29 | L_PAREN@[24; 25) | ||
30 | R_PAREN@[25; 26) | ||
31 | SEMI@[26; 27) | ||
32 | WHITESPACE@[27; 32) | ||
33 | LET_STMT@[32; 54) | ||
34 | LET_KW@[32; 35) | ||
35 | WHITESPACE@[35; 36) | ||
36 | PLACEHOLDER_PAT@[36; 37) | ||
37 | UNDERSCORE@[36; 37) | ||
38 | WHITESPACE@[37; 38) | ||
39 | EQ@[38; 39) | ||
40 | WHITESPACE@[39; 40) | ||
41 | CALL_EXPR@[40; 53) | ||
42 | CALL_EXPR@[40; 46) | ||
43 | CALL_EXPR@[40; 43) | ||
44 | PATH_EXPR@[40; 41) | ||
45 | PATH@[40; 41) | ||
46 | PATH_SEGMENT@[40; 41) | ||
47 | NAME_REF@[40; 41) | ||
48 | IDENT@[40; 41) "f" | ||
49 | ARG_LIST@[41; 43) | ||
50 | L_PAREN@[41; 42) | ||
51 | R_PAREN@[42; 43) | ||
52 | ARG_LIST@[43; 46) | ||
53 | L_PAREN@[43; 44) | ||
54 | LITERAL@[44; 45) | ||
55 | INT_NUMBER@[44; 45) "1" | ||
56 | R_PAREN@[45; 46) | ||
57 | ARG_LIST@[46; 53) | ||
58 | L_PAREN@[46; 47) | ||
59 | LITERAL@[47; 48) | ||
60 | INT_NUMBER@[47; 48) "1" | ||
61 | COMMA@[48; 49) | ||
62 | WHITESPACE@[49; 50) | ||
63 | LITERAL@[50; 51) | ||
64 | INT_NUMBER@[50; 51) "2" | ||
65 | COMMA@[51; 52) | ||
66 | R_PAREN@[52; 53) | ||
67 | SEMI@[53; 54) | ||
68 | WHITESPACE@[54; 55) | ||
69 | R_CURLY@[55; 56) | ||
70 | WHITESPACE@[56; 57) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0044_ref_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0044_ref_expr.rs new file mode 100644 index 000000000..2dac6be95 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0044_ref_expr.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | let _ = &1; | ||
3 | let _ = &mut &f(); | ||
4 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0044_ref_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0044_ref_expr.txt new file mode 100644 index 000000000..05f6c015a --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0044_ref_expr.txt | |||
@@ -0,0 +1,54 @@ | |||
1 | FILE@[0; 52) | ||
2 | FUNCTION@[0; 51) | ||
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; 51) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | LET_STMT@[15; 26) | ||
15 | LET_KW@[15; 18) | ||
16 | WHITESPACE@[18; 19) | ||
17 | PLACEHOLDER_PAT@[19; 20) | ||
18 | UNDERSCORE@[19; 20) | ||
19 | WHITESPACE@[20; 21) | ||
20 | EQ@[21; 22) | ||
21 | WHITESPACE@[22; 23) | ||
22 | REF_EXPR@[23; 25) | ||
23 | AMP@[23; 24) | ||
24 | LITERAL@[24; 25) | ||
25 | INT_NUMBER@[24; 25) "1" | ||
26 | SEMI@[25; 26) | ||
27 | WHITESPACE@[26; 31) | ||
28 | LET_STMT@[31; 49) | ||
29 | LET_KW@[31; 34) | ||
30 | WHITESPACE@[34; 35) | ||
31 | PLACEHOLDER_PAT@[35; 36) | ||
32 | UNDERSCORE@[35; 36) | ||
33 | WHITESPACE@[36; 37) | ||
34 | EQ@[37; 38) | ||
35 | WHITESPACE@[38; 39) | ||
36 | REF_EXPR@[39; 48) | ||
37 | AMP@[39; 40) | ||
38 | MUT_KW@[40; 43) | ||
39 | WHITESPACE@[43; 44) | ||
40 | REF_EXPR@[44; 48) | ||
41 | AMP@[44; 45) | ||
42 | CALL_EXPR@[45; 48) | ||
43 | PATH_EXPR@[45; 46) | ||
44 | PATH@[45; 46) | ||
45 | PATH_SEGMENT@[45; 46) | ||
46 | NAME_REF@[45; 46) | ||
47 | IDENT@[45; 46) "f" | ||
48 | ARG_LIST@[46; 48) | ||
49 | L_PAREN@[46; 47) | ||
50 | R_PAREN@[47; 48) | ||
51 | SEMI@[48; 49) | ||
52 | WHITESPACE@[49; 50) | ||
53 | R_CURLY@[50; 51) | ||
54 | WHITESPACE@[51; 52) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0045_block.rs b/crates/libsyntax2/tests/data/parser/inline/0045_block.rs new file mode 100644 index 000000000..81f44c533 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0045_block.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn a() {} | ||
2 | fn b() { let _ = 1; } | ||
3 | fn c() { 1; 2; } | ||
4 | fn d() { 1; 2 } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0045_block.txt b/crates/libsyntax2/tests/data/parser/inline/0045_block.txt new file mode 100644 index 000000000..8519101c3 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0045_block.txt | |||
@@ -0,0 +1,86 @@ | |||
1 | FILE@[0; 65) | ||
2 | FUNCTION@[0; 9) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 4) | ||
6 | IDENT@[3; 4) "a" | ||
7 | PARAM_LIST@[4; 6) | ||
8 | L_PAREN@[4; 5) | ||
9 | R_PAREN@[5; 6) | ||
10 | WHITESPACE@[6; 7) | ||
11 | BLOCK_EXPR@[7; 9) | ||
12 | L_CURLY@[7; 8) | ||
13 | R_CURLY@[8; 9) | ||
14 | WHITESPACE@[9; 10) | ||
15 | FUNCTION@[10; 31) | ||
16 | FN_KW@[10; 12) | ||
17 | WHITESPACE@[12; 13) | ||
18 | NAME@[13; 14) | ||
19 | IDENT@[13; 14) "b" | ||
20 | PARAM_LIST@[14; 16) | ||
21 | L_PAREN@[14; 15) | ||
22 | R_PAREN@[15; 16) | ||
23 | WHITESPACE@[16; 17) | ||
24 | BLOCK_EXPR@[17; 31) | ||
25 | L_CURLY@[17; 18) | ||
26 | WHITESPACE@[18; 19) | ||
27 | LET_STMT@[19; 29) | ||
28 | LET_KW@[19; 22) | ||
29 | WHITESPACE@[22; 23) | ||
30 | PLACEHOLDER_PAT@[23; 24) | ||
31 | UNDERSCORE@[23; 24) | ||
32 | WHITESPACE@[24; 25) | ||
33 | EQ@[25; 26) | ||
34 | WHITESPACE@[26; 27) | ||
35 | LITERAL@[27; 28) | ||
36 | INT_NUMBER@[27; 28) "1" | ||
37 | SEMI@[28; 29) | ||
38 | WHITESPACE@[29; 30) | ||
39 | R_CURLY@[30; 31) | ||
40 | WHITESPACE@[31; 32) | ||
41 | FUNCTION@[32; 48) | ||
42 | FN_KW@[32; 34) | ||
43 | WHITESPACE@[34; 35) | ||
44 | NAME@[35; 36) | ||
45 | IDENT@[35; 36) "c" | ||
46 | PARAM_LIST@[36; 38) | ||
47 | L_PAREN@[36; 37) | ||
48 | R_PAREN@[37; 38) | ||
49 | WHITESPACE@[38; 39) | ||
50 | BLOCK_EXPR@[39; 48) | ||
51 | L_CURLY@[39; 40) | ||
52 | WHITESPACE@[40; 41) | ||
53 | EXPR_STMT@[41; 43) | ||
54 | LITERAL@[41; 42) | ||
55 | INT_NUMBER@[41; 42) "1" | ||
56 | SEMI@[42; 43) | ||
57 | WHITESPACE@[43; 44) | ||
58 | EXPR_STMT@[44; 46) | ||
59 | LITERAL@[44; 45) | ||
60 | INT_NUMBER@[44; 45) "2" | ||
61 | SEMI@[45; 46) | ||
62 | WHITESPACE@[46; 47) | ||
63 | R_CURLY@[47; 48) | ||
64 | WHITESPACE@[48; 49) | ||
65 | FUNCTION@[49; 64) | ||
66 | FN_KW@[49; 51) | ||
67 | WHITESPACE@[51; 52) | ||
68 | NAME@[52; 53) | ||
69 | IDENT@[52; 53) "d" | ||
70 | PARAM_LIST@[53; 55) | ||
71 | L_PAREN@[53; 54) | ||
72 | R_PAREN@[54; 55) | ||
73 | WHITESPACE@[55; 56) | ||
74 | BLOCK_EXPR@[56; 64) | ||
75 | L_CURLY@[56; 57) | ||
76 | WHITESPACE@[57; 58) | ||
77 | EXPR_STMT@[58; 60) | ||
78 | LITERAL@[58; 59) | ||
79 | INT_NUMBER@[58; 59) "1" | ||
80 | SEMI@[59; 60) | ||
81 | WHITESPACE@[60; 61) | ||
82 | LITERAL@[61; 62) | ||
83 | INT_NUMBER@[61; 62) "2" | ||
84 | WHITESPACE@[62; 63) | ||
85 | R_CURLY@[63; 64) | ||
86 | WHITESPACE@[64; 65) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0046_default_impl.rs b/crates/libsyntax2/tests/data/parser/inline/0046_default_impl.rs new file mode 100644 index 000000000..ef6aa84a2 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0046_default_impl.rs | |||
@@ -0,0 +1 @@ | |||
default impl Foo {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0046_default_impl.txt b/crates/libsyntax2/tests/data/parser/inline/0046_default_impl.txt new file mode 100644 index 000000000..d5a27baf7 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0046_default_impl.txt | |||
@@ -0,0 +1,15 @@ | |||
1 | FILE@[0; 20) | ||
2 | IMPL_ITEM@[0; 19) | ||
3 | DEFAULT_KW@[0; 7) | ||
4 | WHITESPACE@[7; 8) | ||
5 | IMPL_KW@[8; 12) | ||
6 | WHITESPACE@[12; 13) | ||
7 | PATH_TYPE@[13; 16) | ||
8 | PATH@[13; 16) | ||
9 | PATH_SEGMENT@[13; 16) | ||
10 | NAME_REF@[13; 16) | ||
11 | IDENT@[13; 16) "Foo" | ||
12 | WHITESPACE@[16; 17) | ||
13 | L_CURLY@[17; 18) | ||
14 | R_CURLY@[18; 19) | ||
15 | WHITESPACE@[19; 20) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0047_impl_item.rs b/crates/libsyntax2/tests/data/parser/inline/0047_impl_item.rs new file mode 100644 index 000000000..d6337f6b3 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0047_impl_item.rs | |||
@@ -0,0 +1 @@ | |||
impl Foo {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0047_impl_item.txt b/crates/libsyntax2/tests/data/parser/inline/0047_impl_item.txt new file mode 100644 index 000000000..76b29f95d --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0047_impl_item.txt | |||
@@ -0,0 +1,13 @@ | |||
1 | FILE@[0; 12) | ||
2 | IMPL_ITEM@[0; 11) | ||
3 | IMPL_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | PATH_TYPE@[5; 8) | ||
6 | PATH@[5; 8) | ||
7 | PATH_SEGMENT@[5; 8) | ||
8 | NAME_REF@[5; 8) | ||
9 | IDENT@[5; 8) "Foo" | ||
10 | WHITESPACE@[8; 9) | ||
11 | L_CURLY@[9; 10) | ||
12 | R_CURLY@[10; 11) | ||
13 | WHITESPACE@[11; 12) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0048_impl_item_neg.rs b/crates/libsyntax2/tests/data/parser/inline/0048_impl_item_neg.rs new file mode 100644 index 000000000..b7527c870 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0048_impl_item_neg.rs | |||
@@ -0,0 +1 @@ | |||
impl !Send for X {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0048_impl_item_neg.txt b/crates/libsyntax2/tests/data/parser/inline/0048_impl_item_neg.txt new file mode 100644 index 000000000..2d01419c0 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0048_impl_item_neg.txt | |||
@@ -0,0 +1,22 @@ | |||
1 | FILE@[0; 20) | ||
2 | IMPL_ITEM@[0; 19) | ||
3 | IMPL_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | EXCL@[5; 6) | ||
6 | PATH_TYPE@[6; 10) | ||
7 | PATH@[6; 10) | ||
8 | PATH_SEGMENT@[6; 10) | ||
9 | NAME_REF@[6; 10) | ||
10 | IDENT@[6; 10) "Send" | ||
11 | WHITESPACE@[10; 11) | ||
12 | FOR_KW@[11; 14) | ||
13 | WHITESPACE@[14; 15) | ||
14 | PATH_TYPE@[15; 16) | ||
15 | PATH@[15; 16) | ||
16 | PATH_SEGMENT@[15; 16) | ||
17 | NAME_REF@[15; 16) | ||
18 | IDENT@[15; 16) "X" | ||
19 | WHITESPACE@[16; 17) | ||
20 | L_CURLY@[17; 18) | ||
21 | R_CURLY@[18; 19) | ||
22 | WHITESPACE@[19; 20) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0050_let_stmt;.rs b/crates/libsyntax2/tests/data/parser/inline/0050_let_stmt;.rs new file mode 100644 index 000000000..0a9af907f --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0050_let_stmt;.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | let a; | ||
3 | let b: i32; | ||
4 | let c = 92; | ||
5 | let d: i32 = 92; | ||
6 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0050_let_stmt;.txt b/crates/libsyntax2/tests/data/parser/inline/0050_let_stmt;.txt new file mode 100644 index 000000000..44e357092 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0050_let_stmt;.txt | |||
@@ -0,0 +1,71 @@ | |||
1 | FILE@[0; 77) | ||
2 | FUNCTION@[0; 76) | ||
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; 76) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | LET_STMT@[15; 21) | ||
15 | LET_KW@[15; 18) | ||
16 | WHITESPACE@[18; 19) | ||
17 | BIND_PAT@[19; 20) | ||
18 | NAME@[19; 20) | ||
19 | IDENT@[19; 20) "a" | ||
20 | SEMI@[20; 21) | ||
21 | WHITESPACE@[21; 26) | ||
22 | LET_STMT@[26; 37) | ||
23 | LET_KW@[26; 29) | ||
24 | WHITESPACE@[29; 30) | ||
25 | BIND_PAT@[30; 31) | ||
26 | NAME@[30; 31) | ||
27 | IDENT@[30; 31) "b" | ||
28 | COLON@[31; 32) | ||
29 | WHITESPACE@[32; 33) | ||
30 | PATH_TYPE@[33; 36) | ||
31 | PATH@[33; 36) | ||
32 | PATH_SEGMENT@[33; 36) | ||
33 | NAME_REF@[33; 36) | ||
34 | IDENT@[33; 36) "i32" | ||
35 | SEMI@[36; 37) | ||
36 | WHITESPACE@[37; 42) | ||
37 | LET_STMT@[42; 53) | ||
38 | LET_KW@[42; 45) | ||
39 | WHITESPACE@[45; 46) | ||
40 | BIND_PAT@[46; 47) | ||
41 | NAME@[46; 47) | ||
42 | IDENT@[46; 47) "c" | ||
43 | WHITESPACE@[47; 48) | ||
44 | EQ@[48; 49) | ||
45 | WHITESPACE@[49; 50) | ||
46 | LITERAL@[50; 52) | ||
47 | INT_NUMBER@[50; 52) "92" | ||
48 | SEMI@[52; 53) | ||
49 | WHITESPACE@[53; 58) | ||
50 | LET_STMT@[58; 74) | ||
51 | LET_KW@[58; 61) | ||
52 | WHITESPACE@[61; 62) | ||
53 | BIND_PAT@[62; 63) | ||
54 | NAME@[62; 63) | ||
55 | IDENT@[62; 63) "d" | ||
56 | COLON@[63; 64) | ||
57 | WHITESPACE@[64; 65) | ||
58 | PATH_TYPE@[65; 68) | ||
59 | PATH@[65; 68) | ||
60 | PATH_SEGMENT@[65; 68) | ||
61 | NAME_REF@[65; 68) | ||
62 | IDENT@[65; 68) "i32" | ||
63 | WHITESPACE@[68; 69) | ||
64 | EQ@[69; 70) | ||
65 | WHITESPACE@[70; 71) | ||
66 | LITERAL@[71; 73) | ||
67 | INT_NUMBER@[71; 73) "92" | ||
68 | SEMI@[73; 74) | ||
69 | WHITESPACE@[74; 75) | ||
70 | R_CURLY@[75; 76) | ||
71 | WHITESPACE@[76; 77) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0051_method_call_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0051_method_call_expr.rs new file mode 100644 index 000000000..1a3aa35ae --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0051_method_call_expr.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | x.foo(); | ||
3 | y.bar::<T>(1, 2,); | ||
4 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0051_method_call_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0051_method_call_expr.txt new file mode 100644 index 000000000..aafb2d5f1 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0051_method_call_expr.txt | |||
@@ -0,0 +1,62 @@ | |||
1 | FILE@[0; 49) | ||
2 | FUNCTION@[0; 48) | ||
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; 48) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 23) | ||
15 | METHOD_CALL_EXPR@[15; 22) | ||
16 | PATH_EXPR@[15; 16) | ||
17 | PATH@[15; 16) | ||
18 | PATH_SEGMENT@[15; 16) | ||
19 | NAME_REF@[15; 16) | ||
20 | IDENT@[15; 16) "x" | ||
21 | DOT@[16; 17) | ||
22 | NAME_REF@[17; 20) | ||
23 | IDENT@[17; 20) "foo" | ||
24 | ARG_LIST@[20; 22) | ||
25 | L_PAREN@[20; 21) | ||
26 | R_PAREN@[21; 22) | ||
27 | SEMI@[22; 23) | ||
28 | WHITESPACE@[23; 28) | ||
29 | EXPR_STMT@[28; 46) | ||
30 | METHOD_CALL_EXPR@[28; 45) | ||
31 | PATH_EXPR@[28; 29) | ||
32 | PATH@[28; 29) | ||
33 | PATH_SEGMENT@[28; 29) | ||
34 | NAME_REF@[28; 29) | ||
35 | IDENT@[28; 29) "y" | ||
36 | DOT@[29; 30) | ||
37 | NAME_REF@[30; 33) | ||
38 | IDENT@[30; 33) "bar" | ||
39 | TYPE_ARG_LIST@[33; 38) | ||
40 | COLONCOLON@[33; 35) | ||
41 | L_ANGLE@[35; 36) | ||
42 | TYPE_ARG@[36; 37) | ||
43 | PATH_TYPE@[36; 37) | ||
44 | PATH@[36; 37) | ||
45 | PATH_SEGMENT@[36; 37) | ||
46 | NAME_REF@[36; 37) | ||
47 | IDENT@[36; 37) "T" | ||
48 | R_ANGLE@[37; 38) | ||
49 | ARG_LIST@[38; 45) | ||
50 | L_PAREN@[38; 39) | ||
51 | LITERAL@[39; 40) | ||
52 | INT_NUMBER@[39; 40) "1" | ||
53 | COMMA@[40; 41) | ||
54 | WHITESPACE@[41; 42) | ||
55 | LITERAL@[42; 43) | ||
56 | INT_NUMBER@[42; 43) "2" | ||
57 | COMMA@[43; 44) | ||
58 | R_PAREN@[44; 45) | ||
59 | SEMI@[45; 46) | ||
60 | WHITESPACE@[46; 47) | ||
61 | R_CURLY@[47; 48) | ||
62 | WHITESPACE@[48; 49) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0052_field_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0052_field_expr.rs new file mode 100644 index 000000000..3e69538e5 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0052_field_expr.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | x.foo; | ||
3 | x.0.bar; | ||
4 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0052_field_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0052_field_expr.txt new file mode 100644 index 000000000..213884f90 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0052_field_expr.txt | |||
@@ -0,0 +1,42 @@ | |||
1 | FILE@[0; 37) | ||
2 | FUNCTION@[0; 36) | ||
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; 36) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 21) | ||
15 | FIELD_EXPR@[15; 20) | ||
16 | PATH_EXPR@[15; 16) | ||
17 | PATH@[15; 16) | ||
18 | PATH_SEGMENT@[15; 16) | ||
19 | NAME_REF@[15; 16) | ||
20 | IDENT@[15; 16) "x" | ||
21 | DOT@[16; 17) | ||
22 | NAME_REF@[17; 20) | ||
23 | IDENT@[17; 20) "foo" | ||
24 | SEMI@[20; 21) | ||
25 | WHITESPACE@[21; 26) | ||
26 | EXPR_STMT@[26; 34) | ||
27 | FIELD_EXPR@[26; 33) | ||
28 | FIELD_EXPR@[26; 29) | ||
29 | PATH_EXPR@[26; 27) | ||
30 | PATH@[26; 27) | ||
31 | PATH_SEGMENT@[26; 27) | ||
32 | NAME_REF@[26; 27) | ||
33 | IDENT@[26; 27) "x" | ||
34 | DOT@[27; 28) | ||
35 | INT_NUMBER@[28; 29) "0" | ||
36 | DOT@[29; 30) | ||
37 | NAME_REF@[30; 33) | ||
38 | IDENT@[30; 33) "bar" | ||
39 | SEMI@[33; 34) | ||
40 | WHITESPACE@[34; 35) | ||
41 | R_CURLY@[35; 36) | ||
42 | WHITESPACE@[36; 37) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0053_block_items.rs b/crates/libsyntax2/tests/data/parser/inline/0053_block_items.rs new file mode 100644 index 000000000..d9868718c --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0053_block_items.rs | |||
@@ -0,0 +1 @@ | |||
fn a() { fn b() {} } | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0053_block_items.txt b/crates/libsyntax2/tests/data/parser/inline/0053_block_items.txt new file mode 100644 index 000000000..c5498532b --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0053_block_items.txt | |||
@@ -0,0 +1,28 @@ | |||
1 | FILE@[0; 21) | ||
2 | FUNCTION@[0; 20) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 4) | ||
6 | IDENT@[3; 4) "a" | ||
7 | PARAM_LIST@[4; 6) | ||
8 | L_PAREN@[4; 5) | ||
9 | R_PAREN@[5; 6) | ||
10 | WHITESPACE@[6; 7) | ||
11 | BLOCK_EXPR@[7; 20) | ||
12 | L_CURLY@[7; 8) | ||
13 | WHITESPACE@[8; 9) | ||
14 | FUNCTION@[9; 18) | ||
15 | FN_KW@[9; 11) | ||
16 | WHITESPACE@[11; 12) | ||
17 | NAME@[12; 13) | ||
18 | IDENT@[12; 13) "b" | ||
19 | PARAM_LIST@[13; 15) | ||
20 | L_PAREN@[13; 14) | ||
21 | R_PAREN@[14; 15) | ||
22 | WHITESPACE@[15; 16) | ||
23 | BLOCK_EXPR@[16; 18) | ||
24 | L_CURLY@[16; 17) | ||
25 | R_CURLY@[17; 18) | ||
26 | WHITESPACE@[18; 19) | ||
27 | R_CURLY@[19; 20) | ||
28 | WHITESPACE@[20; 21) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0054_impl_item_items.rs b/crates/libsyntax2/tests/data/parser/inline/0054_impl_item_items.rs new file mode 100644 index 000000000..f10851487 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0054_impl_item_items.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | impl F { | ||
2 | type A = i32; | ||
3 | const B: i32 = 92; | ||
4 | fn foo() {} | ||
5 | fn bar(&self) {} | ||
6 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0054_impl_item_items.txt b/crates/libsyntax2/tests/data/parser/inline/0054_impl_item_items.txt new file mode 100644 index 000000000..739ecbbcd --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0054_impl_item_items.txt | |||
@@ -0,0 +1,77 @@ | |||
1 | FILE@[0; 89) | ||
2 | IMPL_ITEM@[0; 88) | ||
3 | IMPL_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | PATH_TYPE@[5; 6) | ||
6 | PATH@[5; 6) | ||
7 | PATH_SEGMENT@[5; 6) | ||
8 | NAME_REF@[5; 6) | ||
9 | IDENT@[5; 6) "F" | ||
10 | WHITESPACE@[6; 7) | ||
11 | L_CURLY@[7; 8) | ||
12 | WHITESPACE@[8; 13) | ||
13 | TYPE_ITEM@[13; 26) | ||
14 | TYPE_KW@[13; 17) | ||
15 | WHITESPACE@[17; 18) | ||
16 | NAME@[18; 19) | ||
17 | IDENT@[18; 19) "A" | ||
18 | WHITESPACE@[19; 20) | ||
19 | EQ@[20; 21) | ||
20 | WHITESPACE@[21; 22) | ||
21 | PATH_TYPE@[22; 25) | ||
22 | PATH@[22; 25) | ||
23 | PATH_SEGMENT@[22; 25) | ||
24 | NAME_REF@[22; 25) | ||
25 | IDENT@[22; 25) "i32" | ||
26 | SEMI@[25; 26) | ||
27 | WHITESPACE@[26; 31) | ||
28 | CONST_ITEM@[31; 49) | ||
29 | CONST_KW@[31; 36) | ||
30 | WHITESPACE@[36; 37) | ||
31 | NAME@[37; 38) | ||
32 | IDENT@[37; 38) "B" | ||
33 | COLON@[38; 39) | ||
34 | WHITESPACE@[39; 40) | ||
35 | PATH_TYPE@[40; 43) | ||
36 | PATH@[40; 43) | ||
37 | PATH_SEGMENT@[40; 43) | ||
38 | NAME_REF@[40; 43) | ||
39 | IDENT@[40; 43) "i32" | ||
40 | WHITESPACE@[43; 44) | ||
41 | EQ@[44; 45) | ||
42 | WHITESPACE@[45; 46) | ||
43 | LITERAL@[46; 48) | ||
44 | INT_NUMBER@[46; 48) "92" | ||
45 | SEMI@[48; 49) | ||
46 | WHITESPACE@[49; 54) | ||
47 | FUNCTION@[54; 65) | ||
48 | FN_KW@[54; 56) | ||
49 | WHITESPACE@[56; 57) | ||
50 | NAME@[57; 60) | ||
51 | IDENT@[57; 60) "foo" | ||
52 | PARAM_LIST@[60; 62) | ||
53 | L_PAREN@[60; 61) | ||
54 | R_PAREN@[61; 62) | ||
55 | WHITESPACE@[62; 63) | ||
56 | BLOCK_EXPR@[63; 65) | ||
57 | L_CURLY@[63; 64) | ||
58 | R_CURLY@[64; 65) | ||
59 | WHITESPACE@[65; 70) | ||
60 | FUNCTION@[70; 86) | ||
61 | FN_KW@[70; 72) | ||
62 | WHITESPACE@[72; 73) | ||
63 | NAME@[73; 76) | ||
64 | IDENT@[73; 76) "bar" | ||
65 | PARAM_LIST@[76; 83) | ||
66 | L_PAREN@[76; 77) | ||
67 | SELF_PARAM@[77; 82) | ||
68 | AMP@[77; 78) | ||
69 | SELF_KW@[78; 82) | ||
70 | R_PAREN@[82; 83) | ||
71 | WHITESPACE@[83; 84) | ||
72 | BLOCK_EXPR@[84; 86) | ||
73 | L_CURLY@[84; 85) | ||
74 | R_CURLY@[85; 86) | ||
75 | WHITESPACE@[86; 87) | ||
76 | R_CURLY@[87; 88) | ||
77 | WHITESPACE@[88; 89) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0055_self_param.rs b/crates/libsyntax2/tests/data/parser/inline/0055_self_param.rs new file mode 100644 index 000000000..7bb1ca50c --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0055_self_param.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | impl S { | ||
2 | fn a(self) {} | ||
3 | fn b(&self,) {} | ||
4 | fn c(&'a self,) {} | ||
5 | fn d(&'a mut self, x: i32) {} | ||
6 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0055_self_param.txt b/crates/libsyntax2/tests/data/parser/inline/0055_self_param.txt new file mode 100644 index 000000000..1275fb8b1 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0055_self_param.txt | |||
@@ -0,0 +1,98 @@ | |||
1 | FILE@[0; 106) | ||
2 | IMPL_ITEM@[0; 105) | ||
3 | IMPL_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | PATH_TYPE@[5; 6) | ||
6 | PATH@[5; 6) | ||
7 | PATH_SEGMENT@[5; 6) | ||
8 | NAME_REF@[5; 6) | ||
9 | IDENT@[5; 6) "S" | ||
10 | WHITESPACE@[6; 7) | ||
11 | L_CURLY@[7; 8) | ||
12 | WHITESPACE@[8; 13) | ||
13 | FUNCTION@[13; 26) | ||
14 | FN_KW@[13; 15) | ||
15 | WHITESPACE@[15; 16) | ||
16 | NAME@[16; 17) | ||
17 | IDENT@[16; 17) "a" | ||
18 | PARAM_LIST@[17; 23) | ||
19 | L_PAREN@[17; 18) | ||
20 | SELF_PARAM@[18; 22) | ||
21 | SELF_KW@[18; 22) | ||
22 | R_PAREN@[22; 23) | ||
23 | WHITESPACE@[23; 24) | ||
24 | BLOCK_EXPR@[24; 26) | ||
25 | L_CURLY@[24; 25) | ||
26 | R_CURLY@[25; 26) | ||
27 | WHITESPACE@[26; 31) | ||
28 | FUNCTION@[31; 46) | ||
29 | FN_KW@[31; 33) | ||
30 | WHITESPACE@[33; 34) | ||
31 | NAME@[34; 35) | ||
32 | IDENT@[34; 35) "b" | ||
33 | PARAM_LIST@[35; 43) | ||
34 | L_PAREN@[35; 36) | ||
35 | SELF_PARAM@[36; 41) | ||
36 | AMP@[36; 37) | ||
37 | SELF_KW@[37; 41) | ||
38 | COMMA@[41; 42) | ||
39 | R_PAREN@[42; 43) | ||
40 | WHITESPACE@[43; 44) | ||
41 | BLOCK_EXPR@[44; 46) | ||
42 | L_CURLY@[44; 45) | ||
43 | R_CURLY@[45; 46) | ||
44 | WHITESPACE@[46; 51) | ||
45 | FUNCTION@[51; 69) | ||
46 | FN_KW@[51; 53) | ||
47 | WHITESPACE@[53; 54) | ||
48 | NAME@[54; 55) | ||
49 | IDENT@[54; 55) "c" | ||
50 | PARAM_LIST@[55; 66) | ||
51 | L_PAREN@[55; 56) | ||
52 | SELF_PARAM@[56; 64) | ||
53 | AMP@[56; 57) | ||
54 | LIFETIME@[57; 59) "'a" | ||
55 | WHITESPACE@[59; 60) | ||
56 | SELF_KW@[60; 64) | ||
57 | COMMA@[64; 65) | ||
58 | R_PAREN@[65; 66) | ||
59 | WHITESPACE@[66; 67) | ||
60 | BLOCK_EXPR@[67; 69) | ||
61 | L_CURLY@[67; 68) | ||
62 | R_CURLY@[68; 69) | ||
63 | WHITESPACE@[69; 74) | ||
64 | FUNCTION@[74; 103) | ||
65 | FN_KW@[74; 76) | ||
66 | WHITESPACE@[76; 77) | ||
67 | NAME@[77; 78) | ||
68 | IDENT@[77; 78) "d" | ||
69 | PARAM_LIST@[78; 100) | ||
70 | L_PAREN@[78; 79) | ||
71 | SELF_PARAM@[79; 91) | ||
72 | AMP@[79; 80) | ||
73 | LIFETIME@[80; 82) "'a" | ||
74 | WHITESPACE@[82; 83) | ||
75 | MUT_KW@[83; 86) | ||
76 | WHITESPACE@[86; 87) | ||
77 | SELF_KW@[87; 91) | ||
78 | COMMA@[91; 92) | ||
79 | WHITESPACE@[92; 93) | ||
80 | PARAM@[93; 99) | ||
81 | BIND_PAT@[93; 94) | ||
82 | NAME@[93; 94) | ||
83 | IDENT@[93; 94) "x" | ||
84 | COLON@[94; 95) | ||
85 | WHITESPACE@[95; 96) | ||
86 | PATH_TYPE@[96; 99) | ||
87 | PATH@[96; 99) | ||
88 | PATH_SEGMENT@[96; 99) | ||
89 | NAME_REF@[96; 99) | ||
90 | IDENT@[96; 99) "i32" | ||
91 | R_PAREN@[99; 100) | ||
92 | WHITESPACE@[100; 101) | ||
93 | BLOCK_EXPR@[101; 103) | ||
94 | L_CURLY@[101; 102) | ||
95 | R_CURLY@[102; 103) | ||
96 | WHITESPACE@[103; 104) | ||
97 | R_CURLY@[104; 105) | ||
98 | WHITESPACE@[105; 106) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0056_trait_item.rs b/crates/libsyntax2/tests/data/parser/inline/0056_trait_item.rs new file mode 100644 index 000000000..4385afca9 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0056_trait_item.rs | |||
@@ -0,0 +1 @@ | |||
trait T<U>: Hash + Clone where U: Copy {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0056_trait_item.txt b/crates/libsyntax2/tests/data/parser/inline/0056_trait_item.txt new file mode 100644 index 000000000..ba4e0ebc8 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0056_trait_item.txt | |||
@@ -0,0 +1,45 @@ | |||
1 | FILE@[0; 42) | ||
2 | TRAIT_ITEM@[0; 41) | ||
3 | TRAIT_KW@[0; 5) | ||
4 | WHITESPACE@[5; 6) | ||
5 | NAME@[6; 7) | ||
6 | IDENT@[6; 7) "T" | ||
7 | TYPE_PARAM_LIST@[7; 10) | ||
8 | L_ANGLE@[7; 8) | ||
9 | TYPE_PARAM@[8; 9) | ||
10 | NAME@[8; 9) | ||
11 | IDENT@[8; 9) "U" | ||
12 | R_ANGLE@[9; 10) | ||
13 | COLON@[10; 11) | ||
14 | WHITESPACE@[11; 12) | ||
15 | PATH@[12; 16) | ||
16 | PATH_SEGMENT@[12; 16) | ||
17 | NAME_REF@[12; 16) | ||
18 | IDENT@[12; 16) "Hash" | ||
19 | WHITESPACE@[16; 17) | ||
20 | PLUS@[17; 18) | ||
21 | WHITESPACE@[18; 19) | ||
22 | PATH@[19; 24) | ||
23 | PATH_SEGMENT@[19; 24) | ||
24 | NAME_REF@[19; 24) | ||
25 | IDENT@[19; 24) "Clone" | ||
26 | WHITESPACE@[24; 25) | ||
27 | WHERE_CLAUSE@[25; 38) | ||
28 | WHERE_KW@[25; 30) | ||
29 | WHITESPACE@[30; 31) | ||
30 | WHERE_PRED@[31; 38) | ||
31 | PATH_TYPE@[31; 32) | ||
32 | PATH@[31; 32) | ||
33 | PATH_SEGMENT@[31; 32) | ||
34 | NAME_REF@[31; 32) | ||
35 | IDENT@[31; 32) "U" | ||
36 | COLON@[32; 33) | ||
37 | WHITESPACE@[33; 34) | ||
38 | PATH@[34; 38) | ||
39 | PATH_SEGMENT@[34; 38) | ||
40 | NAME_REF@[34; 38) | ||
41 | IDENT@[34; 38) "Copy" | ||
42 | WHITESPACE@[38; 39) | ||
43 | L_CURLY@[39; 40) | ||
44 | R_CURLY@[40; 41) | ||
45 | WHITESPACE@[41; 42) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0057_auto_trait.rs b/crates/libsyntax2/tests/data/parser/inline/0057_auto_trait.rs new file mode 100644 index 000000000..72adf6035 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0057_auto_trait.rs | |||
@@ -0,0 +1 @@ | |||
auto trait T {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0057_auto_trait.txt b/crates/libsyntax2/tests/data/parser/inline/0057_auto_trait.txt new file mode 100644 index 000000000..6bb4ffdba --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0057_auto_trait.txt | |||
@@ -0,0 +1,12 @@ | |||
1 | FILE@[0; 16) | ||
2 | TRAIT_ITEM@[0; 15) | ||
3 | AUTO_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | TRAIT_KW@[5; 10) | ||
6 | WHITESPACE@[10; 11) | ||
7 | NAME@[11; 12) | ||
8 | IDENT@[11; 12) "T" | ||
9 | WHITESPACE@[12; 13) | ||
10 | L_CURLY@[13; 14) | ||
11 | R_CURLY@[14; 15) | ||
12 | WHITESPACE@[15; 16) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0058_type_arg.rs b/crates/libsyntax2/tests/data/parser/inline/0058_type_arg.rs new file mode 100644 index 000000000..f0c8cc3a8 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0058_type_arg.rs | |||
@@ -0,0 +1 @@ | |||
type A = B<'static, i32, Item=u64> | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0058_type_arg.txt b/crates/libsyntax2/tests/data/parser/inline/0058_type_arg.txt new file mode 100644 index 000000000..f69ce4738 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0058_type_arg.txt | |||
@@ -0,0 +1,40 @@ | |||
1 | FILE@[0; 35) | ||
2 | TYPE_ITEM@[0; 34) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "A" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | PATH_TYPE@[9; 34) | ||
11 | PATH@[9; 34) | ||
12 | PATH_SEGMENT@[9; 34) | ||
13 | NAME_REF@[9; 10) | ||
14 | IDENT@[9; 10) "B" | ||
15 | TYPE_ARG_LIST@[10; 34) | ||
16 | L_ANGLE@[10; 11) | ||
17 | LIFETIME_ARG@[11; 18) | ||
18 | LIFETIME@[11; 18) "'static" | ||
19 | COMMA@[18; 19) | ||
20 | WHITESPACE@[19; 20) | ||
21 | TYPE_ARG@[20; 23) | ||
22 | PATH_TYPE@[20; 23) | ||
23 | PATH@[20; 23) | ||
24 | PATH_SEGMENT@[20; 23) | ||
25 | NAME_REF@[20; 23) | ||
26 | IDENT@[20; 23) "i32" | ||
27 | COMMA@[23; 24) | ||
28 | WHITESPACE@[24; 25) | ||
29 | ASSOC_TYPE_ARG@[25; 33) | ||
30 | NAME_REF@[25; 29) | ||
31 | IDENT@[25; 29) "Item" | ||
32 | EQ@[29; 30) | ||
33 | PATH_TYPE@[30; 33) | ||
34 | PATH@[30; 33) | ||
35 | PATH_SEGMENT@[30; 33) | ||
36 | NAME_REF@[30; 33) | ||
37 | IDENT@[30; 33) "u64" | ||
38 | R_ANGLE@[33; 34) | ||
39 | err: `expected SEMI` | ||
40 | WHITESPACE@[34; 35) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0059_function_where_clause.rs b/crates/libsyntax2/tests/data/parser/inline/0059_function_where_clause.rs new file mode 100644 index 000000000..f0920b2a8 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0059_function_where_clause.rs | |||
@@ -0,0 +1 @@ | |||
fn foo<T>() where T: Copy {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0059_function_where_clause.txt b/crates/libsyntax2/tests/data/parser/inline/0059_function_where_clause.txt new file mode 100644 index 000000000..065b0fd21 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0059_function_where_clause.txt | |||
@@ -0,0 +1,36 @@ | |||
1 | FILE@[0; 29) | ||
2 | FUNCTION@[0; 28) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | TYPE_PARAM_LIST@[6; 9) | ||
8 | L_ANGLE@[6; 7) | ||
9 | TYPE_PARAM@[7; 8) | ||
10 | NAME@[7; 8) | ||
11 | IDENT@[7; 8) "T" | ||
12 | R_ANGLE@[8; 9) | ||
13 | PARAM_LIST@[9; 11) | ||
14 | L_PAREN@[9; 10) | ||
15 | R_PAREN@[10; 11) | ||
16 | WHITESPACE@[11; 12) | ||
17 | WHERE_CLAUSE@[12; 25) | ||
18 | WHERE_KW@[12; 17) | ||
19 | WHITESPACE@[17; 18) | ||
20 | WHERE_PRED@[18; 25) | ||
21 | PATH_TYPE@[18; 19) | ||
22 | PATH@[18; 19) | ||
23 | PATH_SEGMENT@[18; 19) | ||
24 | NAME_REF@[18; 19) | ||
25 | IDENT@[18; 19) "T" | ||
26 | COLON@[19; 20) | ||
27 | WHITESPACE@[20; 21) | ||
28 | PATH@[21; 25) | ||
29 | PATH_SEGMENT@[21; 25) | ||
30 | NAME_REF@[21; 25) | ||
31 | IDENT@[21; 25) "Copy" | ||
32 | WHITESPACE@[25; 26) | ||
33 | BLOCK_EXPR@[26; 28) | ||
34 | L_CURLY@[26; 27) | ||
35 | R_CURLY@[27; 28) | ||
36 | WHITESPACE@[28; 29) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0060_function_type_params.rs b/crates/libsyntax2/tests/data/parser/inline/0060_function_type_params.rs new file mode 100644 index 000000000..9df40ed39 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0060_function_type_params.rs | |||
@@ -0,0 +1 @@ | |||
fn foo<T: Clone + Copy>(){} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0060_function_type_params.txt b/crates/libsyntax2/tests/data/parser/inline/0060_function_type_params.txt new file mode 100644 index 000000000..8809ebc04 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0060_function_type_params.txt | |||
@@ -0,0 +1,32 @@ | |||
1 | FILE@[0; 28) | ||
2 | FUNCTION@[0; 27) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | TYPE_PARAM_LIST@[6; 23) | ||
8 | L_ANGLE@[6; 7) | ||
9 | TYPE_PARAM@[7; 22) | ||
10 | NAME@[7; 8) | ||
11 | IDENT@[7; 8) "T" | ||
12 | COLON@[8; 9) | ||
13 | WHITESPACE@[9; 10) | ||
14 | PATH@[10; 15) | ||
15 | PATH_SEGMENT@[10; 15) | ||
16 | NAME_REF@[10; 15) | ||
17 | IDENT@[10; 15) "Clone" | ||
18 | WHITESPACE@[15; 16) | ||
19 | PLUS@[16; 17) | ||
20 | WHITESPACE@[17; 18) | ||
21 | PATH@[18; 22) | ||
22 | PATH_SEGMENT@[18; 22) | ||
23 | NAME_REF@[18; 22) | ||
24 | IDENT@[18; 22) "Copy" | ||
25 | R_ANGLE@[22; 23) | ||
26 | PARAM_LIST@[23; 25) | ||
27 | L_PAREN@[23; 24) | ||
28 | R_PAREN@[24; 25) | ||
29 | BLOCK_EXPR@[25; 27) | ||
30 | L_CURLY@[25; 26) | ||
31 | R_CURLY@[26; 27) | ||
32 | WHITESPACE@[27; 28) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0061_struct_lit.rs b/crates/libsyntax2/tests/data/parser/inline/0061_struct_lit.rs new file mode 100644 index 000000000..eb711f68a --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0061_struct_lit.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | fn foo() { | ||
2 | S {}; | ||
3 | S { x, y: 32, }; | ||
4 | S { x, y: 32, ..Default::default() }; | ||
5 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0061_struct_lit.txt b/crates/libsyntax2/tests/data/parser/inline/0061_struct_lit.txt new file mode 100644 index 000000000..1d048c5ba --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0061_struct_lit.txt | |||
@@ -0,0 +1,94 @@ | |||
1 | FILE@[0; 86) | ||
2 | FUNCTION@[0; 85) | ||
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; 85) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 20) | ||
15 | STRUCT_LIT@[15; 19) | ||
16 | PATH@[15; 16) | ||
17 | PATH_SEGMENT@[15; 16) | ||
18 | NAME_REF@[15; 16) | ||
19 | IDENT@[15; 16) "S" | ||
20 | WHITESPACE@[16; 17) | ||
21 | L_CURLY@[17; 18) | ||
22 | R_CURLY@[18; 19) | ||
23 | SEMI@[19; 20) | ||
24 | WHITESPACE@[20; 25) | ||
25 | EXPR_STMT@[25; 41) | ||
26 | STRUCT_LIT@[25; 40) | ||
27 | PATH@[25; 26) | ||
28 | PATH_SEGMENT@[25; 26) | ||
29 | NAME_REF@[25; 26) | ||
30 | IDENT@[25; 26) "S" | ||
31 | WHITESPACE@[26; 27) | ||
32 | L_CURLY@[27; 28) | ||
33 | WHITESPACE@[28; 29) | ||
34 | STRUCT_LIT_FIELD@[29; 30) | ||
35 | NAME_REF@[29; 30) | ||
36 | IDENT@[29; 30) "x" | ||
37 | COMMA@[30; 31) | ||
38 | WHITESPACE@[31; 32) | ||
39 | STRUCT_LIT_FIELD@[32; 37) | ||
40 | NAME_REF@[32; 33) | ||
41 | IDENT@[32; 33) "y" | ||
42 | COLON@[33; 34) | ||
43 | WHITESPACE@[34; 35) | ||
44 | LITERAL@[35; 37) | ||
45 | INT_NUMBER@[35; 37) "32" | ||
46 | COMMA@[37; 38) | ||
47 | WHITESPACE@[38; 39) | ||
48 | R_CURLY@[39; 40) | ||
49 | SEMI@[40; 41) | ||
50 | WHITESPACE@[41; 46) | ||
51 | EXPR_STMT@[46; 83) | ||
52 | STRUCT_LIT@[46; 82) | ||
53 | PATH@[46; 47) | ||
54 | PATH_SEGMENT@[46; 47) | ||
55 | NAME_REF@[46; 47) | ||
56 | IDENT@[46; 47) "S" | ||
57 | WHITESPACE@[47; 48) | ||
58 | L_CURLY@[48; 49) | ||
59 | WHITESPACE@[49; 50) | ||
60 | STRUCT_LIT_FIELD@[50; 51) | ||
61 | NAME_REF@[50; 51) | ||
62 | IDENT@[50; 51) "x" | ||
63 | COMMA@[51; 52) | ||
64 | WHITESPACE@[52; 53) | ||
65 | STRUCT_LIT_FIELD@[53; 58) | ||
66 | NAME_REF@[53; 54) | ||
67 | IDENT@[53; 54) "y" | ||
68 | COLON@[54; 55) | ||
69 | WHITESPACE@[55; 56) | ||
70 | LITERAL@[56; 58) | ||
71 | INT_NUMBER@[56; 58) "32" | ||
72 | COMMA@[58; 59) | ||
73 | WHITESPACE@[59; 60) | ||
74 | DOTDOT@[60; 62) | ||
75 | CALL_EXPR@[62; 80) | ||
76 | PATH_EXPR@[62; 78) | ||
77 | PATH@[62; 78) | ||
78 | PATH@[62; 69) | ||
79 | PATH_SEGMENT@[62; 69) | ||
80 | NAME_REF@[62; 69) | ||
81 | IDENT@[62; 69) "Default" | ||
82 | COLONCOLON@[69; 71) | ||
83 | PATH_SEGMENT@[71; 78) | ||
84 | NAME_REF@[71; 78) | ||
85 | IDENT@[71; 78) "default" | ||
86 | ARG_LIST@[78; 80) | ||
87 | L_PAREN@[78; 79) | ||
88 | R_PAREN@[79; 80) | ||
89 | WHITESPACE@[80; 81) | ||
90 | R_CURLY@[81; 82) | ||
91 | SEMI@[82; 83) | ||
92 | WHITESPACE@[83; 84) | ||
93 | R_CURLY@[84; 85) | ||
94 | WHITESPACE@[85; 86) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0063_impl_trait_type.rs b/crates/libsyntax2/tests/data/parser/inline/0063_impl_trait_type.rs new file mode 100644 index 000000000..54c5a7c46 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0063_impl_trait_type.rs | |||
@@ -0,0 +1 @@ | |||
type A = impl Iterator<Item=Foo<'a>> + 'a; | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0063_impl_trait_type.txt b/crates/libsyntax2/tests/data/parser/inline/0063_impl_trait_type.txt new file mode 100644 index 000000000..bbebf1086 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0063_impl_trait_type.txt | |||
@@ -0,0 +1,39 @@ | |||
1 | FILE@[0; 43) | ||
2 | TYPE_ITEM@[0; 42) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "A" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | IMPL_TRAIT_TYPE@[9; 41) | ||
11 | IMPL_KW@[9; 13) | ||
12 | WHITESPACE@[13; 14) | ||
13 | PATH@[14; 36) | ||
14 | PATH_SEGMENT@[14; 36) | ||
15 | NAME_REF@[14; 22) | ||
16 | IDENT@[14; 22) "Iterator" | ||
17 | TYPE_ARG_LIST@[22; 36) | ||
18 | L_ANGLE@[22; 23) | ||
19 | ASSOC_TYPE_ARG@[23; 35) | ||
20 | NAME_REF@[23; 27) | ||
21 | IDENT@[23; 27) "Item" | ||
22 | EQ@[27; 28) | ||
23 | PATH_TYPE@[28; 35) | ||
24 | PATH@[28; 35) | ||
25 | PATH_SEGMENT@[28; 35) | ||
26 | NAME_REF@[28; 31) | ||
27 | IDENT@[28; 31) "Foo" | ||
28 | TYPE_ARG_LIST@[31; 35) | ||
29 | L_ANGLE@[31; 32) | ||
30 | LIFETIME_ARG@[32; 34) | ||
31 | LIFETIME@[32; 34) "'a" | ||
32 | R_ANGLE@[34; 35) | ||
33 | R_ANGLE@[35; 36) | ||
34 | WHITESPACE@[36; 37) | ||
35 | PLUS@[37; 38) | ||
36 | WHITESPACE@[38; 39) | ||
37 | LIFETIME@[39; 41) "'a" | ||
38 | SEMI@[41; 42) | ||
39 | WHITESPACE@[42; 43) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0063_lambda_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0063_lambda_expr.txt new file mode 100644 index 000000000..122a99e52 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0063_lambda_expr.txt | |||
@@ -0,0 +1,91 @@ | |||
1 | FILE@[0; 74) | ||
2 | FUNCTION@[0; 74) | ||
3 | FN_KW@[0; 2) | ||
4 | NAME@[2; 6) | ||
5 | WHITESPACE@[2; 3) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 9) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 74) | ||
12 | L_CURLY@[9; 10) | ||
13 | EXPR_STMT@[10; 26) | ||
14 | LAMBDA_EXPR@[10; 20) | ||
15 | PARAM_LIST@[10; 18) | ||
16 | WHITESPACE@[10; 15) | ||
17 | PIPE@[15; 16) | ||
18 | PIPE@[16; 17) | ||
19 | WHITESPACE@[17; 18) | ||
20 | TUPLE_EXPR@[18; 20) | ||
21 | L_PAREN@[18; 19) | ||
22 | R_PAREN@[19; 20) | ||
23 | SEMI@[20; 21) | ||
24 | WHITESPACE@[21; 26) | ||
25 | EXPR_STMT@[26; 48) | ||
26 | LAMBDA_EXPR@[26; 42) | ||
27 | PARAM_LIST@[26; 29) | ||
28 | PIPE@[26; 27) | ||
29 | PIPE@[27; 28) | ||
30 | WHITESPACE@[28; 29) | ||
31 | THIN_ARROW@[29; 31) | ||
32 | PATH_TYPE@[31; 36) | ||
33 | PATH@[31; 36) | ||
34 | PATH_SEGMENT@[31; 36) | ||
35 | NAME_REF@[31; 36) | ||
36 | WHITESPACE@[31; 32) | ||
37 | IDENT@[32; 35) "i32" | ||
38 | WHITESPACE@[35; 36) | ||
39 | BLOCK_EXPR@[36; 42) | ||
40 | L_CURLY@[36; 37) | ||
41 | LITERAL@[37; 41) | ||
42 | WHITESPACE@[37; 38) | ||
43 | INT_NUMBER@[38; 40) "92" | ||
44 | WHITESPACE@[40; 41) | ||
45 | R_CURLY@[41; 42) | ||
46 | SEMI@[42; 43) | ||
47 | WHITESPACE@[43; 48) | ||
48 | EXPR_STMT@[48; 59) | ||
49 | LAMBDA_EXPR@[48; 53) | ||
50 | PARAM_LIST@[48; 52) | ||
51 | PIPE@[48; 49) | ||
52 | PARAM@[49; 50) | ||
53 | BIND_PAT@[49; 50) | ||
54 | NAME@[49; 50) | ||
55 | IDENT@[49; 50) "x" | ||
56 | PIPE@[50; 51) | ||
57 | WHITESPACE@[51; 52) | ||
58 | PATH_EXPR@[52; 53) | ||
59 | PATH@[52; 53) | ||
60 | PATH_SEGMENT@[52; 53) | ||
61 | NAME_REF@[52; 53) | ||
62 | IDENT@[52; 53) "x" | ||
63 | SEMI@[53; 54) | ||
64 | WHITESPACE@[54; 59) | ||
65 | EXPR_STMT@[59; 72) | ||
66 | LAMBDA_EXPR@[59; 70) | ||
67 | PARAM_LIST@[59; 69) | ||
68 | PIPE@[59; 60) | ||
69 | PARAM@[60; 66) | ||
70 | BIND_PAT@[60; 61) | ||
71 | NAME@[60; 61) | ||
72 | IDENT@[60; 61) "x" | ||
73 | COLON@[61; 62) | ||
74 | PATH_TYPE@[62; 66) | ||
75 | PATH@[62; 66) | ||
76 | PATH_SEGMENT@[62; 66) | ||
77 | NAME_REF@[62; 66) | ||
78 | WHITESPACE@[62; 63) | ||
79 | IDENT@[63; 66) "i32" | ||
80 | COMMA@[66; 67) | ||
81 | PIPE@[67; 68) | ||
82 | WHITESPACE@[68; 69) | ||
83 | PATH_EXPR@[69; 70) | ||
84 | PATH@[69; 70) | ||
85 | PATH_SEGMENT@[69; 70) | ||
86 | NAME_REF@[69; 70) | ||
87 | IDENT@[69; 70) "x" | ||
88 | SEMI@[70; 71) | ||
89 | WHITESPACE@[71; 72) | ||
90 | R_CURLY@[72; 73) | ||
91 | WHITESPACE@[73; 74) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0064_param_list.rs b/crates/libsyntax2/tests/data/parser/inline/0064_param_list.rs new file mode 100644 index 000000000..9d55bedbb --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0064_param_list.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn a() {} | ||
2 | fn b(x: i32) {} | ||
3 | fn c(x: i32, ) {} | ||
4 | fn d(x: i32, y: ()) {} | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0064_param_list.txt b/crates/libsyntax2/tests/data/parser/inline/0064_param_list.txt new file mode 100644 index 000000000..14db495b9 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0064_param_list.txt | |||
@@ -0,0 +1,99 @@ | |||
1 | FILE@[0; 67) | ||
2 | FUNCTION@[0; 9) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 4) | ||
6 | IDENT@[3; 4) "a" | ||
7 | PARAM_LIST@[4; 6) | ||
8 | L_PAREN@[4; 5) | ||
9 | R_PAREN@[5; 6) | ||
10 | WHITESPACE@[6; 7) | ||
11 | BLOCK_EXPR@[7; 9) | ||
12 | L_CURLY@[7; 8) | ||
13 | R_CURLY@[8; 9) | ||
14 | WHITESPACE@[9; 10) | ||
15 | FUNCTION@[10; 25) | ||
16 | FN_KW@[10; 12) | ||
17 | WHITESPACE@[12; 13) | ||
18 | NAME@[13; 14) | ||
19 | IDENT@[13; 14) "b" | ||
20 | PARAM_LIST@[14; 22) | ||
21 | L_PAREN@[14; 15) | ||
22 | PARAM@[15; 21) | ||
23 | BIND_PAT@[15; 16) | ||
24 | NAME@[15; 16) | ||
25 | IDENT@[15; 16) "x" | ||
26 | COLON@[16; 17) | ||
27 | WHITESPACE@[17; 18) | ||
28 | PATH_TYPE@[18; 21) | ||
29 | PATH@[18; 21) | ||
30 | PATH_SEGMENT@[18; 21) | ||
31 | NAME_REF@[18; 21) | ||
32 | IDENT@[18; 21) "i32" | ||
33 | R_PAREN@[21; 22) | ||
34 | WHITESPACE@[22; 23) | ||
35 | BLOCK_EXPR@[23; 25) | ||
36 | L_CURLY@[23; 24) | ||
37 | R_CURLY@[24; 25) | ||
38 | WHITESPACE@[25; 26) | ||
39 | FUNCTION@[26; 43) | ||
40 | FN_KW@[26; 28) | ||
41 | WHITESPACE@[28; 29) | ||
42 | NAME@[29; 30) | ||
43 | IDENT@[29; 30) "c" | ||
44 | PARAM_LIST@[30; 40) | ||
45 | L_PAREN@[30; 31) | ||
46 | PARAM@[31; 37) | ||
47 | BIND_PAT@[31; 32) | ||
48 | NAME@[31; 32) | ||
49 | IDENT@[31; 32) "x" | ||
50 | COLON@[32; 33) | ||
51 | WHITESPACE@[33; 34) | ||
52 | PATH_TYPE@[34; 37) | ||
53 | PATH@[34; 37) | ||
54 | PATH_SEGMENT@[34; 37) | ||
55 | NAME_REF@[34; 37) | ||
56 | IDENT@[34; 37) "i32" | ||
57 | COMMA@[37; 38) | ||
58 | WHITESPACE@[38; 39) | ||
59 | R_PAREN@[39; 40) | ||
60 | WHITESPACE@[40; 41) | ||
61 | BLOCK_EXPR@[41; 43) | ||
62 | L_CURLY@[41; 42) | ||
63 | R_CURLY@[42; 43) | ||
64 | WHITESPACE@[43; 44) | ||
65 | FUNCTION@[44; 66) | ||
66 | FN_KW@[44; 46) | ||
67 | WHITESPACE@[46; 47) | ||
68 | NAME@[47; 48) | ||
69 | IDENT@[47; 48) "d" | ||
70 | PARAM_LIST@[48; 63) | ||
71 | L_PAREN@[48; 49) | ||
72 | PARAM@[49; 55) | ||
73 | BIND_PAT@[49; 50) | ||
74 | NAME@[49; 50) | ||
75 | IDENT@[49; 50) "x" | ||
76 | COLON@[50; 51) | ||
77 | WHITESPACE@[51; 52) | ||
78 | PATH_TYPE@[52; 55) | ||
79 | PATH@[52; 55) | ||
80 | PATH_SEGMENT@[52; 55) | ||
81 | NAME_REF@[52; 55) | ||
82 | IDENT@[52; 55) "i32" | ||
83 | COMMA@[55; 56) | ||
84 | WHITESPACE@[56; 57) | ||
85 | PARAM@[57; 62) | ||
86 | BIND_PAT@[57; 58) | ||
87 | NAME@[57; 58) | ||
88 | IDENT@[57; 58) "y" | ||
89 | COLON@[58; 59) | ||
90 | WHITESPACE@[59; 60) | ||
91 | TUPLE_TYPE@[60; 62) | ||
92 | L_PAREN@[60; 61) | ||
93 | R_PAREN@[61; 62) | ||
94 | R_PAREN@[62; 63) | ||
95 | WHITESPACE@[63; 64) | ||
96 | BLOCK_EXPR@[64; 66) | ||
97 | L_CURLY@[64; 65) | ||
98 | R_CURLY@[65; 66) | ||
99 | WHITESPACE@[66; 67) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0065_if_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0065_if_expr.rs new file mode 100644 index 000000000..4b0d9af89 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0065_if_expr.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | if true {}; | ||
3 | if true {} else {}; | ||
4 | if true {} else if false {} else {}; | ||
5 | if S {}; | ||
6 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0065_if_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0065_if_expr.txt new file mode 100644 index 000000000..6ed53264a --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0065_if_expr.txt | |||
@@ -0,0 +1,90 @@ | |||
1 | FILE@[0; 107) | ||
2 | FUNCTION@[0; 106) | ||
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; 106) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 26) | ||
15 | IF_EXPR@[15; 25) | ||
16 | IF_KW@[15; 17) | ||
17 | WHITESPACE@[17; 18) | ||
18 | LITERAL@[18; 22) | ||
19 | TRUE_KW@[18; 22) | ||
20 | WHITESPACE@[22; 23) | ||
21 | BLOCK_EXPR@[23; 25) | ||
22 | L_CURLY@[23; 24) | ||
23 | R_CURLY@[24; 25) | ||
24 | SEMI@[25; 26) | ||
25 | WHITESPACE@[26; 31) | ||
26 | EXPR_STMT@[31; 50) | ||
27 | IF_EXPR@[31; 49) | ||
28 | IF_KW@[31; 33) | ||
29 | WHITESPACE@[33; 34) | ||
30 | LITERAL@[34; 38) | ||
31 | TRUE_KW@[34; 38) | ||
32 | WHITESPACE@[38; 39) | ||
33 | BLOCK_EXPR@[39; 41) | ||
34 | L_CURLY@[39; 40) | ||
35 | R_CURLY@[40; 41) | ||
36 | WHITESPACE@[41; 42) | ||
37 | ELSE_KW@[42; 46) | ||
38 | WHITESPACE@[46; 47) | ||
39 | BLOCK_EXPR@[47; 49) | ||
40 | L_CURLY@[47; 48) | ||
41 | R_CURLY@[48; 49) | ||
42 | SEMI@[49; 50) | ||
43 | WHITESPACE@[50; 55) | ||
44 | EXPR_STMT@[55; 91) | ||
45 | IF_EXPR@[55; 90) | ||
46 | IF_KW@[55; 57) | ||
47 | WHITESPACE@[57; 58) | ||
48 | LITERAL@[58; 62) | ||
49 | TRUE_KW@[58; 62) | ||
50 | WHITESPACE@[62; 63) | ||
51 | BLOCK_EXPR@[63; 65) | ||
52 | L_CURLY@[63; 64) | ||
53 | R_CURLY@[64; 65) | ||
54 | WHITESPACE@[65; 66) | ||
55 | ELSE_KW@[66; 70) | ||
56 | WHITESPACE@[70; 71) | ||
57 | IF_EXPR@[71; 90) | ||
58 | IF_KW@[71; 73) | ||
59 | WHITESPACE@[73; 74) | ||
60 | LITERAL@[74; 79) | ||
61 | FALSE_KW@[74; 79) | ||
62 | WHITESPACE@[79; 80) | ||
63 | BLOCK_EXPR@[80; 82) | ||
64 | L_CURLY@[80; 81) | ||
65 | R_CURLY@[81; 82) | ||
66 | WHITESPACE@[82; 83) | ||
67 | ELSE_KW@[83; 87) | ||
68 | WHITESPACE@[87; 88) | ||
69 | BLOCK_EXPR@[88; 90) | ||
70 | L_CURLY@[88; 89) | ||
71 | R_CURLY@[89; 90) | ||
72 | SEMI@[90; 91) | ||
73 | WHITESPACE@[91; 96) | ||
74 | EXPR_STMT@[96; 104) | ||
75 | IF_EXPR@[96; 103) | ||
76 | IF_KW@[96; 98) | ||
77 | WHITESPACE@[98; 99) | ||
78 | PATH_EXPR@[99; 100) | ||
79 | PATH@[99; 100) | ||
80 | PATH_SEGMENT@[99; 100) | ||
81 | NAME_REF@[99; 100) | ||
82 | IDENT@[99; 100) "S" | ||
83 | WHITESPACE@[100; 101) | ||
84 | BLOCK_EXPR@[101; 103) | ||
85 | L_CURLY@[101; 102) | ||
86 | R_CURLY@[102; 103) | ||
87 | SEMI@[103; 104) | ||
88 | WHITESPACE@[104; 105) | ||
89 | R_CURLY@[105; 106) | ||
90 | WHITESPACE@[106; 107) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0066_lambda_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0066_lambda_expr.rs new file mode 100644 index 000000000..c20d29751 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0066_lambda_expr.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | || (); | ||
3 | || -> i32 { 92 }; | ||
4 | |x| x; | ||
5 | move |x: i32,| x; | ||
6 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0066_lambda_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0066_lambda_expr.txt new file mode 100644 index 000000000..6d9aeb331 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0066_lambda_expr.txt | |||
@@ -0,0 +1,93 @@ | |||
1 | FILE@[0; 79) | ||
2 | FUNCTION@[0; 78) | ||
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; 78) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 21) | ||
15 | LAMBDA_EXPR@[15; 20) | ||
16 | PARAM_LIST@[15; 17) | ||
17 | PIPE@[15; 16) | ||
18 | PIPE@[16; 17) | ||
19 | WHITESPACE@[17; 18) | ||
20 | TUPLE_EXPR@[18; 20) | ||
21 | L_PAREN@[18; 19) | ||
22 | R_PAREN@[19; 20) | ||
23 | SEMI@[20; 21) | ||
24 | WHITESPACE@[21; 26) | ||
25 | EXPR_STMT@[26; 43) | ||
26 | LAMBDA_EXPR@[26; 42) | ||
27 | PARAM_LIST@[26; 28) | ||
28 | PIPE@[26; 27) | ||
29 | PIPE@[27; 28) | ||
30 | WHITESPACE@[28; 29) | ||
31 | THIN_ARROW@[29; 31) | ||
32 | WHITESPACE@[31; 32) | ||
33 | PATH_TYPE@[32; 35) | ||
34 | PATH@[32; 35) | ||
35 | PATH_SEGMENT@[32; 35) | ||
36 | NAME_REF@[32; 35) | ||
37 | IDENT@[32; 35) "i32" | ||
38 | WHITESPACE@[35; 36) | ||
39 | BLOCK_EXPR@[36; 42) | ||
40 | L_CURLY@[36; 37) | ||
41 | WHITESPACE@[37; 38) | ||
42 | LITERAL@[38; 40) | ||
43 | INT_NUMBER@[38; 40) "92" | ||
44 | WHITESPACE@[40; 41) | ||
45 | R_CURLY@[41; 42) | ||
46 | SEMI@[42; 43) | ||
47 | WHITESPACE@[43; 48) | ||
48 | EXPR_STMT@[48; 54) | ||
49 | LAMBDA_EXPR@[48; 53) | ||
50 | PARAM_LIST@[48; 51) | ||
51 | PIPE@[48; 49) | ||
52 | PARAM@[49; 50) | ||
53 | BIND_PAT@[49; 50) | ||
54 | NAME@[49; 50) | ||
55 | IDENT@[49; 50) "x" | ||
56 | PIPE@[50; 51) | ||
57 | WHITESPACE@[51; 52) | ||
58 | PATH_EXPR@[52; 53) | ||
59 | PATH@[52; 53) | ||
60 | PATH_SEGMENT@[52; 53) | ||
61 | NAME_REF@[52; 53) | ||
62 | IDENT@[52; 53) "x" | ||
63 | SEMI@[53; 54) | ||
64 | WHITESPACE@[54; 59) | ||
65 | EXPR_STMT@[59; 76) | ||
66 | LAMBDA_EXPR@[59; 75) | ||
67 | MOVE_KW@[59; 63) | ||
68 | WHITESPACE@[63; 64) | ||
69 | PARAM_LIST@[64; 73) | ||
70 | PIPE@[64; 65) | ||
71 | PARAM@[65; 71) | ||
72 | BIND_PAT@[65; 66) | ||
73 | NAME@[65; 66) | ||
74 | IDENT@[65; 66) "x" | ||
75 | COLON@[66; 67) | ||
76 | WHITESPACE@[67; 68) | ||
77 | PATH_TYPE@[68; 71) | ||
78 | PATH@[68; 71) | ||
79 | PATH_SEGMENT@[68; 71) | ||
80 | NAME_REF@[68; 71) | ||
81 | IDENT@[68; 71) "i32" | ||
82 | COMMA@[71; 72) | ||
83 | PIPE@[72; 73) | ||
84 | WHITESPACE@[73; 74) | ||
85 | PATH_EXPR@[74; 75) | ||
86 | PATH@[74; 75) | ||
87 | PATH_SEGMENT@[74; 75) | ||
88 | NAME_REF@[74; 75) | ||
89 | IDENT@[74; 75) "x" | ||
90 | SEMI@[75; 76) | ||
91 | WHITESPACE@[76; 77) | ||
92 | R_CURLY@[77; 78) | ||
93 | WHITESPACE@[78; 79) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0067_block_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0067_block_expr.rs new file mode 100644 index 000000000..ec3780a04 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0067_block_expr.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | {}; | ||
3 | unsafe {}; | ||
4 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0067_block_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0067_block_expr.txt new file mode 100644 index 000000000..981f39e6e --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0067_block_expr.txt | |||
@@ -0,0 +1,29 @@ | |||
1 | FILE@[0; 36) | ||
2 | FUNCTION@[0; 35) | ||
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; 35) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 18) | ||
15 | BLOCK_EXPR@[15; 17) | ||
16 | L_CURLY@[15; 16) | ||
17 | R_CURLY@[16; 17) | ||
18 | SEMI@[17; 18) | ||
19 | WHITESPACE@[18; 23) | ||
20 | EXPR_STMT@[23; 33) | ||
21 | BLOCK_EXPR@[23; 32) | ||
22 | UNSAFE_KW@[23; 29) | ||
23 | WHITESPACE@[29; 30) | ||
24 | L_CURLY@[30; 31) | ||
25 | R_CURLY@[31; 32) | ||
26 | SEMI@[32; 33) | ||
27 | WHITESPACE@[33; 34) | ||
28 | R_CURLY@[34; 35) | ||
29 | WHITESPACE@[35; 36) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0068_pub_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0068_pub_expr.rs new file mode 100644 index 000000000..d9d99d2d3 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0068_pub_expr.rs | |||
@@ -0,0 +1 @@ | |||
fn foo() { pub 92; } //FIXME | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0068_pub_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0068_pub_expr.txt new file mode 100644 index 000000000..92e58938b --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0068_pub_expr.txt | |||
@@ -0,0 +1,25 @@ | |||
1 | FILE@[0; 29) | ||
2 | FUNCTION@[0; 20) | ||
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; 20) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 11) | ||
14 | EXPR_STMT@[11; 18) | ||
15 | VISIBILITY@[11; 14) | ||
16 | PUB_KW@[11; 14) | ||
17 | WHITESPACE@[14; 15) | ||
18 | LITERAL@[15; 17) | ||
19 | INT_NUMBER@[15; 17) "92" | ||
20 | SEMI@[17; 18) | ||
21 | WHITESPACE@[18; 19) | ||
22 | R_CURLY@[19; 20) | ||
23 | WHITESPACE@[20; 21) | ||
24 | COMMENT@[21; 28) | ||
25 | WHITESPACE@[28; 29) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0068_return_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0068_return_expr.rs new file mode 100644 index 000000000..5733666b6 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0068_return_expr.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | return; | ||
3 | return 92; | ||
4 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0068_return_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0068_return_expr.txt new file mode 100644 index 000000000..4e4ec85b6 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0068_return_expr.txt | |||
@@ -0,0 +1,28 @@ | |||
1 | FILE@[0; 40) | ||
2 | FUNCTION@[0; 39) | ||
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; 39) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 22) | ||
15 | RETURN_EXPR@[15; 21) | ||
16 | RETURN_KW@[15; 21) | ||
17 | SEMI@[21; 22) | ||
18 | WHITESPACE@[22; 27) | ||
19 | EXPR_STMT@[27; 37) | ||
20 | RETURN_EXPR@[27; 36) | ||
21 | RETURN_KW@[27; 33) | ||
22 | WHITESPACE@[33; 34) | ||
23 | LITERAL@[34; 36) | ||
24 | INT_NUMBER@[34; 36) "92" | ||
25 | SEMI@[36; 37) | ||
26 | WHITESPACE@[37; 38) | ||
27 | R_CURLY@[38; 39) | ||
28 | WHITESPACE@[39; 40) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0069_match_arm.rs b/crates/libsyntax2/tests/data/parser/inline/0069_match_arm.rs new file mode 100644 index 000000000..2c0e88414 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0069_match_arm.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | match () { | ||
3 | _ => (), | ||
4 | X | Y if Z => (), | ||
5 | }; | ||
6 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0069_match_arm.txt b/crates/libsyntax2/tests/data/parser/inline/0069_match_arm.txt new file mode 100644 index 000000000..3377e8342 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0069_match_arm.txt | |||
@@ -0,0 +1,65 @@ | |||
1 | FILE@[0; 78) | ||
2 | FUNCTION@[0; 77) | ||
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; 77) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 75) | ||
15 | MATCH_EXPR@[15; 74) | ||
16 | MATCH_KW@[15; 20) | ||
17 | WHITESPACE@[20; 21) | ||
18 | TUPLE_EXPR@[21; 23) | ||
19 | L_PAREN@[21; 22) | ||
20 | R_PAREN@[22; 23) | ||
21 | WHITESPACE@[23; 24) | ||
22 | L_CURLY@[24; 25) | ||
23 | WHITESPACE@[25; 34) | ||
24 | MATCH_ARM@[34; 41) | ||
25 | PLACEHOLDER_PAT@[34; 35) | ||
26 | UNDERSCORE@[34; 35) | ||
27 | WHITESPACE@[35; 36) | ||
28 | FAT_ARROW@[36; 38) | ||
29 | WHITESPACE@[38; 39) | ||
30 | TUPLE_EXPR@[39; 41) | ||
31 | L_PAREN@[39; 40) | ||
32 | R_PAREN@[40; 41) | ||
33 | COMMA@[41; 42) | ||
34 | WHITESPACE@[42; 51) | ||
35 | MATCH_ARM@[51; 67) | ||
36 | BIND_PAT@[51; 52) | ||
37 | NAME@[51; 52) | ||
38 | IDENT@[51; 52) "X" | ||
39 | WHITESPACE@[52; 53) | ||
40 | PIPE@[53; 54) | ||
41 | WHITESPACE@[54; 55) | ||
42 | BIND_PAT@[55; 56) | ||
43 | NAME@[55; 56) | ||
44 | IDENT@[55; 56) "Y" | ||
45 | WHITESPACE@[56; 57) | ||
46 | IF_KW@[57; 59) | ||
47 | WHITESPACE@[59; 60) | ||
48 | PATH_EXPR@[60; 61) | ||
49 | PATH@[60; 61) | ||
50 | PATH_SEGMENT@[60; 61) | ||
51 | NAME_REF@[60; 61) | ||
52 | IDENT@[60; 61) "Z" | ||
53 | WHITESPACE@[61; 62) | ||
54 | FAT_ARROW@[62; 64) | ||
55 | WHITESPACE@[64; 65) | ||
56 | TUPLE_EXPR@[65; 67) | ||
57 | L_PAREN@[65; 66) | ||
58 | R_PAREN@[66; 67) | ||
59 | COMMA@[67; 68) | ||
60 | WHITESPACE@[68; 73) | ||
61 | R_CURLY@[73; 74) | ||
62 | SEMI@[74; 75) | ||
63 | WHITESPACE@[75; 76) | ||
64 | R_CURLY@[76; 77) | ||
65 | WHITESPACE@[77; 78) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0070_match_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0070_match_expr.rs new file mode 100644 index 000000000..c9205dfa3 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0070_match_expr.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | match () { }; | ||
3 | match S {}; | ||
4 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0070_match_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0070_match_expr.txt new file mode 100644 index 000000000..f9ba54486 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0070_match_expr.txt | |||
@@ -0,0 +1,42 @@ | |||
1 | FILE@[0; 47) | ||
2 | FUNCTION@[0; 46) | ||
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; 46) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 28) | ||
15 | MATCH_EXPR@[15; 27) | ||
16 | MATCH_KW@[15; 20) | ||
17 | WHITESPACE@[20; 21) | ||
18 | TUPLE_EXPR@[21; 23) | ||
19 | L_PAREN@[21; 22) | ||
20 | R_PAREN@[22; 23) | ||
21 | WHITESPACE@[23; 24) | ||
22 | L_CURLY@[24; 25) | ||
23 | WHITESPACE@[25; 26) | ||
24 | R_CURLY@[26; 27) | ||
25 | SEMI@[27; 28) | ||
26 | WHITESPACE@[28; 33) | ||
27 | EXPR_STMT@[33; 44) | ||
28 | MATCH_EXPR@[33; 43) | ||
29 | MATCH_KW@[33; 38) | ||
30 | WHITESPACE@[38; 39) | ||
31 | PATH_EXPR@[39; 40) | ||
32 | PATH@[39; 40) | ||
33 | PATH_SEGMENT@[39; 40) | ||
34 | NAME_REF@[39; 40) | ||
35 | IDENT@[39; 40) "S" | ||
36 | WHITESPACE@[40; 41) | ||
37 | L_CURLY@[41; 42) | ||
38 | R_CURLY@[42; 43) | ||
39 | SEMI@[43; 44) | ||
40 | WHITESPACE@[44; 45) | ||
41 | R_CURLY@[45; 46) | ||
42 | WHITESPACE@[46; 47) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0071_tuple_pat_fields.rs b/crates/libsyntax2/tests/data/parser/inline/0071_tuple_pat_fields.rs new file mode 100644 index 000000000..0dfe63629 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0071_tuple_pat_fields.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | let S() = (); | ||
3 | let S(_) = (); | ||
4 | let S(_,) = (); | ||
5 | let S(_, .. , x) = (); | ||
6 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0071_tuple_pat_fields.txt b/crates/libsyntax2/tests/data/parser/inline/0071_tuple_pat_fields.txt new file mode 100644 index 000000000..f54835277 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0071_tuple_pat_fields.txt | |||
@@ -0,0 +1,103 @@ | |||
1 | FILE@[0; 97) | ||
2 | FUNCTION@[0; 96) | ||
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; 96) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | LET_STMT@[15; 28) | ||
15 | LET_KW@[15; 18) | ||
16 | WHITESPACE@[18; 19) | ||
17 | TUPLE_STRUCT_PAT@[19; 22) | ||
18 | PATH@[19; 20) | ||
19 | PATH_SEGMENT@[19; 20) | ||
20 | NAME_REF@[19; 20) | ||
21 | IDENT@[19; 20) "S" | ||
22 | L_PAREN@[20; 21) | ||
23 | R_PAREN@[21; 22) | ||
24 | WHITESPACE@[22; 23) | ||
25 | EQ@[23; 24) | ||
26 | WHITESPACE@[24; 25) | ||
27 | TUPLE_EXPR@[25; 27) | ||
28 | L_PAREN@[25; 26) | ||
29 | R_PAREN@[26; 27) | ||
30 | SEMI@[27; 28) | ||
31 | WHITESPACE@[28; 33) | ||
32 | LET_STMT@[33; 47) | ||
33 | LET_KW@[33; 36) | ||
34 | WHITESPACE@[36; 37) | ||
35 | TUPLE_STRUCT_PAT@[37; 41) | ||
36 | PATH@[37; 38) | ||
37 | PATH_SEGMENT@[37; 38) | ||
38 | NAME_REF@[37; 38) | ||
39 | IDENT@[37; 38) "S" | ||
40 | L_PAREN@[38; 39) | ||
41 | PLACEHOLDER_PAT@[39; 40) | ||
42 | UNDERSCORE@[39; 40) | ||
43 | R_PAREN@[40; 41) | ||
44 | WHITESPACE@[41; 42) | ||
45 | EQ@[42; 43) | ||
46 | WHITESPACE@[43; 44) | ||
47 | TUPLE_EXPR@[44; 46) | ||
48 | L_PAREN@[44; 45) | ||
49 | R_PAREN@[45; 46) | ||
50 | SEMI@[46; 47) | ||
51 | WHITESPACE@[47; 52) | ||
52 | LET_STMT@[52; 67) | ||
53 | LET_KW@[52; 55) | ||
54 | WHITESPACE@[55; 56) | ||
55 | TUPLE_STRUCT_PAT@[56; 61) | ||
56 | PATH@[56; 57) | ||
57 | PATH_SEGMENT@[56; 57) | ||
58 | NAME_REF@[56; 57) | ||
59 | IDENT@[56; 57) "S" | ||
60 | L_PAREN@[57; 58) | ||
61 | PLACEHOLDER_PAT@[58; 59) | ||
62 | UNDERSCORE@[58; 59) | ||
63 | COMMA@[59; 60) | ||
64 | R_PAREN@[60; 61) | ||
65 | WHITESPACE@[61; 62) | ||
66 | EQ@[62; 63) | ||
67 | WHITESPACE@[63; 64) | ||
68 | TUPLE_EXPR@[64; 66) | ||
69 | L_PAREN@[64; 65) | ||
70 | R_PAREN@[65; 66) | ||
71 | SEMI@[66; 67) | ||
72 | WHITESPACE@[67; 72) | ||
73 | LET_STMT@[72; 94) | ||
74 | LET_KW@[72; 75) | ||
75 | WHITESPACE@[75; 76) | ||
76 | TUPLE_STRUCT_PAT@[76; 88) | ||
77 | PATH@[76; 77) | ||
78 | PATH_SEGMENT@[76; 77) | ||
79 | NAME_REF@[76; 77) | ||
80 | IDENT@[76; 77) "S" | ||
81 | L_PAREN@[77; 78) | ||
82 | PLACEHOLDER_PAT@[78; 79) | ||
83 | UNDERSCORE@[78; 79) | ||
84 | COMMA@[79; 80) | ||
85 | WHITESPACE@[80; 81) | ||
86 | DOTDOT@[81; 83) | ||
87 | WHITESPACE@[83; 84) | ||
88 | COMMA@[84; 85) | ||
89 | WHITESPACE@[85; 86) | ||
90 | BIND_PAT@[86; 87) | ||
91 | NAME@[86; 87) | ||
92 | IDENT@[86; 87) "x" | ||
93 | R_PAREN@[87; 88) | ||
94 | WHITESPACE@[88; 89) | ||
95 | EQ@[89; 90) | ||
96 | WHITESPACE@[90; 91) | ||
97 | TUPLE_EXPR@[91; 93) | ||
98 | L_PAREN@[91; 92) | ||
99 | R_PAREN@[92; 93) | ||
100 | SEMI@[93; 94) | ||
101 | WHITESPACE@[94; 95) | ||
102 | R_CURLY@[95; 96) | ||
103 | WHITESPACE@[96; 97) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0072_path_part.rs b/crates/libsyntax2/tests/data/parser/inline/0072_path_part.rs new file mode 100644 index 000000000..f6e32c7c1 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0072_path_part.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | let foo::Bar = (); | ||
3 | let ::Bar = (); | ||
4 | let Bar { .. } = (); | ||
5 | let Bar(..) = (); | ||
6 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0072_path_part.txt b/crates/libsyntax2/tests/data/parser/inline/0072_path_part.txt new file mode 100644 index 000000000..20da5de86 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0072_path_part.txt | |||
@@ -0,0 +1,94 @@ | |||
1 | FILE@[0; 103) | ||
2 | FUNCTION@[0; 102) | ||
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; 102) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | LET_STMT@[15; 33) | ||
15 | LET_KW@[15; 18) | ||
16 | WHITESPACE@[18; 19) | ||
17 | PATH_PAT@[19; 27) | ||
18 | PATH@[19; 27) | ||
19 | PATH@[19; 22) | ||
20 | PATH_SEGMENT@[19; 22) | ||
21 | NAME_REF@[19; 22) | ||
22 | IDENT@[19; 22) "foo" | ||
23 | COLONCOLON@[22; 24) | ||
24 | PATH_SEGMENT@[24; 27) | ||
25 | NAME_REF@[24; 27) | ||
26 | IDENT@[24; 27) "Bar" | ||
27 | WHITESPACE@[27; 28) | ||
28 | EQ@[28; 29) | ||
29 | WHITESPACE@[29; 30) | ||
30 | TUPLE_EXPR@[30; 32) | ||
31 | L_PAREN@[30; 31) | ||
32 | R_PAREN@[31; 32) | ||
33 | SEMI@[32; 33) | ||
34 | WHITESPACE@[33; 38) | ||
35 | LET_STMT@[38; 53) | ||
36 | LET_KW@[38; 41) | ||
37 | WHITESPACE@[41; 42) | ||
38 | PATH_PAT@[42; 47) | ||
39 | PATH@[42; 47) | ||
40 | PATH_SEGMENT@[42; 47) | ||
41 | COLONCOLON@[42; 44) | ||
42 | NAME_REF@[44; 47) | ||
43 | IDENT@[44; 47) "Bar" | ||
44 | WHITESPACE@[47; 48) | ||
45 | EQ@[48; 49) | ||
46 | WHITESPACE@[49; 50) | ||
47 | TUPLE_EXPR@[50; 52) | ||
48 | L_PAREN@[50; 51) | ||
49 | R_PAREN@[51; 52) | ||
50 | SEMI@[52; 53) | ||
51 | WHITESPACE@[53; 58) | ||
52 | LET_STMT@[58; 78) | ||
53 | LET_KW@[58; 61) | ||
54 | WHITESPACE@[61; 62) | ||
55 | STRUCT_PAT@[62; 72) | ||
56 | PATH@[62; 65) | ||
57 | PATH_SEGMENT@[62; 65) | ||
58 | NAME_REF@[62; 65) | ||
59 | IDENT@[62; 65) "Bar" | ||
60 | WHITESPACE@[65; 66) | ||
61 | L_CURLY@[66; 67) | ||
62 | WHITESPACE@[67; 68) | ||
63 | DOTDOT@[68; 70) | ||
64 | WHITESPACE@[70; 71) | ||
65 | R_CURLY@[71; 72) | ||
66 | WHITESPACE@[72; 73) | ||
67 | EQ@[73; 74) | ||
68 | WHITESPACE@[74; 75) | ||
69 | TUPLE_EXPR@[75; 77) | ||
70 | L_PAREN@[75; 76) | ||
71 | R_PAREN@[76; 77) | ||
72 | SEMI@[77; 78) | ||
73 | WHITESPACE@[78; 83) | ||
74 | LET_STMT@[83; 100) | ||
75 | LET_KW@[83; 86) | ||
76 | WHITESPACE@[86; 87) | ||
77 | TUPLE_STRUCT_PAT@[87; 94) | ||
78 | PATH@[87; 90) | ||
79 | PATH_SEGMENT@[87; 90) | ||
80 | NAME_REF@[87; 90) | ||
81 | IDENT@[87; 90) "Bar" | ||
82 | L_PAREN@[90; 91) | ||
83 | DOTDOT@[91; 93) | ||
84 | R_PAREN@[93; 94) | ||
85 | WHITESPACE@[94; 95) | ||
86 | EQ@[95; 96) | ||
87 | WHITESPACE@[96; 97) | ||
88 | TUPLE_EXPR@[97; 99) | ||
89 | L_PAREN@[97; 98) | ||
90 | R_PAREN@[98; 99) | ||
91 | SEMI@[99; 100) | ||
92 | WHITESPACE@[100; 101) | ||
93 | R_CURLY@[101; 102) | ||
94 | WHITESPACE@[102; 103) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0073_struct_pat_fields.rs b/crates/libsyntax2/tests/data/parser/inline/0073_struct_pat_fields.rs new file mode 100644 index 000000000..da3412fa8 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0073_struct_pat_fields.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | let S {} = (); | ||
3 | let S { f, ref mut g } = (); | ||
4 | let S { h: _, ..} = (); | ||
5 | let S { h: _, } = (); | ||
6 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0073_struct_pat_fields.txt b/crates/libsyntax2/tests/data/parser/inline/0073_struct_pat_fields.txt new file mode 100644 index 000000000..fc0d44f7a --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0073_struct_pat_fields.txt | |||
@@ -0,0 +1,122 @@ | |||
1 | FILE@[0; 119) | ||
2 | FUNCTION@[0; 118) | ||
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; 118) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | LET_STMT@[15; 29) | ||
15 | LET_KW@[15; 18) | ||
16 | WHITESPACE@[18; 19) | ||
17 | STRUCT_PAT@[19; 23) | ||
18 | PATH@[19; 20) | ||
19 | PATH_SEGMENT@[19; 20) | ||
20 | NAME_REF@[19; 20) | ||
21 | IDENT@[19; 20) "S" | ||
22 | WHITESPACE@[20; 21) | ||
23 | L_CURLY@[21; 22) | ||
24 | R_CURLY@[22; 23) | ||
25 | WHITESPACE@[23; 24) | ||
26 | EQ@[24; 25) | ||
27 | WHITESPACE@[25; 26) | ||
28 | TUPLE_EXPR@[26; 28) | ||
29 | L_PAREN@[26; 27) | ||
30 | R_PAREN@[27; 28) | ||
31 | SEMI@[28; 29) | ||
32 | WHITESPACE@[29; 34) | ||
33 | LET_STMT@[34; 62) | ||
34 | LET_KW@[34; 37) | ||
35 | WHITESPACE@[37; 38) | ||
36 | STRUCT_PAT@[38; 56) | ||
37 | PATH@[38; 39) | ||
38 | PATH_SEGMENT@[38; 39) | ||
39 | NAME_REF@[38; 39) | ||
40 | IDENT@[38; 39) "S" | ||
41 | WHITESPACE@[39; 40) | ||
42 | L_CURLY@[40; 41) | ||
43 | WHITESPACE@[41; 42) | ||
44 | BIND_PAT@[42; 43) | ||
45 | NAME@[42; 43) | ||
46 | IDENT@[42; 43) "f" | ||
47 | COMMA@[43; 44) | ||
48 | WHITESPACE@[44; 45) | ||
49 | BIND_PAT@[45; 54) | ||
50 | REF_KW@[45; 48) | ||
51 | WHITESPACE@[48; 49) | ||
52 | MUT_KW@[49; 52) | ||
53 | WHITESPACE@[52; 53) | ||
54 | NAME@[53; 54) | ||
55 | IDENT@[53; 54) "g" | ||
56 | WHITESPACE@[54; 55) | ||
57 | R_CURLY@[55; 56) | ||
58 | WHITESPACE@[56; 57) | ||
59 | EQ@[57; 58) | ||
60 | WHITESPACE@[58; 59) | ||
61 | TUPLE_EXPR@[59; 61) | ||
62 | L_PAREN@[59; 60) | ||
63 | R_PAREN@[60; 61) | ||
64 | SEMI@[61; 62) | ||
65 | WHITESPACE@[62; 67) | ||
66 | LET_STMT@[67; 90) | ||
67 | LET_KW@[67; 70) | ||
68 | WHITESPACE@[70; 71) | ||
69 | STRUCT_PAT@[71; 84) | ||
70 | PATH@[71; 72) | ||
71 | PATH_SEGMENT@[71; 72) | ||
72 | NAME_REF@[71; 72) | ||
73 | IDENT@[71; 72) "S" | ||
74 | WHITESPACE@[72; 73) | ||
75 | L_CURLY@[73; 74) | ||
76 | WHITESPACE@[74; 75) | ||
77 | IDENT@[75; 76) "h" | ||
78 | COLON@[76; 77) | ||
79 | WHITESPACE@[77; 78) | ||
80 | PLACEHOLDER_PAT@[78; 79) | ||
81 | UNDERSCORE@[78; 79) | ||
82 | COMMA@[79; 80) | ||
83 | WHITESPACE@[80; 81) | ||
84 | DOTDOT@[81; 83) | ||
85 | R_CURLY@[83; 84) | ||
86 | WHITESPACE@[84; 85) | ||
87 | EQ@[85; 86) | ||
88 | WHITESPACE@[86; 87) | ||
89 | TUPLE_EXPR@[87; 89) | ||
90 | L_PAREN@[87; 88) | ||
91 | R_PAREN@[88; 89) | ||
92 | SEMI@[89; 90) | ||
93 | WHITESPACE@[90; 95) | ||
94 | LET_STMT@[95; 116) | ||
95 | LET_KW@[95; 98) | ||
96 | WHITESPACE@[98; 99) | ||
97 | STRUCT_PAT@[99; 110) | ||
98 | PATH@[99; 100) | ||
99 | PATH_SEGMENT@[99; 100) | ||
100 | NAME_REF@[99; 100) | ||
101 | IDENT@[99; 100) "S" | ||
102 | WHITESPACE@[100; 101) | ||
103 | L_CURLY@[101; 102) | ||
104 | WHITESPACE@[102; 103) | ||
105 | IDENT@[103; 104) "h" | ||
106 | COLON@[104; 105) | ||
107 | WHITESPACE@[105; 106) | ||
108 | PLACEHOLDER_PAT@[106; 107) | ||
109 | UNDERSCORE@[106; 107) | ||
110 | COMMA@[107; 108) | ||
111 | WHITESPACE@[108; 109) | ||
112 | R_CURLY@[109; 110) | ||
113 | WHITESPACE@[110; 111) | ||
114 | EQ@[111; 112) | ||
115 | WHITESPACE@[112; 113) | ||
116 | TUPLE_EXPR@[113; 115) | ||
117 | L_PAREN@[113; 114) | ||
118 | R_PAREN@[114; 115) | ||
119 | SEMI@[115; 116) | ||
120 | WHITESPACE@[116; 117) | ||
121 | R_CURLY@[117; 118) | ||
122 | WHITESPACE@[118; 119) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0074_unary_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0074_unary_expr.rs new file mode 100644 index 000000000..f1c3f7118 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0074_unary_expr.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | fn foo() { | ||
2 | **&1; | ||
3 | !!true; | ||
4 | --1; | ||
5 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0074_unary_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0074_unary_expr.txt new file mode 100644 index 000000000..e0b4ff964 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0074_unary_expr.txt | |||
@@ -0,0 +1,44 @@ | |||
1 | FILE@[0; 44) | ||
2 | FUNCTION@[0; 43) | ||
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; 43) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 20) | ||
15 | PREFIX_EXPR@[15; 19) | ||
16 | STAR@[15; 16) | ||
17 | PREFIX_EXPR@[16; 19) | ||
18 | STAR@[16; 17) | ||
19 | REF_EXPR@[17; 19) | ||
20 | AMP@[17; 18) | ||
21 | LITERAL@[18; 19) | ||
22 | INT_NUMBER@[18; 19) "1" | ||
23 | SEMI@[19; 20) | ||
24 | WHITESPACE@[20; 25) | ||
25 | EXPR_STMT@[25; 32) | ||
26 | PREFIX_EXPR@[25; 31) | ||
27 | EXCL@[25; 26) | ||
28 | PREFIX_EXPR@[26; 31) | ||
29 | EXCL@[26; 27) | ||
30 | LITERAL@[27; 31) | ||
31 | TRUE_KW@[27; 31) | ||
32 | SEMI@[31; 32) | ||
33 | WHITESPACE@[32; 37) | ||
34 | EXPR_STMT@[37; 41) | ||
35 | PREFIX_EXPR@[37; 40) | ||
36 | MINUS@[37; 38) | ||
37 | PREFIX_EXPR@[38; 40) | ||
38 | MINUS@[38; 39) | ||
39 | LITERAL@[39; 40) | ||
40 | INT_NUMBER@[39; 40) "1" | ||
41 | SEMI@[40; 41) | ||
42 | WHITESPACE@[41; 42) | ||
43 | R_CURLY@[42; 43) | ||
44 | WHITESPACE@[43; 44) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0075_try_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0075_try_expr.rs new file mode 100644 index 000000000..8b74f7bc8 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0075_try_expr.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn foo() { | ||
2 | x?; | ||
3 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0075_try_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0075_try_expr.txt new file mode 100644 index 000000000..f7b86f269 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0075_try_expr.txt | |||
@@ -0,0 +1,25 @@ | |||
1 | FILE@[0; 21) | ||
2 | FUNCTION@[0; 20) | ||
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; 20) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 18) | ||
15 | TRY_EXPR@[15; 17) | ||
16 | PATH_EXPR@[15; 16) | ||
17 | PATH@[15; 16) | ||
18 | PATH_SEGMENT@[15; 16) | ||
19 | NAME_REF@[15; 16) | ||
20 | IDENT@[15; 16) "x" | ||
21 | QUESTION@[16; 17) | ||
22 | SEMI@[17; 18) | ||
23 | WHITESPACE@[18; 19) | ||
24 | R_CURLY@[19; 20) | ||
25 | WHITESPACE@[20; 21) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0076_cond.rs b/crates/libsyntax2/tests/data/parser/inline/0076_cond.rs new file mode 100644 index 000000000..fdb37ee6f --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0076_cond.rs | |||
@@ -0,0 +1 @@ | |||
fn foo() { if let Some(_) = None {} } | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0076_cond.txt b/crates/libsyntax2/tests/data/parser/inline/0076_cond.txt new file mode 100644 index 000000000..0cde88a90 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0076_cond.txt | |||
@@ -0,0 +1,42 @@ | |||
1 | FILE@[0; 38) | ||
2 | FUNCTION@[0; 37) | ||
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; 37) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 11) | ||
14 | IF_EXPR@[11; 35) | ||
15 | IF_KW@[11; 13) | ||
16 | WHITESPACE@[13; 14) | ||
17 | LET_KW@[14; 17) | ||
18 | WHITESPACE@[17; 18) | ||
19 | TUPLE_STRUCT_PAT@[18; 25) | ||
20 | PATH@[18; 22) | ||
21 | PATH_SEGMENT@[18; 22) | ||
22 | NAME_REF@[18; 22) | ||
23 | IDENT@[18; 22) "Some" | ||
24 | L_PAREN@[22; 23) | ||
25 | PLACEHOLDER_PAT@[23; 24) | ||
26 | UNDERSCORE@[23; 24) | ||
27 | R_PAREN@[24; 25) | ||
28 | WHITESPACE@[25; 26) | ||
29 | EQ@[26; 27) | ||
30 | WHITESPACE@[27; 28) | ||
31 | PATH_EXPR@[28; 32) | ||
32 | PATH@[28; 32) | ||
33 | PATH_SEGMENT@[28; 32) | ||
34 | NAME_REF@[28; 32) | ||
35 | IDENT@[28; 32) "None" | ||
36 | WHITESPACE@[32; 33) | ||
37 | BLOCK_EXPR@[33; 35) | ||
38 | L_CURLY@[33; 34) | ||
39 | R_CURLY@[34; 35) | ||
40 | WHITESPACE@[35; 36) | ||
41 | R_CURLY@[36; 37) | ||
42 | WHITESPACE@[37; 38) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0077_while_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0077_while_expr.rs new file mode 100644 index 000000000..293046a04 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0077_while_expr.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | while true {}; | ||
3 | while let Some(x) = it.next() {}; | ||
4 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0077_while_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0077_while_expr.txt new file mode 100644 index 000000000..82e63fd46 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0077_while_expr.txt | |||
@@ -0,0 +1,64 @@ | |||
1 | FILE@[0; 70) | ||
2 | FUNCTION@[0; 69) | ||
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; 69) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 29) | ||
15 | WHILE_EXPR@[15; 28) | ||
16 | WHILE_KW@[15; 20) | ||
17 | WHITESPACE@[20; 21) | ||
18 | LITERAL@[21; 25) | ||
19 | TRUE_KW@[21; 25) | ||
20 | WHITESPACE@[25; 26) | ||
21 | BLOCK_EXPR@[26; 28) | ||
22 | L_CURLY@[26; 27) | ||
23 | R_CURLY@[27; 28) | ||
24 | SEMI@[28; 29) | ||
25 | WHITESPACE@[29; 34) | ||
26 | EXPR_STMT@[34; 67) | ||
27 | WHILE_EXPR@[34; 66) | ||
28 | WHILE_KW@[34; 39) | ||
29 | WHITESPACE@[39; 40) | ||
30 | LET_KW@[40; 43) | ||
31 | WHITESPACE@[43; 44) | ||
32 | TUPLE_STRUCT_PAT@[44; 51) | ||
33 | PATH@[44; 48) | ||
34 | PATH_SEGMENT@[44; 48) | ||
35 | NAME_REF@[44; 48) | ||
36 | IDENT@[44; 48) "Some" | ||
37 | L_PAREN@[48; 49) | ||
38 | BIND_PAT@[49; 50) | ||
39 | NAME@[49; 50) | ||
40 | IDENT@[49; 50) "x" | ||
41 | R_PAREN@[50; 51) | ||
42 | WHITESPACE@[51; 52) | ||
43 | EQ@[52; 53) | ||
44 | WHITESPACE@[53; 54) | ||
45 | METHOD_CALL_EXPR@[54; 63) | ||
46 | PATH_EXPR@[54; 56) | ||
47 | PATH@[54; 56) | ||
48 | PATH_SEGMENT@[54; 56) | ||
49 | NAME_REF@[54; 56) | ||
50 | IDENT@[54; 56) "it" | ||
51 | DOT@[56; 57) | ||
52 | NAME_REF@[57; 61) | ||
53 | IDENT@[57; 61) "next" | ||
54 | ARG_LIST@[61; 63) | ||
55 | L_PAREN@[61; 62) | ||
56 | R_PAREN@[62; 63) | ||
57 | WHITESPACE@[63; 64) | ||
58 | BLOCK_EXPR@[64; 66) | ||
59 | L_CURLY@[64; 65) | ||
60 | R_CURLY@[65; 66) | ||
61 | SEMI@[66; 67) | ||
62 | WHITESPACE@[67; 68) | ||
63 | R_CURLY@[68; 69) | ||
64 | WHITESPACE@[69; 70) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0078_mod_contents.rs b/crates/libsyntax2/tests/data/parser/inline/0078_mod_contents.rs new file mode 100644 index 000000000..24a15c5c5 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0078_mod_contents.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | fn foo() {} | ||
2 | macro_rules! foo {} | ||
3 | foo::bar!(); | ||
4 | super::baz! {} | ||
5 | struct S; | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0078_mod_contents.txt b/crates/libsyntax2/tests/data/parser/inline/0078_mod_contents.txt new file mode 100644 index 000000000..c003d24e1 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0078_mod_contents.txt | |||
@@ -0,0 +1,62 @@ | |||
1 | FILE@[0; 70) | ||
2 | FUNCTION@[0; 11) | ||
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; 11) | ||
12 | L_CURLY@[9; 10) | ||
13 | R_CURLY@[10; 11) | ||
14 | WHITESPACE@[11; 12) | ||
15 | MACRO_CALL@[12; 31) | ||
16 | PATH@[12; 23) | ||
17 | PATH_SEGMENT@[12; 23) | ||
18 | NAME_REF@[12; 23) | ||
19 | IDENT@[12; 23) "macro_rules" | ||
20 | EXCL@[23; 24) | ||
21 | WHITESPACE@[24; 25) | ||
22 | IDENT@[25; 28) "foo" | ||
23 | WHITESPACE@[28; 29) | ||
24 | L_CURLY@[29; 30) | ||
25 | R_CURLY@[30; 31) | ||
26 | WHITESPACE@[31; 32) | ||
27 | MACRO_CALL@[32; 44) | ||
28 | PATH@[32; 40) | ||
29 | PATH@[32; 35) | ||
30 | PATH_SEGMENT@[32; 35) | ||
31 | NAME_REF@[32; 35) | ||
32 | IDENT@[32; 35) "foo" | ||
33 | COLONCOLON@[35; 37) | ||
34 | PATH_SEGMENT@[37; 40) | ||
35 | NAME_REF@[37; 40) | ||
36 | IDENT@[37; 40) "bar" | ||
37 | EXCL@[40; 41) | ||
38 | L_PAREN@[41; 42) | ||
39 | R_PAREN@[42; 43) | ||
40 | SEMI@[43; 44) | ||
41 | WHITESPACE@[44; 45) | ||
42 | MACRO_CALL@[45; 59) | ||
43 | PATH@[45; 55) | ||
44 | PATH@[45; 50) | ||
45 | PATH_SEGMENT@[45; 50) | ||
46 | SUPER_KW@[45; 50) | ||
47 | COLONCOLON@[50; 52) | ||
48 | PATH_SEGMENT@[52; 55) | ||
49 | NAME_REF@[52; 55) | ||
50 | IDENT@[52; 55) "baz" | ||
51 | EXCL@[55; 56) | ||
52 | WHITESPACE@[56; 57) | ||
53 | L_CURLY@[57; 58) | ||
54 | R_CURLY@[58; 59) | ||
55 | WHITESPACE@[59; 60) | ||
56 | STRUCT_ITEM@[60; 69) | ||
57 | STRUCT_KW@[60; 66) | ||
58 | WHITESPACE@[66; 67) | ||
59 | NAME@[67; 68) | ||
60 | IDENT@[67; 68) "S" | ||
61 | SEMI@[68; 69) | ||
62 | WHITESPACE@[69; 70) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0079_cast_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0079_cast_expr.rs new file mode 100644 index 000000000..3e53d56d6 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0079_cast_expr.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn foo() { | ||
2 | 82 as i32; | ||
3 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0079_cast_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0079_cast_expr.txt new file mode 100644 index 000000000..642557e15 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0079_cast_expr.txt | |||
@@ -0,0 +1,29 @@ | |||
1 | FILE@[0; 28) | ||
2 | FUNCTION@[0; 27) | ||
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; 27) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 25) | ||
15 | CAST_EXPR@[15; 24) | ||
16 | LITERAL@[15; 17) | ||
17 | INT_NUMBER@[15; 17) "82" | ||
18 | WHITESPACE@[17; 18) | ||
19 | AS_KW@[18; 20) | ||
20 | WHITESPACE@[20; 21) | ||
21 | PATH_TYPE@[21; 24) | ||
22 | PATH@[21; 24) | ||
23 | PATH_SEGMENT@[21; 24) | ||
24 | NAME_REF@[21; 24) | ||
25 | IDENT@[21; 24) "i32" | ||
26 | SEMI@[24; 25) | ||
27 | WHITESPACE@[25; 26) | ||
28 | R_CURLY@[26; 27) | ||
29 | WHITESPACE@[27; 28) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0080_tuple_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0080_tuple_expr.rs new file mode 100644 index 000000000..e4f774280 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0080_tuple_expr.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | fn foo() { | ||
2 | (); | ||
3 | (1); | ||
4 | (1,); | ||
5 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0080_tuple_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0080_tuple_expr.txt new file mode 100644 index 000000000..728ba6ec7 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0080_tuple_expr.txt | |||
@@ -0,0 +1,38 @@ | |||
1 | FILE@[0; 40) | ||
2 | FUNCTION@[0; 39) | ||
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; 39) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 18) | ||
15 | TUPLE_EXPR@[15; 17) | ||
16 | L_PAREN@[15; 16) | ||
17 | R_PAREN@[16; 17) | ||
18 | SEMI@[17; 18) | ||
19 | WHITESPACE@[18; 23) | ||
20 | EXPR_STMT@[23; 27) | ||
21 | PAREN_EXPR@[23; 26) | ||
22 | L_PAREN@[23; 24) | ||
23 | LITERAL@[24; 25) | ||
24 | INT_NUMBER@[24; 25) "1" | ||
25 | R_PAREN@[25; 26) | ||
26 | SEMI@[26; 27) | ||
27 | WHITESPACE@[27; 32) | ||
28 | EXPR_STMT@[32; 37) | ||
29 | TUPLE_EXPR@[32; 36) | ||
30 | L_PAREN@[32; 33) | ||
31 | LITERAL@[33; 34) | ||
32 | INT_NUMBER@[33; 34) "1" | ||
33 | COMMA@[34; 35) | ||
34 | R_PAREN@[35; 36) | ||
35 | SEMI@[36; 37) | ||
36 | WHITESPACE@[37; 38) | ||
37 | R_CURLY@[38; 39) | ||
38 | WHITESPACE@[39; 40) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0081_index_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0081_index_expr.rs new file mode 100644 index 000000000..b9ba78a6c --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0081_index_expr.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn foo() { | ||
2 | x[1][2]; | ||
3 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0081_index_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0081_index_expr.txt new file mode 100644 index 000000000..80af4caed --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0081_index_expr.txt | |||
@@ -0,0 +1,33 @@ | |||
1 | FILE@[0; 26) | ||
2 | FUNCTION@[0; 25) | ||
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; 25) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 23) | ||
15 | INDEX_EXPR@[15; 22) | ||
16 | INDEX_EXPR@[15; 19) | ||
17 | PATH_EXPR@[15; 16) | ||
18 | PATH@[15; 16) | ||
19 | PATH_SEGMENT@[15; 16) | ||
20 | NAME_REF@[15; 16) | ||
21 | IDENT@[15; 16) "x" | ||
22 | L_BRACK@[16; 17) | ||
23 | LITERAL@[17; 18) | ||
24 | INT_NUMBER@[17; 18) "1" | ||
25 | R_BRACK@[18; 19) | ||
26 | L_BRACK@[19; 20) | ||
27 | LITERAL@[20; 21) | ||
28 | INT_NUMBER@[20; 21) "2" | ||
29 | R_BRACK@[21; 22) | ||
30 | SEMI@[22; 23) | ||
31 | WHITESPACE@[23; 24) | ||
32 | R_CURLY@[24; 25) | ||
33 | WHITESPACE@[25; 26) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0082_tuple_pat.rs b/crates/libsyntax2/tests/data/parser/inline/0082_tuple_pat.rs new file mode 100644 index 000000000..f785acd36 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0082_tuple_pat.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn main() { | ||
2 | let (a, b, ..) = (); | ||
3 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0082_tuple_pat.txt b/crates/libsyntax2/tests/data/parser/inline/0082_tuple_pat.txt new file mode 100644 index 000000000..d8314b5d8 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0082_tuple_pat.txt | |||
@@ -0,0 +1,40 @@ | |||
1 | FILE@[0; 39) | ||
2 | FUNCTION@[0; 38) | ||
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; 38) | ||
12 | L_CURLY@[10; 11) | ||
13 | WHITESPACE@[11; 16) | ||
14 | LET_STMT@[16; 36) | ||
15 | LET_KW@[16; 19) | ||
16 | WHITESPACE@[19; 20) | ||
17 | TUPLE_PAT@[20; 30) | ||
18 | L_PAREN@[20; 21) | ||
19 | BIND_PAT@[21; 22) | ||
20 | NAME@[21; 22) | ||
21 | IDENT@[21; 22) "a" | ||
22 | COMMA@[22; 23) | ||
23 | WHITESPACE@[23; 24) | ||
24 | BIND_PAT@[24; 25) | ||
25 | NAME@[24; 25) | ||
26 | IDENT@[24; 25) "b" | ||
27 | COMMA@[25; 26) | ||
28 | WHITESPACE@[26; 27) | ||
29 | DOTDOT@[27; 29) | ||
30 | R_PAREN@[29; 30) | ||
31 | WHITESPACE@[30; 31) | ||
32 | EQ@[31; 32) | ||
33 | WHITESPACE@[32; 33) | ||
34 | TUPLE_EXPR@[33; 35) | ||
35 | L_PAREN@[33; 34) | ||
36 | R_PAREN@[34; 35) | ||
37 | SEMI@[35; 36) | ||
38 | WHITESPACE@[36; 37) | ||
39 | R_CURLY@[37; 38) | ||
40 | WHITESPACE@[38; 39) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0083_postfix_range.rs b/crates/libsyntax2/tests/data/parser/inline/0083_postfix_range.rs new file mode 100644 index 000000000..c39fe8e68 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0083_postfix_range.rs | |||
@@ -0,0 +1 @@ | |||
fn foo() { let x = 1..; } | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0083_postfix_range.txt b/crates/libsyntax2/tests/data/parser/inline/0083_postfix_range.txt new file mode 100644 index 000000000..bf9b2c695 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0083_postfix_range.txt | |||
@@ -0,0 +1,30 @@ | |||
1 | FILE@[0; 26) | ||
2 | FUNCTION@[0; 25) | ||
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; 25) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 11) | ||
14 | LET_STMT@[11; 23) | ||
15 | LET_KW@[11; 14) | ||
16 | WHITESPACE@[14; 15) | ||
17 | BIND_PAT@[15; 16) | ||
18 | NAME@[15; 16) | ||
19 | IDENT@[15; 16) "x" | ||
20 | WHITESPACE@[16; 17) | ||
21 | EQ@[17; 18) | ||
22 | WHITESPACE@[18; 19) | ||
23 | RANGE_EXPR@[19; 22) | ||
24 | LITERAL@[19; 20) | ||
25 | INT_NUMBER@[19; 20) "1" | ||
26 | DOTDOT@[20; 22) | ||
27 | SEMI@[22; 23) | ||
28 | WHITESPACE@[23; 24) | ||
29 | R_CURLY@[24; 25) | ||
30 | WHITESPACE@[25; 26) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0084_loop_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0084_loop_expr.rs new file mode 100644 index 000000000..9f078fa48 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0084_loop_expr.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn foo() { | ||
2 | loop {}; | ||
3 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0084_loop_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0084_loop_expr.txt new file mode 100644 index 000000000..5e0de55d4 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0084_loop_expr.txt | |||
@@ -0,0 +1,24 @@ | |||
1 | FILE@[0; 26) | ||
2 | FUNCTION@[0; 25) | ||
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; 25) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 23) | ||
15 | LOOP_EXPR@[15; 22) | ||
16 | LOOP_KW@[15; 19) | ||
17 | WHITESPACE@[19; 20) | ||
18 | BLOCK_EXPR@[20; 22) | ||
19 | L_CURLY@[20; 21) | ||
20 | R_CURLY@[21; 22) | ||
21 | SEMI@[22; 23) | ||
22 | WHITESPACE@[23; 24) | ||
23 | R_CURLY@[24; 25) | ||
24 | WHITESPACE@[25; 26) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0085_for_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0085_for_expr.rs new file mode 100644 index 000000000..972197d2a --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0085_for_expr.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn foo() { | ||
2 | for x in [] {}; | ||
3 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0085_for_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0085_for_expr.txt new file mode 100644 index 000000000..3a378cfcf --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0085_for_expr.txt | |||
@@ -0,0 +1,34 @@ | |||
1 | FILE@[0; 33) | ||
2 | FUNCTION@[0; 32) | ||
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; 32) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 30) | ||
15 | FOR_EXPR@[15; 29) | ||
16 | FOR_KW@[15; 18) | ||
17 | WHITESPACE@[18; 19) | ||
18 | BIND_PAT@[19; 20) | ||
19 | NAME@[19; 20) | ||
20 | IDENT@[19; 20) "x" | ||
21 | WHITESPACE@[20; 21) | ||
22 | IN_KW@[21; 23) | ||
23 | WHITESPACE@[23; 24) | ||
24 | ARRAY_EXPR@[24; 26) | ||
25 | L_BRACK@[24; 25) | ||
26 | R_BRACK@[25; 26) | ||
27 | WHITESPACE@[26; 27) | ||
28 | BLOCK_EXPR@[27; 29) | ||
29 | L_CURLY@[27; 28) | ||
30 | R_CURLY@[28; 29) | ||
31 | SEMI@[29; 30) | ||
32 | WHITESPACE@[30; 31) | ||
33 | R_CURLY@[31; 32) | ||
34 | WHITESPACE@[32; 33) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0085_match_arms_commas.rs b/crates/libsyntax2/tests/data/parser/inline/0085_match_arms_commas.rs new file mode 100644 index 000000000..1f25d577a --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0085_match_arms_commas.rs | |||
@@ -0,0 +1,7 @@ | |||
1 | fn foo() { | ||
2 | match () { | ||
3 | _ => (), | ||
4 | _ => {} | ||
5 | _ => () | ||
6 | } | ||
7 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0085_match_arms_commas.txt b/crates/libsyntax2/tests/data/parser/inline/0085_match_arms_commas.txt new file mode 100644 index 000000000..5465a3797 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0085_match_arms_commas.txt | |||
@@ -0,0 +1,57 @@ | |||
1 | FILE@[0; 83) | ||
2 | FUNCTION@[0; 82) | ||
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; 82) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | MATCH_EXPR@[15; 80) | ||
15 | MATCH_KW@[15; 20) | ||
16 | WHITESPACE@[20; 21) | ||
17 | TUPLE_EXPR@[21; 23) | ||
18 | L_PAREN@[21; 22) | ||
19 | R_PAREN@[22; 23) | ||
20 | WHITESPACE@[23; 24) | ||
21 | L_CURLY@[24; 25) | ||
22 | WHITESPACE@[25; 34) | ||
23 | MATCH_ARM@[34; 41) | ||
24 | PLACEHOLDER_PAT@[34; 35) | ||
25 | UNDERSCORE@[34; 35) | ||
26 | WHITESPACE@[35; 36) | ||
27 | FAT_ARROW@[36; 38) | ||
28 | WHITESPACE@[38; 39) | ||
29 | TUPLE_EXPR@[39; 41) | ||
30 | L_PAREN@[39; 40) | ||
31 | R_PAREN@[40; 41) | ||
32 | COMMA@[41; 42) | ||
33 | WHITESPACE@[42; 51) | ||
34 | MATCH_ARM@[51; 58) | ||
35 | PLACEHOLDER_PAT@[51; 52) | ||
36 | UNDERSCORE@[51; 52) | ||
37 | WHITESPACE@[52; 53) | ||
38 | FAT_ARROW@[53; 55) | ||
39 | WHITESPACE@[55; 56) | ||
40 | BLOCK_EXPR@[56; 58) | ||
41 | L_CURLY@[56; 57) | ||
42 | R_CURLY@[57; 58) | ||
43 | WHITESPACE@[58; 67) | ||
44 | MATCH_ARM@[67; 74) | ||
45 | PLACEHOLDER_PAT@[67; 68) | ||
46 | UNDERSCORE@[67; 68) | ||
47 | WHITESPACE@[68; 69) | ||
48 | FAT_ARROW@[69; 71) | ||
49 | WHITESPACE@[71; 72) | ||
50 | TUPLE_EXPR@[72; 74) | ||
51 | L_PAREN@[72; 73) | ||
52 | R_PAREN@[73; 74) | ||
53 | WHITESPACE@[74; 79) | ||
54 | R_CURLY@[79; 80) | ||
55 | WHITESPACE@[80; 81) | ||
56 | R_CURLY@[81; 82) | ||
57 | WHITESPACE@[82; 83) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0086_array_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0086_array_expr.rs new file mode 100644 index 000000000..4dc1999d1 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0086_array_expr.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | []; | ||
3 | [1]; | ||
4 | [1, 2,]; | ||
5 | [1; 2]; | ||
6 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0086_array_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0086_array_expr.txt new file mode 100644 index 000000000..9a5f56edf --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0086_array_expr.txt | |||
@@ -0,0 +1,54 @@ | |||
1 | FILE@[0; 55) | ||
2 | FUNCTION@[0; 54) | ||
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; 54) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 18) | ||
15 | ARRAY_EXPR@[15; 17) | ||
16 | L_BRACK@[15; 16) | ||
17 | R_BRACK@[16; 17) | ||
18 | SEMI@[17; 18) | ||
19 | WHITESPACE@[18; 23) | ||
20 | EXPR_STMT@[23; 27) | ||
21 | ARRAY_EXPR@[23; 26) | ||
22 | L_BRACK@[23; 24) | ||
23 | LITERAL@[24; 25) | ||
24 | INT_NUMBER@[24; 25) "1" | ||
25 | R_BRACK@[25; 26) | ||
26 | SEMI@[26; 27) | ||
27 | WHITESPACE@[27; 32) | ||
28 | EXPR_STMT@[32; 40) | ||
29 | ARRAY_EXPR@[32; 39) | ||
30 | L_BRACK@[32; 33) | ||
31 | LITERAL@[33; 34) | ||
32 | INT_NUMBER@[33; 34) "1" | ||
33 | COMMA@[34; 35) | ||
34 | WHITESPACE@[35; 36) | ||
35 | LITERAL@[36; 37) | ||
36 | INT_NUMBER@[36; 37) "2" | ||
37 | COMMA@[37; 38) | ||
38 | R_BRACK@[38; 39) | ||
39 | SEMI@[39; 40) | ||
40 | WHITESPACE@[40; 45) | ||
41 | EXPR_STMT@[45; 52) | ||
42 | ARRAY_EXPR@[45; 51) | ||
43 | L_BRACK@[45; 46) | ||
44 | LITERAL@[46; 47) | ||
45 | INT_NUMBER@[46; 47) "1" | ||
46 | SEMI@[47; 48) | ||
47 | WHITESPACE@[48; 49) | ||
48 | LITERAL@[49; 50) | ||
49 | INT_NUMBER@[49; 50) "2" | ||
50 | R_BRACK@[50; 51) | ||
51 | SEMI@[51; 52) | ||
52 | WHITESPACE@[52; 53) | ||
53 | R_CURLY@[53; 54) | ||
54 | WHITESPACE@[54; 55) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0086_no_semi_after_block.rs b/crates/libsyntax2/tests/data/parser/inline/0086_no_semi_after_block.rs new file mode 100644 index 000000000..d769da43d --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0086_no_semi_after_block.rs | |||
@@ -0,0 +1,9 @@ | |||
1 | fn foo() { | ||
2 | if true {} | ||
3 | loop {} | ||
4 | match () {} | ||
5 | while true {} | ||
6 | for _ in () {} | ||
7 | {} | ||
8 | {} | ||
9 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0086_no_semi_after_block.txt b/crates/libsyntax2/tests/data/parser/inline/0086_no_semi_after_block.txt new file mode 100644 index 000000000..d19a270ac --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0086_no_semi_after_block.txt | |||
@@ -0,0 +1,82 @@ | |||
1 | FILE@[0; 107) | ||
2 | FUNCTION@[0; 106) | ||
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; 106) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 25) | ||
15 | IF_EXPR@[15; 25) | ||
16 | IF_KW@[15; 17) | ||
17 | WHITESPACE@[17; 18) | ||
18 | LITERAL@[18; 22) | ||
19 | TRUE_KW@[18; 22) | ||
20 | WHITESPACE@[22; 23) | ||
21 | BLOCK_EXPR@[23; 25) | ||
22 | L_CURLY@[23; 24) | ||
23 | R_CURLY@[24; 25) | ||
24 | WHITESPACE@[25; 30) | ||
25 | EXPR_STMT@[30; 37) | ||
26 | LOOP_EXPR@[30; 37) | ||
27 | LOOP_KW@[30; 34) | ||
28 | WHITESPACE@[34; 35) | ||
29 | BLOCK_EXPR@[35; 37) | ||
30 | L_CURLY@[35; 36) | ||
31 | R_CURLY@[36; 37) | ||
32 | WHITESPACE@[37; 42) | ||
33 | EXPR_STMT@[42; 53) | ||
34 | MATCH_EXPR@[42; 53) | ||
35 | MATCH_KW@[42; 47) | ||
36 | WHITESPACE@[47; 48) | ||
37 | TUPLE_EXPR@[48; 50) | ||
38 | L_PAREN@[48; 49) | ||
39 | R_PAREN@[49; 50) | ||
40 | WHITESPACE@[50; 51) | ||
41 | L_CURLY@[51; 52) | ||
42 | R_CURLY@[52; 53) | ||
43 | WHITESPACE@[53; 58) | ||
44 | EXPR_STMT@[58; 71) | ||
45 | WHILE_EXPR@[58; 71) | ||
46 | WHILE_KW@[58; 63) | ||
47 | WHITESPACE@[63; 64) | ||
48 | LITERAL@[64; 68) | ||
49 | TRUE_KW@[64; 68) | ||
50 | WHITESPACE@[68; 69) | ||
51 | BLOCK_EXPR@[69; 71) | ||
52 | L_CURLY@[69; 70) | ||
53 | R_CURLY@[70; 71) | ||
54 | WHITESPACE@[71; 76) | ||
55 | EXPR_STMT@[76; 90) | ||
56 | FOR_EXPR@[76; 90) | ||
57 | FOR_KW@[76; 79) | ||
58 | WHITESPACE@[79; 80) | ||
59 | PLACEHOLDER_PAT@[80; 81) | ||
60 | UNDERSCORE@[80; 81) | ||
61 | WHITESPACE@[81; 82) | ||
62 | IN_KW@[82; 84) | ||
63 | WHITESPACE@[84; 85) | ||
64 | TUPLE_EXPR@[85; 87) | ||
65 | L_PAREN@[85; 86) | ||
66 | R_PAREN@[86; 87) | ||
67 | WHITESPACE@[87; 88) | ||
68 | BLOCK_EXPR@[88; 90) | ||
69 | L_CURLY@[88; 89) | ||
70 | R_CURLY@[89; 90) | ||
71 | WHITESPACE@[90; 95) | ||
72 | EXPR_STMT@[95; 97) | ||
73 | BLOCK_EXPR@[95; 97) | ||
74 | L_CURLY@[95; 96) | ||
75 | R_CURLY@[96; 97) | ||
76 | WHITESPACE@[97; 102) | ||
77 | BLOCK_EXPR@[102; 104) | ||
78 | L_CURLY@[102; 103) | ||
79 | R_CURLY@[103; 104) | ||
80 | WHITESPACE@[104; 105) | ||
81 | R_CURLY@[105; 106) | ||
82 | WHITESPACE@[106; 107) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0087_stmt_postfix_expr_ambiguity.rs b/crates/libsyntax2/tests/data/parser/inline/0087_stmt_postfix_expr_ambiguity.rs new file mode 100644 index 000000000..2edd578f9 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0087_stmt_postfix_expr_ambiguity.rs | |||
@@ -0,0 +1,7 @@ | |||
1 | fn foo() { | ||
2 | match () { | ||
3 | _ => {} | ||
4 | () => {} | ||
5 | [] => {} | ||
6 | } | ||
7 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0087_stmt_postfix_expr_ambiguity.txt b/crates/libsyntax2/tests/data/parser/inline/0087_stmt_postfix_expr_ambiguity.txt new file mode 100644 index 000000000..e83b6d183 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0087_stmt_postfix_expr_ambiguity.txt | |||
@@ -0,0 +1,58 @@ | |||
1 | FILE@[0; 84) | ||
2 | FUNCTION@[0; 83) | ||
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; 83) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | MATCH_EXPR@[15; 81) | ||
15 | MATCH_KW@[15; 20) | ||
16 | WHITESPACE@[20; 21) | ||
17 | TUPLE_EXPR@[21; 23) | ||
18 | L_PAREN@[21; 22) | ||
19 | R_PAREN@[22; 23) | ||
20 | WHITESPACE@[23; 24) | ||
21 | L_CURLY@[24; 25) | ||
22 | WHITESPACE@[25; 34) | ||
23 | MATCH_ARM@[34; 41) | ||
24 | PLACEHOLDER_PAT@[34; 35) | ||
25 | UNDERSCORE@[34; 35) | ||
26 | WHITESPACE@[35; 36) | ||
27 | FAT_ARROW@[36; 38) | ||
28 | WHITESPACE@[38; 39) | ||
29 | BLOCK_EXPR@[39; 41) | ||
30 | L_CURLY@[39; 40) | ||
31 | R_CURLY@[40; 41) | ||
32 | WHITESPACE@[41; 50) | ||
33 | MATCH_ARM@[50; 58) | ||
34 | TUPLE_PAT@[50; 52) | ||
35 | L_PAREN@[50; 51) | ||
36 | R_PAREN@[51; 52) | ||
37 | WHITESPACE@[52; 53) | ||
38 | FAT_ARROW@[53; 55) | ||
39 | WHITESPACE@[55; 56) | ||
40 | BLOCK_EXPR@[56; 58) | ||
41 | L_CURLY@[56; 57) | ||
42 | R_CURLY@[57; 58) | ||
43 | WHITESPACE@[58; 67) | ||
44 | MATCH_ARM@[67; 75) | ||
45 | SLICE_PAT@[67; 69) | ||
46 | L_BRACK@[67; 68) | ||
47 | R_BRACK@[68; 69) | ||
48 | WHITESPACE@[69; 70) | ||
49 | FAT_ARROW@[70; 72) | ||
50 | WHITESPACE@[72; 73) | ||
51 | BLOCK_EXPR@[73; 75) | ||
52 | L_CURLY@[73; 74) | ||
53 | R_CURLY@[74; 75) | ||
54 | WHITESPACE@[75; 80) | ||
55 | R_CURLY@[80; 81) | ||
56 | WHITESPACE@[81; 82) | ||
57 | R_CURLY@[82; 83) | ||
58 | WHITESPACE@[83; 84) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0088_stmt_bin_expr_ambiguity.rs b/crates/libsyntax2/tests/data/parser/inline/0088_stmt_bin_expr_ambiguity.rs new file mode 100644 index 000000000..37b843742 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0088_stmt_bin_expr_ambiguity.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | let _ = {1} & 2; | ||
3 | {1} &2; | ||
4 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0088_stmt_bin_expr_ambiguity.txt b/crates/libsyntax2/tests/data/parser/inline/0088_stmt_bin_expr_ambiguity.txt new file mode 100644 index 000000000..df4c20b0e --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0088_stmt_bin_expr_ambiguity.txt | |||
@@ -0,0 +1,50 @@ | |||
1 | FILE@[0; 46) | ||
2 | FUNCTION@[0; 45) | ||
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; 45) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | LET_STMT@[15; 31) | ||
15 | LET_KW@[15; 18) | ||
16 | WHITESPACE@[18; 19) | ||
17 | PLACEHOLDER_PAT@[19; 20) | ||
18 | UNDERSCORE@[19; 20) | ||
19 | WHITESPACE@[20; 21) | ||
20 | EQ@[21; 22) | ||
21 | WHITESPACE@[22; 23) | ||
22 | BIN_EXPR@[23; 30) | ||
23 | BLOCK_EXPR@[23; 26) | ||
24 | L_CURLY@[23; 24) | ||
25 | LITERAL@[24; 25) | ||
26 | INT_NUMBER@[24; 25) "1" | ||
27 | R_CURLY@[25; 26) | ||
28 | WHITESPACE@[26; 27) | ||
29 | AMP@[27; 28) | ||
30 | WHITESPACE@[28; 29) | ||
31 | LITERAL@[29; 30) | ||
32 | INT_NUMBER@[29; 30) "2" | ||
33 | SEMI@[30; 31) | ||
34 | WHITESPACE@[31; 36) | ||
35 | EXPR_STMT@[36; 39) | ||
36 | BLOCK_EXPR@[36; 39) | ||
37 | L_CURLY@[36; 37) | ||
38 | LITERAL@[37; 38) | ||
39 | INT_NUMBER@[37; 38) "1" | ||
40 | R_CURLY@[38; 39) | ||
41 | WHITESPACE@[39; 40) | ||
42 | EXPR_STMT@[40; 43) | ||
43 | REF_EXPR@[40; 42) | ||
44 | AMP@[40; 41) | ||
45 | LITERAL@[41; 42) | ||
46 | INT_NUMBER@[41; 42) "2" | ||
47 | SEMI@[42; 43) | ||
48 | WHITESPACE@[43; 44) | ||
49 | R_CURLY@[44; 45) | ||
50 | WHITESPACE@[45; 46) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0089_slice_pat.rs b/crates/libsyntax2/tests/data/parser/inline/0089_slice_pat.rs new file mode 100644 index 000000000..7955973b9 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0089_slice_pat.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn main() { | ||
2 | let [a, b, ..] = []; | ||
3 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0089_slice_pat.txt b/crates/libsyntax2/tests/data/parser/inline/0089_slice_pat.txt new file mode 100644 index 000000000..8379df33b --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0089_slice_pat.txt | |||
@@ -0,0 +1,40 @@ | |||
1 | FILE@[0; 39) | ||
2 | FUNCTION@[0; 38) | ||
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; 38) | ||
12 | L_CURLY@[10; 11) | ||
13 | WHITESPACE@[11; 16) | ||
14 | LET_STMT@[16; 36) | ||
15 | LET_KW@[16; 19) | ||
16 | WHITESPACE@[19; 20) | ||
17 | SLICE_PAT@[20; 30) | ||
18 | L_BRACK@[20; 21) | ||
19 | BIND_PAT@[21; 22) | ||
20 | NAME@[21; 22) | ||
21 | IDENT@[21; 22) "a" | ||
22 | COMMA@[22; 23) | ||
23 | WHITESPACE@[23; 24) | ||
24 | BIND_PAT@[24; 25) | ||
25 | NAME@[24; 25) | ||
26 | IDENT@[24; 25) "b" | ||
27 | COMMA@[25; 26) | ||
28 | WHITESPACE@[26; 27) | ||
29 | DOTDOT@[27; 29) | ||
30 | R_BRACK@[29; 30) | ||
31 | WHITESPACE@[30; 31) | ||
32 | EQ@[31; 32) | ||
33 | WHITESPACE@[32; 33) | ||
34 | ARRAY_EXPR@[33; 35) | ||
35 | L_BRACK@[33; 34) | ||
36 | R_BRACK@[34; 35) | ||
37 | SEMI@[35; 36) | ||
38 | WHITESPACE@[36; 37) | ||
39 | R_CURLY@[37; 38) | ||
40 | WHITESPACE@[38; 39) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0090_trait_item_items.rs b/crates/libsyntax2/tests/data/parser/inline/0090_trait_item_items.rs new file mode 100644 index 000000000..a5ec3239f --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0090_trait_item_items.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | impl F { | ||
2 | type A: Clone; | ||
3 | const B: i32; | ||
4 | fn foo() {} | ||
5 | fn bar(&self); | ||
6 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0090_trait_item_items.txt b/crates/libsyntax2/tests/data/parser/inline/0090_trait_item_items.txt new file mode 100644 index 000000000..c04c48588 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0090_trait_item_items.txt | |||
@@ -0,0 +1,67 @@ | |||
1 | FILE@[0; 83) | ||
2 | IMPL_ITEM@[0; 82) | ||
3 | IMPL_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | PATH_TYPE@[5; 6) | ||
6 | PATH@[5; 6) | ||
7 | PATH_SEGMENT@[5; 6) | ||
8 | NAME_REF@[5; 6) | ||
9 | IDENT@[5; 6) "F" | ||
10 | WHITESPACE@[6; 7) | ||
11 | L_CURLY@[7; 8) | ||
12 | WHITESPACE@[8; 13) | ||
13 | TYPE_ITEM@[13; 27) | ||
14 | TYPE_KW@[13; 17) | ||
15 | WHITESPACE@[17; 18) | ||
16 | NAME@[18; 19) | ||
17 | IDENT@[18; 19) "A" | ||
18 | COLON@[19; 20) | ||
19 | WHITESPACE@[20; 21) | ||
20 | PATH@[21; 26) | ||
21 | PATH_SEGMENT@[21; 26) | ||
22 | NAME_REF@[21; 26) | ||
23 | IDENT@[21; 26) "Clone" | ||
24 | SEMI@[26; 27) | ||
25 | WHITESPACE@[27; 32) | ||
26 | CONST_ITEM@[32; 45) | ||
27 | CONST_KW@[32; 37) | ||
28 | WHITESPACE@[37; 38) | ||
29 | NAME@[38; 39) | ||
30 | IDENT@[38; 39) "B" | ||
31 | COLON@[39; 40) | ||
32 | WHITESPACE@[40; 41) | ||
33 | PATH_TYPE@[41; 44) | ||
34 | PATH@[41; 44) | ||
35 | PATH_SEGMENT@[41; 44) | ||
36 | NAME_REF@[41; 44) | ||
37 | IDENT@[41; 44) "i32" | ||
38 | SEMI@[44; 45) | ||
39 | WHITESPACE@[45; 50) | ||
40 | FUNCTION@[50; 61) | ||
41 | FN_KW@[50; 52) | ||
42 | WHITESPACE@[52; 53) | ||
43 | NAME@[53; 56) | ||
44 | IDENT@[53; 56) "foo" | ||
45 | PARAM_LIST@[56; 58) | ||
46 | L_PAREN@[56; 57) | ||
47 | R_PAREN@[57; 58) | ||
48 | WHITESPACE@[58; 59) | ||
49 | BLOCK_EXPR@[59; 61) | ||
50 | L_CURLY@[59; 60) | ||
51 | R_CURLY@[60; 61) | ||
52 | WHITESPACE@[61; 66) | ||
53 | FUNCTION@[66; 80) | ||
54 | FN_KW@[66; 68) | ||
55 | WHITESPACE@[68; 69) | ||
56 | NAME@[69; 72) | ||
57 | IDENT@[69; 72) "bar" | ||
58 | PARAM_LIST@[72; 79) | ||
59 | L_PAREN@[72; 73) | ||
60 | SELF_PARAM@[73; 78) | ||
61 | AMP@[73; 74) | ||
62 | SELF_KW@[74; 78) | ||
63 | R_PAREN@[78; 79) | ||
64 | SEMI@[79; 80) | ||
65 | WHITESPACE@[80; 81) | ||
66 | R_CURLY@[81; 82) | ||
67 | WHITESPACE@[82; 83) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0091_fn_decl.rs b/crates/libsyntax2/tests/data/parser/inline/0091_fn_decl.rs new file mode 100644 index 000000000..c9f74f7f5 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0091_fn_decl.rs | |||
@@ -0,0 +1 @@ | |||
trait T { fn foo(); } | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0091_fn_decl.txt b/crates/libsyntax2/tests/data/parser/inline/0091_fn_decl.txt new file mode 100644 index 000000000..5a76af652 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0091_fn_decl.txt | |||
@@ -0,0 +1,21 @@ | |||
1 | FILE@[0; 22) | ||
2 | TRAIT_ITEM@[0; 21) | ||
3 | TRAIT_KW@[0; 5) | ||
4 | WHITESPACE@[5; 6) | ||
5 | NAME@[6; 7) | ||
6 | IDENT@[6; 7) "T" | ||
7 | WHITESPACE@[7; 8) | ||
8 | L_CURLY@[8; 9) | ||
9 | WHITESPACE@[9; 10) | ||
10 | FUNCTION@[10; 19) | ||
11 | FN_KW@[10; 12) | ||
12 | WHITESPACE@[12; 13) | ||
13 | NAME@[13; 16) | ||
14 | IDENT@[13; 16) "foo" | ||
15 | PARAM_LIST@[16; 18) | ||
16 | L_PAREN@[16; 17) | ||
17 | R_PAREN@[17; 18) | ||
18 | SEMI@[18; 19) | ||
19 | WHITESPACE@[19; 20) | ||
20 | R_CURLY@[20; 21) | ||
21 | WHITESPACE@[21; 22) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0092_literal_pattern.rs b/crates/libsyntax2/tests/data/parser/inline/0092_literal_pattern.rs new file mode 100644 index 000000000..16f674d9d --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0092_literal_pattern.rs | |||
@@ -0,0 +1,7 @@ | |||
1 | fn main() { | ||
2 | match () { | ||
3 | 92 => (), | ||
4 | 'c' => (), | ||
5 | "hello" => (), | ||
6 | } | ||
7 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0092_literal_pattern.txt b/crates/libsyntax2/tests/data/parser/inline/0092_literal_pattern.txt new file mode 100644 index 000000000..a2f985408 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0092_literal_pattern.txt | |||
@@ -0,0 +1,59 @@ | |||
1 | FILE@[0; 95) | ||
2 | FUNCTION@[0; 94) | ||
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; 94) | ||
12 | L_CURLY@[10; 11) | ||
13 | WHITESPACE@[11; 16) | ||
14 | MATCH_EXPR@[16; 92) | ||
15 | MATCH_KW@[16; 21) | ||
16 | WHITESPACE@[21; 22) | ||
17 | TUPLE_EXPR@[22; 24) | ||
18 | L_PAREN@[22; 23) | ||
19 | R_PAREN@[23; 24) | ||
20 | WHITESPACE@[24; 25) | ||
21 | L_CURLY@[25; 26) | ||
22 | WHITESPACE@[26; 35) | ||
23 | MATCH_ARM@[35; 43) | ||
24 | LITERAL@[35; 37) | ||
25 | INT_NUMBER@[35; 37) "92" | ||
26 | WHITESPACE@[37; 38) | ||
27 | FAT_ARROW@[38; 40) | ||
28 | WHITESPACE@[40; 41) | ||
29 | TUPLE_EXPR@[41; 43) | ||
30 | L_PAREN@[41; 42) | ||
31 | R_PAREN@[42; 43) | ||
32 | COMMA@[43; 44) | ||
33 | WHITESPACE@[44; 53) | ||
34 | MATCH_ARM@[53; 62) | ||
35 | LITERAL@[53; 56) | ||
36 | CHAR@[53; 56) | ||
37 | WHITESPACE@[56; 57) | ||
38 | FAT_ARROW@[57; 59) | ||
39 | WHITESPACE@[59; 60) | ||
40 | TUPLE_EXPR@[60; 62) | ||
41 | L_PAREN@[60; 61) | ||
42 | R_PAREN@[61; 62) | ||
43 | COMMA@[62; 63) | ||
44 | WHITESPACE@[63; 72) | ||
45 | MATCH_ARM@[72; 85) | ||
46 | LITERAL@[72; 79) | ||
47 | STRING@[72; 79) | ||
48 | WHITESPACE@[79; 80) | ||
49 | FAT_ARROW@[80; 82) | ||
50 | WHITESPACE@[82; 83) | ||
51 | TUPLE_EXPR@[83; 85) | ||
52 | L_PAREN@[83; 84) | ||
53 | R_PAREN@[84; 85) | ||
54 | COMMA@[85; 86) | ||
55 | WHITESPACE@[86; 91) | ||
56 | R_CURLY@[91; 92) | ||
57 | WHITESPACE@[92; 93) | ||
58 | R_CURLY@[93; 94) | ||
59 | WHITESPACE@[94; 95) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0093_path_fn_trait_args.rs b/crates/libsyntax2/tests/data/parser/inline/0093_path_fn_trait_args.rs new file mode 100644 index 000000000..aef45e561 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0093_path_fn_trait_args.rs | |||
@@ -0,0 +1 @@ | |||
type F = Box<Fn(x: i32) -> ()>; | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0093_path_fn_trait_args.txt b/crates/libsyntax2/tests/data/parser/inline/0093_path_fn_trait_args.txt new file mode 100644 index 000000000..800a4ac14 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0093_path_fn_trait_args.txt | |||
@@ -0,0 +1,45 @@ | |||
1 | FILE@[0; 32) | ||
2 | TYPE_ITEM@[0; 31) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "F" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | PATH_TYPE@[9; 30) | ||
11 | PATH@[9; 30) | ||
12 | PATH_SEGMENT@[9; 30) | ||
13 | NAME_REF@[9; 12) | ||
14 | IDENT@[9; 12) "Box" | ||
15 | TYPE_ARG_LIST@[12; 30) | ||
16 | L_ANGLE@[12; 13) | ||
17 | TYPE_ARG@[13; 29) | ||
18 | PATH_TYPE@[13; 29) | ||
19 | PATH@[13; 29) | ||
20 | PATH_SEGMENT@[13; 29) | ||
21 | NAME_REF@[13; 15) | ||
22 | IDENT@[13; 15) "Fn" | ||
23 | PARAM_LIST@[15; 23) | ||
24 | L_PAREN@[15; 16) | ||
25 | PARAM@[16; 22) | ||
26 | BIND_PAT@[16; 17) | ||
27 | NAME@[16; 17) | ||
28 | IDENT@[16; 17) "x" | ||
29 | COLON@[17; 18) | ||
30 | WHITESPACE@[18; 19) | ||
31 | PATH_TYPE@[19; 22) | ||
32 | PATH@[19; 22) | ||
33 | PATH_SEGMENT@[19; 22) | ||
34 | NAME_REF@[19; 22) | ||
35 | IDENT@[19; 22) "i32" | ||
36 | R_PAREN@[22; 23) | ||
37 | WHITESPACE@[23; 24) | ||
38 | THIN_ARROW@[24; 26) | ||
39 | WHITESPACE@[26; 27) | ||
40 | TUPLE_TYPE@[27; 29) | ||
41 | L_PAREN@[27; 28) | ||
42 | R_PAREN@[28; 29) | ||
43 | R_ANGLE@[29; 30) | ||
44 | SEMI@[30; 31) | ||
45 | WHITESPACE@[31; 32) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0094_range_pat.rs b/crates/libsyntax2/tests/data/parser/inline/0094_range_pat.rs new file mode 100644 index 000000000..657467e75 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0094_range_pat.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn main() { | ||
2 | match 92 { 0 ... 100 => () } | ||
3 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0094_range_pat.txt b/crates/libsyntax2/tests/data/parser/inline/0094_range_pat.txt new file mode 100644 index 000000000..cb858044a --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0094_range_pat.txt | |||
@@ -0,0 +1,41 @@ | |||
1 | FILE@[0; 47) | ||
2 | FUNCTION@[0; 46) | ||
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; 46) | ||
12 | L_CURLY@[10; 11) | ||
13 | WHITESPACE@[11; 16) | ||
14 | MATCH_EXPR@[16; 44) | ||
15 | MATCH_KW@[16; 21) | ||
16 | WHITESPACE@[21; 22) | ||
17 | LITERAL@[22; 24) | ||
18 | INT_NUMBER@[22; 24) "92" | ||
19 | WHITESPACE@[24; 25) | ||
20 | L_CURLY@[25; 26) | ||
21 | WHITESPACE@[26; 27) | ||
22 | MATCH_ARM@[27; 42) | ||
23 | RANGE_PAT@[27; 36) | ||
24 | LITERAL@[27; 28) | ||
25 | INT_NUMBER@[27; 28) "0" | ||
26 | WHITESPACE@[28; 29) | ||
27 | DOTDOTDOT@[29; 32) | ||
28 | WHITESPACE@[32; 33) | ||
29 | LITERAL@[33; 36) | ||
30 | INT_NUMBER@[33; 36) "100" | ||
31 | WHITESPACE@[36; 37) | ||
32 | FAT_ARROW@[37; 39) | ||
33 | WHITESPACE@[39; 40) | ||
34 | TUPLE_EXPR@[40; 42) | ||
35 | L_PAREN@[40; 41) | ||
36 | R_PAREN@[41; 42) | ||
37 | WHITESPACE@[42; 43) | ||
38 | R_CURLY@[43; 44) | ||
39 | WHITESPACE@[44; 45) | ||
40 | R_CURLY@[45; 46) | ||
41 | WHITESPACE@[46; 47) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0095_path_type_with_bounds.rs b/crates/libsyntax2/tests/data/parser/inline/0095_path_type_with_bounds.rs new file mode 100644 index 000000000..215210e27 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0095_path_type_with_bounds.rs | |||
@@ -0,0 +1 @@ | |||
fn foo() -> Box<T + 'f> {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0095_path_type_with_bounds.txt b/crates/libsyntax2/tests/data/parser/inline/0095_path_type_with_bounds.txt new file mode 100644 index 000000000..57c38e7ee --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0095_path_type_with_bounds.txt | |||
@@ -0,0 +1,35 @@ | |||
1 | FILE@[0; 27) | ||
2 | FUNCTION@[0; 26) | ||
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 | THIN_ARROW@[9; 11) | ||
12 | WHITESPACE@[11; 12) | ||
13 | PATH_TYPE@[12; 23) | ||
14 | PATH@[12; 23) | ||
15 | PATH_SEGMENT@[12; 23) | ||
16 | NAME_REF@[12; 15) | ||
17 | IDENT@[12; 15) "Box" | ||
18 | TYPE_ARG_LIST@[15; 23) | ||
19 | L_ANGLE@[15; 16) | ||
20 | TYPE_ARG@[16; 22) | ||
21 | PATH_TYPE@[16; 22) | ||
22 | PATH@[16; 17) | ||
23 | PATH_SEGMENT@[16; 17) | ||
24 | NAME_REF@[16; 17) | ||
25 | IDENT@[16; 17) "T" | ||
26 | WHITESPACE@[17; 18) | ||
27 | PLUS@[18; 19) | ||
28 | WHITESPACE@[19; 20) | ||
29 | LIFETIME@[20; 22) "'f" | ||
30 | R_ANGLE@[22; 23) | ||
31 | WHITESPACE@[23; 24) | ||
32 | BLOCK_EXPR@[24; 26) | ||
33 | L_CURLY@[24; 25) | ||
34 | R_CURLY@[25; 26) | ||
35 | WHITESPACE@[26; 27) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0096_value_parameters_no_patterns.rs b/crates/libsyntax2/tests/data/parser/inline/0096_value_parameters_no_patterns.rs new file mode 100644 index 000000000..d8c23c76a --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0096_value_parameters_no_patterns.rs | |||
@@ -0,0 +1 @@ | |||
type F = Box<Fn(a: i32, &b: &i32, &mut c: &i32, ())>; | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0096_value_parameters_no_patterns.txt b/crates/libsyntax2/tests/data/parser/inline/0096_value_parameters_no_patterns.txt new file mode 100644 index 000000000..c3f9bf685 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0096_value_parameters_no_patterns.txt | |||
@@ -0,0 +1,81 @@ | |||
1 | FILE@[0; 54) | ||
2 | TYPE_ITEM@[0; 53) | ||
3 | TYPE_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "F" | ||
7 | WHITESPACE@[6; 7) | ||
8 | EQ@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | PATH_TYPE@[9; 52) | ||
11 | PATH@[9; 52) | ||
12 | PATH_SEGMENT@[9; 52) | ||
13 | NAME_REF@[9; 12) | ||
14 | IDENT@[9; 12) "Box" | ||
15 | TYPE_ARG_LIST@[12; 52) | ||
16 | L_ANGLE@[12; 13) | ||
17 | TYPE_ARG@[13; 51) | ||
18 | PATH_TYPE@[13; 51) | ||
19 | PATH@[13; 51) | ||
20 | PATH_SEGMENT@[13; 51) | ||
21 | NAME_REF@[13; 15) | ||
22 | IDENT@[13; 15) "Fn" | ||
23 | PARAM_LIST@[15; 51) | ||
24 | L_PAREN@[15; 16) | ||
25 | PARAM@[16; 22) | ||
26 | BIND_PAT@[16; 17) | ||
27 | NAME@[16; 17) | ||
28 | IDENT@[16; 17) "a" | ||
29 | COLON@[17; 18) | ||
30 | WHITESPACE@[18; 19) | ||
31 | PATH_TYPE@[19; 22) | ||
32 | PATH@[19; 22) | ||
33 | PATH_SEGMENT@[19; 22) | ||
34 | NAME_REF@[19; 22) | ||
35 | IDENT@[19; 22) "i32" | ||
36 | COMMA@[22; 23) | ||
37 | WHITESPACE@[23; 24) | ||
38 | PARAM@[24; 32) | ||
39 | REF_PAT@[24; 26) | ||
40 | AMP@[24; 25) | ||
41 | BIND_PAT@[25; 26) | ||
42 | NAME@[25; 26) | ||
43 | IDENT@[25; 26) "b" | ||
44 | COLON@[26; 27) | ||
45 | WHITESPACE@[27; 28) | ||
46 | REFERENCE_TYPE@[28; 32) | ||
47 | AMP@[28; 29) | ||
48 | PATH_TYPE@[29; 32) | ||
49 | PATH@[29; 32) | ||
50 | PATH_SEGMENT@[29; 32) | ||
51 | NAME_REF@[29; 32) | ||
52 | IDENT@[29; 32) "i32" | ||
53 | COMMA@[32; 33) | ||
54 | WHITESPACE@[33; 34) | ||
55 | PARAM@[34; 46) | ||
56 | REF_PAT@[34; 40) | ||
57 | AMP@[34; 35) | ||
58 | MUT_KW@[35; 38) | ||
59 | WHITESPACE@[38; 39) | ||
60 | BIND_PAT@[39; 40) | ||
61 | NAME@[39; 40) | ||
62 | IDENT@[39; 40) "c" | ||
63 | COLON@[40; 41) | ||
64 | WHITESPACE@[41; 42) | ||
65 | REFERENCE_TYPE@[42; 46) | ||
66 | AMP@[42; 43) | ||
67 | PATH_TYPE@[43; 46) | ||
68 | PATH@[43; 46) | ||
69 | PATH_SEGMENT@[43; 46) | ||
70 | NAME_REF@[43; 46) | ||
71 | IDENT@[43; 46) "i32" | ||
72 | COMMA@[46; 47) | ||
73 | WHITESPACE@[47; 48) | ||
74 | PARAM@[48; 50) | ||
75 | TUPLE_TYPE@[48; 50) | ||
76 | L_PAREN@[48; 49) | ||
77 | R_PAREN@[49; 50) | ||
78 | R_PAREN@[50; 51) | ||
79 | R_ANGLE@[51; 52) | ||
80 | SEMI@[52; 53) | ||
81 | WHITESPACE@[53; 54) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0097_param_list_opt_patterns.rs b/crates/libsyntax2/tests/data/parser/inline/0097_param_list_opt_patterns.rs new file mode 100644 index 000000000..9b93442c0 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0097_param_list_opt_patterns.rs | |||
@@ -0,0 +1 @@ | |||
fn foo<F: FnMut(&mut Foo<'a>)>(){} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0097_param_list_opt_patterns.txt b/crates/libsyntax2/tests/data/parser/inline/0097_param_list_opt_patterns.txt new file mode 100644 index 000000000..4cb3bdac5 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0097_param_list_opt_patterns.txt | |||
@@ -0,0 +1,43 @@ | |||
1 | FILE@[0; 35) | ||
2 | FUNCTION@[0; 34) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | TYPE_PARAM_LIST@[6; 30) | ||
8 | L_ANGLE@[6; 7) | ||
9 | TYPE_PARAM@[7; 29) | ||
10 | NAME@[7; 8) | ||
11 | IDENT@[7; 8) "F" | ||
12 | COLON@[8; 9) | ||
13 | WHITESPACE@[9; 10) | ||
14 | PATH@[10; 29) | ||
15 | PATH_SEGMENT@[10; 29) | ||
16 | NAME_REF@[10; 15) | ||
17 | IDENT@[10; 15) "FnMut" | ||
18 | PARAM_LIST@[15; 29) | ||
19 | L_PAREN@[15; 16) | ||
20 | PARAM@[16; 28) | ||
21 | REFERENCE_TYPE@[16; 28) | ||
22 | AMP@[16; 17) | ||
23 | MUT_KW@[17; 20) | ||
24 | WHITESPACE@[20; 21) | ||
25 | PATH_TYPE@[21; 28) | ||
26 | PATH@[21; 28) | ||
27 | PATH_SEGMENT@[21; 28) | ||
28 | NAME_REF@[21; 24) | ||
29 | IDENT@[21; 24) "Foo" | ||
30 | TYPE_ARG_LIST@[24; 28) | ||
31 | L_ANGLE@[24; 25) | ||
32 | LIFETIME_ARG@[25; 27) | ||
33 | LIFETIME@[25; 27) "'a" | ||
34 | R_ANGLE@[27; 28) | ||
35 | R_PAREN@[28; 29) | ||
36 | R_ANGLE@[29; 30) | ||
37 | PARAM_LIST@[30; 32) | ||
38 | L_PAREN@[30; 31) | ||
39 | R_PAREN@[31; 32) | ||
40 | BLOCK_EXPR@[32; 34) | ||
41 | L_CURLY@[32; 33) | ||
42 | R_CURLY@[33; 34) | ||
43 | WHITESPACE@[34; 35) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0098_where_clause.rs b/crates/libsyntax2/tests/data/parser/inline/0098_where_clause.rs new file mode 100644 index 000000000..592a005f9 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0098_where_clause.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() | ||
2 | where | ||
3 | 'a: 'b + 'c, | ||
4 | T: Clone + Copy + 'static, | ||
5 | Iterator::Item: 'a, | ||
6 | {} | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0098_where_clause.txt b/crates/libsyntax2/tests/data/parser/inline/0098_where_clause.txt new file mode 100644 index 000000000..150f125a7 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0098_where_clause.txt | |||
@@ -0,0 +1,69 @@ | |||
1 | FILE@[0; 87) | ||
2 | FUNCTION@[0; 86) | ||
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 | WHERE_CLAUSE@[9; 83) | ||
12 | WHERE_KW@[9; 14) | ||
13 | WHITESPACE@[14; 18) | ||
14 | WHERE_PRED@[18; 29) | ||
15 | LIFETIME@[18; 20) "'a" | ||
16 | COLON@[20; 21) | ||
17 | WHITESPACE@[21; 22) | ||
18 | LIFETIME@[22; 24) "'b" | ||
19 | WHITESPACE@[24; 25) | ||
20 | PLUS@[25; 26) | ||
21 | WHITESPACE@[26; 27) | ||
22 | LIFETIME@[27; 29) "'c" | ||
23 | COMMA@[29; 30) | ||
24 | WHITESPACE@[30; 34) | ||
25 | WHERE_PRED@[34; 59) | ||
26 | PATH_TYPE@[34; 35) | ||
27 | PATH@[34; 35) | ||
28 | PATH_SEGMENT@[34; 35) | ||
29 | NAME_REF@[34; 35) | ||
30 | IDENT@[34; 35) "T" | ||
31 | COLON@[35; 36) | ||
32 | WHITESPACE@[36; 37) | ||
33 | PATH@[37; 42) | ||
34 | PATH_SEGMENT@[37; 42) | ||
35 | NAME_REF@[37; 42) | ||
36 | IDENT@[37; 42) "Clone" | ||
37 | WHITESPACE@[42; 43) | ||
38 | PLUS@[43; 44) | ||
39 | WHITESPACE@[44; 45) | ||
40 | PATH@[45; 49) | ||
41 | PATH_SEGMENT@[45; 49) | ||
42 | NAME_REF@[45; 49) | ||
43 | IDENT@[45; 49) "Copy" | ||
44 | WHITESPACE@[49; 50) | ||
45 | PLUS@[50; 51) | ||
46 | WHITESPACE@[51; 52) | ||
47 | LIFETIME@[52; 59) "'static" | ||
48 | COMMA@[59; 60) | ||
49 | WHITESPACE@[60; 64) | ||
50 | WHERE_PRED@[64; 82) | ||
51 | PATH_TYPE@[64; 78) | ||
52 | PATH@[64; 78) | ||
53 | PATH@[64; 72) | ||
54 | PATH_SEGMENT@[64; 72) | ||
55 | NAME_REF@[64; 72) | ||
56 | IDENT@[64; 72) "Iterator" | ||
57 | COLONCOLON@[72; 74) | ||
58 | PATH_SEGMENT@[74; 78) | ||
59 | NAME_REF@[74; 78) | ||
60 | IDENT@[74; 78) "Item" | ||
61 | COLON@[78; 79) | ||
62 | WHITESPACE@[79; 80) | ||
63 | LIFETIME@[80; 82) "'a" | ||
64 | COMMA@[82; 83) | ||
65 | WHITESPACE@[83; 84) | ||
66 | BLOCK_EXPR@[84; 86) | ||
67 | L_CURLY@[84; 85) | ||
68 | R_CURLY@[85; 86) | ||
69 | WHITESPACE@[86; 87) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0099_crate_keyword_vis.rs b/crates/libsyntax2/tests/data/parser/inline/0099_crate_keyword_vis.rs new file mode 100644 index 000000000..660d927cf --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0099_crate_keyword_vis.rs | |||
@@ -0,0 +1 @@ | |||
crate fn main() { } | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0099_crate_keyword_vis.txt b/crates/libsyntax2/tests/data/parser/inline/0099_crate_keyword_vis.txt new file mode 100644 index 000000000..a830d99d9 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0099_crate_keyword_vis.txt | |||
@@ -0,0 +1,18 @@ | |||
1 | FILE@[0; 20) | ||
2 | FUNCTION@[0; 19) | ||
3 | VISIBILITY@[0; 5) | ||
4 | CRATE_KW@[0; 5) | ||
5 | WHITESPACE@[5; 6) | ||
6 | FN_KW@[6; 8) | ||
7 | WHITESPACE@[8; 9) | ||
8 | NAME@[9; 13) | ||
9 | IDENT@[9; 13) "main" | ||
10 | PARAM_LIST@[13; 15) | ||
11 | L_PAREN@[13; 14) | ||
12 | R_PAREN@[14; 15) | ||
13 | WHITESPACE@[15; 16) | ||
14 | BLOCK_EXPR@[16; 19) | ||
15 | L_CURLY@[16; 17) | ||
16 | WHITESPACE@[17; 18) | ||
17 | R_CURLY@[18; 19) | ||
18 | WHITESPACE@[19; 20) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0000_empty.rs b/crates/libsyntax2/tests/data/parser/ok/0000_empty.rs new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0000_empty.rs | |||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0000_empty.txt b/crates/libsyntax2/tests/data/parser/ok/0000_empty.txt new file mode 100644 index 000000000..54be3e7bc --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0000_empty.txt | |||
@@ -0,0 +1 @@ | |||
FILE@[0; 0) | |||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0001_struct_item.rs b/crates/libsyntax2/tests/data/parser/ok/0001_struct_item.rs new file mode 100644 index 000000000..d3a8c1d23 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0001_struct_item.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | struct S { | ||
2 | |||
3 | } \ No newline at end of file | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0001_struct_item.txt b/crates/libsyntax2/tests/data/parser/ok/0001_struct_item.txt new file mode 100644 index 000000000..3d5b5cb7f --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0001_struct_item.txt | |||
@@ -0,0 +1,10 @@ | |||
1 | FILE@[0; 13) | ||
2 | STRUCT_ITEM@[0; 13) | ||
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; 12) | ||
10 | R_CURLY@[12; 13) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0002_struct_item_field.rs b/crates/libsyntax2/tests/data/parser/ok/0002_struct_item_field.rs new file mode 100644 index 000000000..cc3866d25 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0002_struct_item_field.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | struct S { | ||
2 | foo: u32 | ||
3 | } \ No newline at end of file | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0002_struct_item_field.txt b/crates/libsyntax2/tests/data/parser/ok/0002_struct_item_field.txt new file mode 100644 index 000000000..1129ce39e --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0002_struct_item_field.txt | |||
@@ -0,0 +1,21 @@ | |||
1 | FILE@[0; 25) | ||
2 | STRUCT_ITEM@[0; 25) | ||
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; 23) | ||
11 | NAME@[15; 18) | ||
12 | IDENT@[15; 18) "foo" | ||
13 | COLON@[18; 19) | ||
14 | WHITESPACE@[19; 20) | ||
15 | PATH_TYPE@[20; 23) | ||
16 | PATH@[20; 23) | ||
17 | PATH_SEGMENT@[20; 23) | ||
18 | NAME_REF@[20; 23) | ||
19 | IDENT@[20; 23) "u32" | ||
20 | WHITESPACE@[23; 24) | ||
21 | R_CURLY@[24; 25) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0004_file_shebang.rs b/crates/libsyntax2/tests/data/parser/ok/0004_file_shebang.rs new file mode 100644 index 000000000..53dc9e617 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0004_file_shebang.rs | |||
@@ -0,0 +1 @@ | |||
#!/use/bin/env rusti \ No newline at end of file | |||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0004_file_shebang.txt b/crates/libsyntax2/tests/data/parser/ok/0004_file_shebang.txt new file mode 100644 index 000000000..33055cf3d --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0004_file_shebang.txt | |||
@@ -0,0 +1,2 @@ | |||
1 | FILE@[0; 20) | ||
2 | SHEBANG@[0; 20) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0005_fn_item.rs b/crates/libsyntax2/tests/data/parser/ok/0005_fn_item.rs new file mode 100644 index 000000000..03210551c --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0005_fn_item.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | fn foo() { | ||
2 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0005_fn_item.txt b/crates/libsyntax2/tests/data/parser/ok/0005_fn_item.txt new file mode 100644 index 000000000..4ab93d408 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0005_fn_item.txt | |||
@@ -0,0 +1,15 @@ | |||
1 | FILE@[0; 13) | ||
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; 13) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0006_inner_attributes.rs b/crates/libsyntax2/tests/data/parser/ok/0006_inner_attributes.rs new file mode 100644 index 000000000..e81f8b1e8 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0006_inner_attributes.rs | |||
@@ -0,0 +1,10 @@ | |||
1 | #![attr] | ||
2 | #![attr(true)] | ||
3 | #![attr(ident)] | ||
4 | #![attr(ident, 100, true, "true", ident = 100, ident = "hello", ident(100))] | ||
5 | #![attr(100)] | ||
6 | #![attr(enabled = true)] | ||
7 | #![enabled(true)] | ||
8 | #![attr("hello")] | ||
9 | #![repr(C, align = 4)] | ||
10 | #![repr(C, align(4))] \ No newline at end of file | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0006_inner_attributes.txt b/crates/libsyntax2/tests/data/parser/ok/0006_inner_attributes.txt new file mode 100644 index 000000000..562c8d917 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0006_inner_attributes.txt | |||
@@ -0,0 +1,176 @@ | |||
1 | FILE@[0; 236) | ||
2 | ATTR@[0; 8) | ||
3 | POUND@[0; 1) | ||
4 | EXCL@[1; 2) | ||
5 | L_BRACK@[2; 3) | ||
6 | META_ITEM@[3; 7) | ||
7 | IDENT@[3; 7) "attr" | ||
8 | R_BRACK@[7; 8) | ||
9 | WHITESPACE@[8; 9) | ||
10 | ATTR@[9; 23) | ||
11 | POUND@[9; 10) | ||
12 | EXCL@[10; 11) | ||
13 | L_BRACK@[11; 12) | ||
14 | META_ITEM@[12; 22) | ||
15 | IDENT@[12; 16) "attr" | ||
16 | L_PAREN@[16; 17) | ||
17 | LITERAL@[17; 21) | ||
18 | TRUE_KW@[17; 21) | ||
19 | R_PAREN@[21; 22) | ||
20 | R_BRACK@[22; 23) | ||
21 | WHITESPACE@[23; 24) | ||
22 | ATTR@[24; 39) | ||
23 | POUND@[24; 25) | ||
24 | EXCL@[25; 26) | ||
25 | L_BRACK@[26; 27) | ||
26 | META_ITEM@[27; 38) | ||
27 | IDENT@[27; 31) "attr" | ||
28 | L_PAREN@[31; 32) | ||
29 | META_ITEM@[32; 37) | ||
30 | IDENT@[32; 37) "ident" | ||
31 | R_PAREN@[37; 38) | ||
32 | R_BRACK@[38; 39) | ||
33 | WHITESPACE@[39; 40) | ||
34 | ATTR@[40; 116) | ||
35 | POUND@[40; 41) | ||
36 | EXCL@[41; 42) | ||
37 | L_BRACK@[42; 43) | ||
38 | META_ITEM@[43; 115) | ||
39 | IDENT@[43; 47) "attr" | ||
40 | L_PAREN@[47; 48) | ||
41 | META_ITEM@[48; 53) | ||
42 | IDENT@[48; 53) "ident" | ||
43 | COMMA@[53; 54) | ||
44 | WHITESPACE@[54; 55) | ||
45 | LITERAL@[55; 58) | ||
46 | INT_NUMBER@[55; 58) "100" | ||
47 | COMMA@[58; 59) | ||
48 | WHITESPACE@[59; 60) | ||
49 | LITERAL@[60; 64) | ||
50 | TRUE_KW@[60; 64) | ||
51 | COMMA@[64; 65) | ||
52 | WHITESPACE@[65; 66) | ||
53 | LITERAL@[66; 72) | ||
54 | STRING@[66; 72) | ||
55 | COMMA@[72; 73) | ||
56 | WHITESPACE@[73; 74) | ||
57 | META_ITEM@[74; 85) | ||
58 | IDENT@[74; 79) "ident" | ||
59 | WHITESPACE@[79; 80) | ||
60 | EQ@[80; 81) | ||
61 | WHITESPACE@[81; 82) | ||
62 | LITERAL@[82; 85) | ||
63 | INT_NUMBER@[82; 85) "100" | ||
64 | COMMA@[85; 86) | ||
65 | WHITESPACE@[86; 87) | ||
66 | META_ITEM@[87; 102) | ||
67 | IDENT@[87; 92) "ident" | ||
68 | WHITESPACE@[92; 93) | ||
69 | EQ@[93; 94) | ||
70 | WHITESPACE@[94; 95) | ||
71 | LITERAL@[95; 102) | ||
72 | STRING@[95; 102) | ||
73 | COMMA@[102; 103) | ||
74 | WHITESPACE@[103; 104) | ||
75 | META_ITEM@[104; 114) | ||
76 | IDENT@[104; 109) "ident" | ||
77 | L_PAREN@[109; 110) | ||
78 | LITERAL@[110; 113) | ||
79 | INT_NUMBER@[110; 113) "100" | ||
80 | R_PAREN@[113; 114) | ||
81 | R_PAREN@[114; 115) | ||
82 | R_BRACK@[115; 116) | ||
83 | WHITESPACE@[116; 117) | ||
84 | ATTR@[117; 130) | ||
85 | POUND@[117; 118) | ||
86 | EXCL@[118; 119) | ||
87 | L_BRACK@[119; 120) | ||
88 | META_ITEM@[120; 129) | ||
89 | IDENT@[120; 124) "attr" | ||
90 | L_PAREN@[124; 125) | ||
91 | LITERAL@[125; 128) | ||
92 | INT_NUMBER@[125; 128) "100" | ||
93 | R_PAREN@[128; 129) | ||
94 | R_BRACK@[129; 130) | ||
95 | WHITESPACE@[130; 131) | ||
96 | ATTR@[131; 155) | ||
97 | POUND@[131; 132) | ||
98 | EXCL@[132; 133) | ||
99 | L_BRACK@[133; 134) | ||
100 | META_ITEM@[134; 154) | ||
101 | IDENT@[134; 138) "attr" | ||
102 | L_PAREN@[138; 139) | ||
103 | META_ITEM@[139; 153) | ||
104 | IDENT@[139; 146) "enabled" | ||
105 | WHITESPACE@[146; 147) | ||
106 | EQ@[147; 148) | ||
107 | WHITESPACE@[148; 149) | ||
108 | LITERAL@[149; 153) | ||
109 | TRUE_KW@[149; 153) | ||
110 | R_PAREN@[153; 154) | ||
111 | R_BRACK@[154; 155) | ||
112 | WHITESPACE@[155; 156) | ||
113 | ATTR@[156; 173) | ||
114 | POUND@[156; 157) | ||
115 | EXCL@[157; 158) | ||
116 | L_BRACK@[158; 159) | ||
117 | META_ITEM@[159; 172) | ||
118 | IDENT@[159; 166) "enabled" | ||
119 | L_PAREN@[166; 167) | ||
120 | LITERAL@[167; 171) | ||
121 | TRUE_KW@[167; 171) | ||
122 | R_PAREN@[171; 172) | ||
123 | R_BRACK@[172; 173) | ||
124 | WHITESPACE@[173; 174) | ||
125 | ATTR@[174; 191) | ||
126 | POUND@[174; 175) | ||
127 | EXCL@[175; 176) | ||
128 | L_BRACK@[176; 177) | ||
129 | META_ITEM@[177; 190) | ||
130 | IDENT@[177; 181) "attr" | ||
131 | L_PAREN@[181; 182) | ||
132 | LITERAL@[182; 189) | ||
133 | STRING@[182; 189) | ||
134 | R_PAREN@[189; 190) | ||
135 | R_BRACK@[190; 191) | ||
136 | WHITESPACE@[191; 192) | ||
137 | ATTR@[192; 214) | ||
138 | POUND@[192; 193) | ||
139 | EXCL@[193; 194) | ||
140 | L_BRACK@[194; 195) | ||
141 | META_ITEM@[195; 213) | ||
142 | IDENT@[195; 199) "repr" | ||
143 | L_PAREN@[199; 200) | ||
144 | META_ITEM@[200; 201) | ||
145 | IDENT@[200; 201) "C" | ||
146 | COMMA@[201; 202) | ||
147 | WHITESPACE@[202; 203) | ||
148 | META_ITEM@[203; 212) | ||
149 | IDENT@[203; 208) "align" | ||
150 | WHITESPACE@[208; 209) | ||
151 | EQ@[209; 210) | ||
152 | WHITESPACE@[210; 211) | ||
153 | LITERAL@[211; 212) | ||
154 | INT_NUMBER@[211; 212) "4" | ||
155 | R_PAREN@[212; 213) | ||
156 | R_BRACK@[213; 214) | ||
157 | WHITESPACE@[214; 215) | ||
158 | ATTR@[215; 236) | ||
159 | POUND@[215; 216) | ||
160 | EXCL@[216; 217) | ||
161 | L_BRACK@[217; 218) | ||
162 | META_ITEM@[218; 235) | ||
163 | IDENT@[218; 222) "repr" | ||
164 | L_PAREN@[222; 223) | ||
165 | META_ITEM@[223; 224) | ||
166 | IDENT@[223; 224) "C" | ||
167 | COMMA@[224; 225) | ||
168 | WHITESPACE@[225; 226) | ||
169 | META_ITEM@[226; 234) | ||
170 | IDENT@[226; 231) "align" | ||
171 | L_PAREN@[231; 232) | ||
172 | LITERAL@[232; 233) | ||
173 | INT_NUMBER@[232; 233) "4" | ||
174 | R_PAREN@[233; 234) | ||
175 | R_PAREN@[234; 235) | ||
176 | R_BRACK@[235; 236) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0007_extern_crate.rs b/crates/libsyntax2/tests/data/parser/ok/0007_extern_crate.rs new file mode 100644 index 000000000..3ce336676 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0007_extern_crate.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | extern crate foo; | ||
2 | extern crate foo as bar; | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0007_extern_crate.txt b/crates/libsyntax2/tests/data/parser/ok/0007_extern_crate.txt new file mode 100644 index 000000000..533af33c4 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0007_extern_crate.txt | |||
@@ -0,0 +1,25 @@ | |||
1 | FILE@[0; 43) | ||
2 | EXTERN_CRATE_ITEM@[0; 17) | ||
3 | EXTERN_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | CRATE_KW@[7; 12) | ||
6 | WHITESPACE@[12; 13) | ||
7 | NAME@[13; 16) | ||
8 | IDENT@[13; 16) "foo" | ||
9 | SEMI@[16; 17) | ||
10 | WHITESPACE@[17; 18) | ||
11 | EXTERN_CRATE_ITEM@[18; 42) | ||
12 | EXTERN_KW@[18; 24) | ||
13 | WHITESPACE@[24; 25) | ||
14 | CRATE_KW@[25; 30) | ||
15 | WHITESPACE@[30; 31) | ||
16 | NAME@[31; 34) | ||
17 | IDENT@[31; 34) "foo" | ||
18 | WHITESPACE@[34; 35) | ||
19 | ALIAS@[35; 41) | ||
20 | AS_KW@[35; 37) | ||
21 | WHITESPACE@[37; 38) | ||
22 | NAME@[38; 41) | ||
23 | IDENT@[38; 41) "bar" | ||
24 | SEMI@[41; 42) | ||
25 | WHITESPACE@[42; 43) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0008_mod_item.rs b/crates/libsyntax2/tests/data/parser/ok/0008_mod_item.rs new file mode 100644 index 000000000..d22993bc1 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0008_mod_item.rs | |||
@@ -0,0 +1,17 @@ | |||
1 | mod a; | ||
2 | |||
3 | mod b { | ||
4 | } | ||
5 | |||
6 | mod c { | ||
7 | fn foo() { | ||
8 | } | ||
9 | struct S {} | ||
10 | } | ||
11 | |||
12 | mod d { | ||
13 | #![attr] | ||
14 | mod e; | ||
15 | mod f { | ||
16 | } | ||
17 | } \ No newline at end of file | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0008_mod_item.txt b/crates/libsyntax2/tests/data/parser/ok/0008_mod_item.txt new file mode 100644 index 000000000..1dcaaedce --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0008_mod_item.txt | |||
@@ -0,0 +1,85 @@ | |||
1 | FILE@[0; 118) | ||
2 | MOD_ITEM@[0; 6) | ||
3 | MOD_KW@[0; 3) | ||
4 | WHITESPACE@[3; 4) | ||
5 | NAME@[4; 5) | ||
6 | IDENT@[4; 5) "a" | ||
7 | SEMI@[5; 6) | ||
8 | WHITESPACE@[6; 8) | ||
9 | MOD_ITEM@[8; 17) | ||
10 | MOD_KW@[8; 11) | ||
11 | WHITESPACE@[11; 12) | ||
12 | NAME@[12; 13) | ||
13 | IDENT@[12; 13) "b" | ||
14 | WHITESPACE@[13; 14) | ||
15 | L_CURLY@[14; 15) | ||
16 | WHITESPACE@[15; 16) | ||
17 | R_CURLY@[16; 17) | ||
18 | WHITESPACE@[17; 19) | ||
19 | MOD_ITEM@[19; 65) | ||
20 | MOD_KW@[19; 22) | ||
21 | WHITESPACE@[22; 23) | ||
22 | NAME@[23; 24) | ||
23 | IDENT@[23; 24) "c" | ||
24 | WHITESPACE@[24; 25) | ||
25 | L_CURLY@[25; 26) | ||
26 | WHITESPACE@[26; 31) | ||
27 | FUNCTION@[31; 47) | ||
28 | FN_KW@[31; 33) | ||
29 | WHITESPACE@[33; 34) | ||
30 | NAME@[34; 37) | ||
31 | IDENT@[34; 37) "foo" | ||
32 | PARAM_LIST@[37; 39) | ||
33 | L_PAREN@[37; 38) | ||
34 | R_PAREN@[38; 39) | ||
35 | WHITESPACE@[39; 40) | ||
36 | BLOCK_EXPR@[40; 47) | ||
37 | L_CURLY@[40; 41) | ||
38 | WHITESPACE@[41; 46) | ||
39 | R_CURLY@[46; 47) | ||
40 | WHITESPACE@[47; 52) | ||
41 | STRUCT_ITEM@[52; 63) | ||
42 | STRUCT_KW@[52; 58) | ||
43 | WHITESPACE@[58; 59) | ||
44 | NAME@[59; 60) | ||
45 | IDENT@[59; 60) "S" | ||
46 | WHITESPACE@[60; 61) | ||
47 | L_CURLY@[61; 62) | ||
48 | R_CURLY@[62; 63) | ||
49 | WHITESPACE@[63; 64) | ||
50 | R_CURLY@[64; 65) | ||
51 | WHITESPACE@[65; 67) | ||
52 | MOD_ITEM@[67; 118) | ||
53 | MOD_KW@[67; 70) | ||
54 | WHITESPACE@[70; 71) | ||
55 | NAME@[71; 72) | ||
56 | IDENT@[71; 72) "d" | ||
57 | WHITESPACE@[72; 73) | ||
58 | L_CURLY@[73; 74) | ||
59 | WHITESPACE@[74; 79) | ||
60 | ATTR@[79; 87) | ||
61 | POUND@[79; 80) | ||
62 | EXCL@[80; 81) | ||
63 | L_BRACK@[81; 82) | ||
64 | META_ITEM@[82; 86) | ||
65 | IDENT@[82; 86) "attr" | ||
66 | R_BRACK@[86; 87) | ||
67 | WHITESPACE@[87; 92) | ||
68 | MOD_ITEM@[92; 98) | ||
69 | MOD_KW@[92; 95) | ||
70 | WHITESPACE@[95; 96) | ||
71 | NAME@[96; 97) | ||
72 | IDENT@[96; 97) "e" | ||
73 | SEMI@[97; 98) | ||
74 | WHITESPACE@[98; 103) | ||
75 | MOD_ITEM@[103; 116) | ||
76 | MOD_KW@[103; 106) | ||
77 | WHITESPACE@[106; 107) | ||
78 | NAME@[107; 108) | ||
79 | IDENT@[107; 108) "f" | ||
80 | WHITESPACE@[108; 109) | ||
81 | L_CURLY@[109; 110) | ||
82 | WHITESPACE@[110; 115) | ||
83 | R_CURLY@[115; 116) | ||
84 | WHITESPACE@[116; 117) | ||
85 | R_CURLY@[117; 118) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0009_use_item.rs b/crates/libsyntax2/tests/data/parser/ok/0009_use_item.rs new file mode 100644 index 000000000..05a6aff83 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0009_use_item.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | use foo; | ||
2 | use ::bar; \ No newline at end of file | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0009_use_item.txt b/crates/libsyntax2/tests/data/parser/ok/0009_use_item.txt new file mode 100644 index 000000000..8f850cd1c --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0009_use_item.txt | |||
@@ -0,0 +1,21 @@ | |||
1 | FILE@[0; 19) | ||
2 | USE_ITEM@[0; 8) | ||
3 | USE_KW@[0; 3) | ||
4 | WHITESPACE@[3; 4) | ||
5 | USE_TREE@[4; 7) | ||
6 | PATH@[4; 7) | ||
7 | PATH_SEGMENT@[4; 7) | ||
8 | NAME_REF@[4; 7) | ||
9 | IDENT@[4; 7) "foo" | ||
10 | SEMI@[7; 8) | ||
11 | WHITESPACE@[8; 9) | ||
12 | USE_ITEM@[9; 19) | ||
13 | USE_KW@[9; 12) | ||
14 | WHITESPACE@[12; 13) | ||
15 | USE_TREE@[13; 18) | ||
16 | PATH@[13; 18) | ||
17 | PATH_SEGMENT@[13; 18) | ||
18 | COLONCOLON@[13; 15) | ||
19 | NAME_REF@[15; 18) | ||
20 | IDENT@[15; 18) "bar" | ||
21 | SEMI@[18; 19) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0010_use_path_segments.rs b/crates/libsyntax2/tests/data/parser/ok/0010_use_path_segments.rs new file mode 100644 index 000000000..1e71b7a6c --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0010_use_path_segments.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | use ::foo::bar::baz; | ||
2 | use foo::bar::baz; | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0010_use_path_segments.txt b/crates/libsyntax2/tests/data/parser/ok/0010_use_path_segments.txt new file mode 100644 index 000000000..03ec342c2 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0010_use_path_segments.txt | |||
@@ -0,0 +1,42 @@ | |||
1 | FILE@[0; 40) | ||
2 | USE_ITEM@[0; 20) | ||
3 | USE_KW@[0; 3) | ||
4 | WHITESPACE@[3; 4) | ||
5 | USE_TREE@[4; 19) | ||
6 | PATH@[4; 19) | ||
7 | PATH@[4; 14) | ||
8 | PATH@[4; 9) | ||
9 | PATH_SEGMENT@[4; 9) | ||
10 | COLONCOLON@[4; 6) | ||
11 | NAME_REF@[6; 9) | ||
12 | IDENT@[6; 9) "foo" | ||
13 | COLONCOLON@[9; 11) | ||
14 | PATH_SEGMENT@[11; 14) | ||
15 | NAME_REF@[11; 14) | ||
16 | IDENT@[11; 14) "bar" | ||
17 | COLONCOLON@[14; 16) | ||
18 | PATH_SEGMENT@[16; 19) | ||
19 | NAME_REF@[16; 19) | ||
20 | IDENT@[16; 19) "baz" | ||
21 | SEMI@[19; 20) | ||
22 | WHITESPACE@[20; 21) | ||
23 | USE_ITEM@[21; 39) | ||
24 | USE_KW@[21; 24) | ||
25 | WHITESPACE@[24; 25) | ||
26 | USE_TREE@[25; 38) | ||
27 | PATH@[25; 38) | ||
28 | PATH@[25; 33) | ||
29 | PATH@[25; 28) | ||
30 | PATH_SEGMENT@[25; 28) | ||
31 | NAME_REF@[25; 28) | ||
32 | IDENT@[25; 28) "foo" | ||
33 | COLONCOLON@[28; 30) | ||
34 | PATH_SEGMENT@[30; 33) | ||
35 | NAME_REF@[30; 33) | ||
36 | IDENT@[30; 33) "bar" | ||
37 | COLONCOLON@[33; 35) | ||
38 | PATH_SEGMENT@[35; 38) | ||
39 | NAME_REF@[35; 38) | ||
40 | IDENT@[35; 38) "baz" | ||
41 | SEMI@[38; 39) | ||
42 | WHITESPACE@[39; 40) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0011_outer_attribute.rs b/crates/libsyntax2/tests/data/parser/ok/0011_outer_attribute.rs new file mode 100644 index 000000000..8b80c0d90 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0011_outer_attribute.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | #[cfg(test)] | ||
2 | #[ignore] | ||
3 | fn foo() {} | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0011_outer_attribute.txt b/crates/libsyntax2/tests/data/parser/ok/0011_outer_attribute.txt new file mode 100644 index 000000000..9824c9083 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0011_outer_attribute.txt | |||
@@ -0,0 +1,32 @@ | |||
1 | FILE@[0; 35) | ||
2 | FUNCTION@[0; 34) | ||
3 | ATTR@[0; 12) | ||
4 | POUND@[0; 1) | ||
5 | L_BRACK@[1; 2) | ||
6 | META_ITEM@[2; 11) | ||
7 | IDENT@[2; 5) "cfg" | ||
8 | L_PAREN@[5; 6) | ||
9 | META_ITEM@[6; 10) | ||
10 | IDENT@[6; 10) "test" | ||
11 | R_PAREN@[10; 11) | ||
12 | R_BRACK@[11; 12) | ||
13 | WHITESPACE@[12; 13) | ||
14 | ATTR@[13; 22) | ||
15 | POUND@[13; 14) | ||
16 | L_BRACK@[14; 15) | ||
17 | META_ITEM@[15; 21) | ||
18 | IDENT@[15; 21) "ignore" | ||
19 | R_BRACK@[21; 22) | ||
20 | WHITESPACE@[22; 23) | ||
21 | FN_KW@[23; 25) | ||
22 | WHITESPACE@[25; 26) | ||
23 | NAME@[26; 29) | ||
24 | IDENT@[26; 29) "foo" | ||
25 | PARAM_LIST@[29; 31) | ||
26 | L_PAREN@[29; 30) | ||
27 | R_PAREN@[30; 31) | ||
28 | WHITESPACE@[31; 32) | ||
29 | BLOCK_EXPR@[32; 34) | ||
30 | L_CURLY@[32; 33) | ||
31 | R_CURLY@[33; 34) | ||
32 | WHITESPACE@[34; 35) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0012_visibility.rs b/crates/libsyntax2/tests/data/parser/ok/0012_visibility.rs new file mode 100644 index 000000000..75b1db121 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0012_visibility.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | fn a() {} | ||
2 | pub fn b() {} | ||
3 | pub(crate) fn c() {} | ||
4 | pub(super) fn d() {} | ||
5 | pub(in foo::bar::baz) fn e() {} | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0012_visibility.txt b/crates/libsyntax2/tests/data/parser/ok/0012_visibility.txt new file mode 100644 index 000000000..af0c59543 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0012_visibility.txt | |||
@@ -0,0 +1,102 @@ | |||
1 | FILE@[0; 98) | ||
2 | FUNCTION@[0; 9) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 4) | ||
6 | IDENT@[3; 4) "a" | ||
7 | PARAM_LIST@[4; 6) | ||
8 | L_PAREN@[4; 5) | ||
9 | R_PAREN@[5; 6) | ||
10 | WHITESPACE@[6; 7) | ||
11 | BLOCK_EXPR@[7; 9) | ||
12 | L_CURLY@[7; 8) | ||
13 | R_CURLY@[8; 9) | ||
14 | WHITESPACE@[9; 10) | ||
15 | FUNCTION@[10; 23) | ||
16 | VISIBILITY@[10; 13) | ||
17 | PUB_KW@[10; 13) | ||
18 | WHITESPACE@[13; 14) | ||
19 | FN_KW@[14; 16) | ||
20 | WHITESPACE@[16; 17) | ||
21 | NAME@[17; 18) | ||
22 | IDENT@[17; 18) "b" | ||
23 | PARAM_LIST@[18; 20) | ||
24 | L_PAREN@[18; 19) | ||
25 | R_PAREN@[19; 20) | ||
26 | WHITESPACE@[20; 21) | ||
27 | BLOCK_EXPR@[21; 23) | ||
28 | L_CURLY@[21; 22) | ||
29 | R_CURLY@[22; 23) | ||
30 | WHITESPACE@[23; 24) | ||
31 | FUNCTION@[24; 44) | ||
32 | VISIBILITY@[24; 34) | ||
33 | PUB_KW@[24; 27) | ||
34 | L_PAREN@[27; 28) | ||
35 | CRATE_KW@[28; 33) | ||
36 | R_PAREN@[33; 34) | ||
37 | WHITESPACE@[34; 35) | ||
38 | FN_KW@[35; 37) | ||
39 | WHITESPACE@[37; 38) | ||
40 | NAME@[38; 39) | ||
41 | IDENT@[38; 39) "c" | ||
42 | PARAM_LIST@[39; 41) | ||
43 | L_PAREN@[39; 40) | ||
44 | R_PAREN@[40; 41) | ||
45 | WHITESPACE@[41; 42) | ||
46 | BLOCK_EXPR@[42; 44) | ||
47 | L_CURLY@[42; 43) | ||
48 | R_CURLY@[43; 44) | ||
49 | WHITESPACE@[44; 45) | ||
50 | FUNCTION@[45; 65) | ||
51 | VISIBILITY@[45; 55) | ||
52 | PUB_KW@[45; 48) | ||
53 | L_PAREN@[48; 49) | ||
54 | SUPER_KW@[49; 54) | ||
55 | R_PAREN@[54; 55) | ||
56 | WHITESPACE@[55; 56) | ||
57 | FN_KW@[56; 58) | ||
58 | WHITESPACE@[58; 59) | ||
59 | NAME@[59; 60) | ||
60 | IDENT@[59; 60) "d" | ||
61 | PARAM_LIST@[60; 62) | ||
62 | L_PAREN@[60; 61) | ||
63 | R_PAREN@[61; 62) | ||
64 | WHITESPACE@[62; 63) | ||
65 | BLOCK_EXPR@[63; 65) | ||
66 | L_CURLY@[63; 64) | ||
67 | R_CURLY@[64; 65) | ||
68 | WHITESPACE@[65; 66) | ||
69 | FUNCTION@[66; 97) | ||
70 | VISIBILITY@[66; 87) | ||
71 | PUB_KW@[66; 69) | ||
72 | L_PAREN@[69; 70) | ||
73 | IN_KW@[70; 72) | ||
74 | WHITESPACE@[72; 73) | ||
75 | PATH@[73; 86) | ||
76 | PATH@[73; 81) | ||
77 | PATH@[73; 76) | ||
78 | PATH_SEGMENT@[73; 76) | ||
79 | NAME_REF@[73; 76) | ||
80 | IDENT@[73; 76) "foo" | ||
81 | COLONCOLON@[76; 78) | ||
82 | PATH_SEGMENT@[78; 81) | ||
83 | NAME_REF@[78; 81) | ||
84 | IDENT@[78; 81) "bar" | ||
85 | COLONCOLON@[81; 83) | ||
86 | PATH_SEGMENT@[83; 86) | ||
87 | NAME_REF@[83; 86) | ||
88 | IDENT@[83; 86) "baz" | ||
89 | R_PAREN@[86; 87) | ||
90 | WHITESPACE@[87; 88) | ||
91 | FN_KW@[88; 90) | ||
92 | WHITESPACE@[90; 91) | ||
93 | NAME@[91; 92) | ||
94 | IDENT@[91; 92) "e" | ||
95 | PARAM_LIST@[92; 94) | ||
96 | L_PAREN@[92; 93) | ||
97 | R_PAREN@[93; 94) | ||
98 | WHITESPACE@[94; 95) | ||
99 | BLOCK_EXPR@[95; 97) | ||
100 | L_CURLY@[95; 96) | ||
101 | R_CURLY@[96; 97) | ||
102 | WHITESPACE@[97; 98) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0013_use_path_self_super.rs b/crates/libsyntax2/tests/data/parser/ok/0013_use_path_self_super.rs new file mode 100644 index 000000000..faf6a42c7 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0013_use_path_self_super.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | use self::foo; | ||
2 | use super::super::bar; | ||
3 | use ::self::a::super::bar; | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0013_use_path_self_super.txt b/crates/libsyntax2/tests/data/parser/ok/0013_use_path_self_super.txt new file mode 100644 index 000000000..5ed27ca37 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0013_use_path_self_super.txt | |||
@@ -0,0 +1,57 @@ | |||
1 | FILE@[0; 65) | ||
2 | USE_ITEM@[0; 14) | ||
3 | USE_KW@[0; 3) | ||
4 | WHITESPACE@[3; 4) | ||
5 | USE_TREE@[4; 13) | ||
6 | PATH@[4; 13) | ||
7 | PATH@[4; 8) | ||
8 | PATH_SEGMENT@[4; 8) | ||
9 | SELF_KW@[4; 8) | ||
10 | COLONCOLON@[8; 10) | ||
11 | PATH_SEGMENT@[10; 13) | ||
12 | NAME_REF@[10; 13) | ||
13 | IDENT@[10; 13) "foo" | ||
14 | SEMI@[13; 14) | ||
15 | WHITESPACE@[14; 15) | ||
16 | USE_ITEM@[15; 37) | ||
17 | USE_KW@[15; 18) | ||
18 | WHITESPACE@[18; 19) | ||
19 | USE_TREE@[19; 36) | ||
20 | PATH@[19; 36) | ||
21 | PATH@[19; 31) | ||
22 | PATH@[19; 24) | ||
23 | PATH_SEGMENT@[19; 24) | ||
24 | SUPER_KW@[19; 24) | ||
25 | COLONCOLON@[24; 26) | ||
26 | PATH_SEGMENT@[26; 31) | ||
27 | SUPER_KW@[26; 31) | ||
28 | COLONCOLON@[31; 33) | ||
29 | PATH_SEGMENT@[33; 36) | ||
30 | NAME_REF@[33; 36) | ||
31 | IDENT@[33; 36) "bar" | ||
32 | SEMI@[36; 37) | ||
33 | WHITESPACE@[37; 38) | ||
34 | USE_ITEM@[38; 64) | ||
35 | USE_KW@[38; 41) | ||
36 | WHITESPACE@[41; 42) | ||
37 | USE_TREE@[42; 63) | ||
38 | PATH@[42; 63) | ||
39 | PATH@[42; 58) | ||
40 | PATH@[42; 51) | ||
41 | PATH@[42; 48) | ||
42 | PATH_SEGMENT@[42; 48) | ||
43 | COLONCOLON@[42; 44) | ||
44 | SELF_KW@[44; 48) | ||
45 | COLONCOLON@[48; 50) | ||
46 | PATH_SEGMENT@[50; 51) | ||
47 | NAME_REF@[50; 51) | ||
48 | IDENT@[50; 51) "a" | ||
49 | COLONCOLON@[51; 53) | ||
50 | PATH_SEGMENT@[53; 58) | ||
51 | SUPER_KW@[53; 58) | ||
52 | COLONCOLON@[58; 60) | ||
53 | PATH_SEGMENT@[60; 63) | ||
54 | NAME_REF@[60; 63) | ||
55 | IDENT@[60; 63) "bar" | ||
56 | SEMI@[63; 64) | ||
57 | WHITESPACE@[64; 65) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0014_use_tree.rs b/crates/libsyntax2/tests/data/parser/ok/0014_use_tree.rs new file mode 100644 index 000000000..5e4aa3a33 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0014_use_tree.rs | |||
@@ -0,0 +1,7 @@ | |||
1 | use *; | ||
2 | use ::*; | ||
3 | use ::{}; | ||
4 | use {}; | ||
5 | use foo::*; | ||
6 | use foo::{}; | ||
7 | use ::foo::{a, b, c}; | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0014_use_tree.txt b/crates/libsyntax2/tests/data/parser/ok/0014_use_tree.txt new file mode 100644 index 000000000..730d5539b --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0014_use_tree.txt | |||
@@ -0,0 +1,91 @@ | |||
1 | FILE@[0; 81) | ||
2 | USE_ITEM@[0; 6) | ||
3 | USE_KW@[0; 3) | ||
4 | WHITESPACE@[3; 4) | ||
5 | USE_TREE@[4; 5) | ||
6 | STAR@[4; 5) | ||
7 | SEMI@[5; 6) | ||
8 | WHITESPACE@[6; 7) | ||
9 | USE_ITEM@[7; 15) | ||
10 | USE_KW@[7; 10) | ||
11 | WHITESPACE@[10; 11) | ||
12 | USE_TREE@[11; 14) | ||
13 | COLONCOLON@[11; 13) | ||
14 | STAR@[13; 14) | ||
15 | SEMI@[14; 15) | ||
16 | WHITESPACE@[15; 16) | ||
17 | USE_ITEM@[16; 25) | ||
18 | USE_KW@[16; 19) | ||
19 | WHITESPACE@[19; 20) | ||
20 | USE_TREE@[20; 24) | ||
21 | COLONCOLON@[20; 22) | ||
22 | L_CURLY@[22; 23) | ||
23 | R_CURLY@[23; 24) | ||
24 | SEMI@[24; 25) | ||
25 | WHITESPACE@[25; 26) | ||
26 | USE_ITEM@[26; 33) | ||
27 | USE_KW@[26; 29) | ||
28 | WHITESPACE@[29; 30) | ||
29 | USE_TREE@[30; 32) | ||
30 | L_CURLY@[30; 31) | ||
31 | R_CURLY@[31; 32) | ||
32 | SEMI@[32; 33) | ||
33 | WHITESPACE@[33; 34) | ||
34 | USE_ITEM@[34; 45) | ||
35 | USE_KW@[34; 37) | ||
36 | WHITESPACE@[37; 38) | ||
37 | USE_TREE@[38; 44) | ||
38 | PATH@[38; 41) | ||
39 | PATH_SEGMENT@[38; 41) | ||
40 | NAME_REF@[38; 41) | ||
41 | IDENT@[38; 41) "foo" | ||
42 | COLONCOLON@[41; 43) | ||
43 | STAR@[43; 44) | ||
44 | SEMI@[44; 45) | ||
45 | WHITESPACE@[45; 46) | ||
46 | USE_ITEM@[46; 58) | ||
47 | USE_KW@[46; 49) | ||
48 | WHITESPACE@[49; 50) | ||
49 | USE_TREE@[50; 57) | ||
50 | PATH@[50; 53) | ||
51 | PATH_SEGMENT@[50; 53) | ||
52 | NAME_REF@[50; 53) | ||
53 | IDENT@[50; 53) "foo" | ||
54 | COLONCOLON@[53; 55) | ||
55 | L_CURLY@[55; 56) | ||
56 | R_CURLY@[56; 57) | ||
57 | SEMI@[57; 58) | ||
58 | WHITESPACE@[58; 59) | ||
59 | USE_ITEM@[59; 80) | ||
60 | USE_KW@[59; 62) | ||
61 | WHITESPACE@[62; 63) | ||
62 | USE_TREE@[63; 79) | ||
63 | PATH@[63; 68) | ||
64 | PATH_SEGMENT@[63; 68) | ||
65 | COLONCOLON@[63; 65) | ||
66 | NAME_REF@[65; 68) | ||
67 | IDENT@[65; 68) "foo" | ||
68 | COLONCOLON@[68; 70) | ||
69 | L_CURLY@[70; 71) | ||
70 | USE_TREE@[71; 72) | ||
71 | PATH@[71; 72) | ||
72 | PATH_SEGMENT@[71; 72) | ||
73 | NAME_REF@[71; 72) | ||
74 | IDENT@[71; 72) "a" | ||
75 | COMMA@[72; 73) | ||
76 | WHITESPACE@[73; 74) | ||
77 | USE_TREE@[74; 75) | ||
78 | PATH@[74; 75) | ||
79 | PATH_SEGMENT@[74; 75) | ||
80 | NAME_REF@[74; 75) | ||
81 | IDENT@[74; 75) "b" | ||
82 | COMMA@[75; 76) | ||
83 | WHITESPACE@[76; 77) | ||
84 | USE_TREE@[77; 78) | ||
85 | PATH@[77; 78) | ||
86 | PATH_SEGMENT@[77; 78) | ||
87 | NAME_REF@[77; 78) | ||
88 | IDENT@[77; 78) "c" | ||
89 | R_CURLY@[78; 79) | ||
90 | SEMI@[79; 80) | ||
91 | WHITESPACE@[80; 81) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0015_use_tree.rs b/crates/libsyntax2/tests/data/parser/ok/0015_use_tree.rs new file mode 100644 index 000000000..46a0783a2 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0015_use_tree.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | use foo as bar; | ||
2 | use foo::{a as b, *, ::*, ::foo as x}; | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0015_use_tree.txt b/crates/libsyntax2/tests/data/parser/ok/0015_use_tree.txt new file mode 100644 index 000000000..4438e417b --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0015_use_tree.txt | |||
@@ -0,0 +1,64 @@ | |||
1 | FILE@[0; 55) | ||
2 | USE_ITEM@[0; 15) | ||
3 | USE_KW@[0; 3) | ||
4 | WHITESPACE@[3; 4) | ||
5 | USE_TREE@[4; 14) | ||
6 | PATH@[4; 7) | ||
7 | PATH_SEGMENT@[4; 7) | ||
8 | NAME_REF@[4; 7) | ||
9 | IDENT@[4; 7) "foo" | ||
10 | WHITESPACE@[7; 8) | ||
11 | ALIAS@[8; 14) | ||
12 | AS_KW@[8; 10) | ||
13 | WHITESPACE@[10; 11) | ||
14 | NAME@[11; 14) | ||
15 | IDENT@[11; 14) "bar" | ||
16 | SEMI@[14; 15) | ||
17 | WHITESPACE@[15; 16) | ||
18 | USE_ITEM@[16; 54) | ||
19 | USE_KW@[16; 19) | ||
20 | WHITESPACE@[19; 20) | ||
21 | USE_TREE@[20; 53) | ||
22 | PATH@[20; 23) | ||
23 | PATH_SEGMENT@[20; 23) | ||
24 | NAME_REF@[20; 23) | ||
25 | IDENT@[20; 23) "foo" | ||
26 | COLONCOLON@[23; 25) | ||
27 | L_CURLY@[25; 26) | ||
28 | USE_TREE@[26; 32) | ||
29 | PATH@[26; 27) | ||
30 | PATH_SEGMENT@[26; 27) | ||
31 | NAME_REF@[26; 27) | ||
32 | IDENT@[26; 27) "a" | ||
33 | WHITESPACE@[27; 28) | ||
34 | ALIAS@[28; 32) | ||
35 | AS_KW@[28; 30) | ||
36 | WHITESPACE@[30; 31) | ||
37 | NAME@[31; 32) | ||
38 | IDENT@[31; 32) "b" | ||
39 | COMMA@[32; 33) | ||
40 | WHITESPACE@[33; 34) | ||
41 | USE_TREE@[34; 35) | ||
42 | STAR@[34; 35) | ||
43 | COMMA@[35; 36) | ||
44 | WHITESPACE@[36; 37) | ||
45 | USE_TREE@[37; 40) | ||
46 | COLONCOLON@[37; 39) | ||
47 | STAR@[39; 40) | ||
48 | COMMA@[40; 41) | ||
49 | WHITESPACE@[41; 42) | ||
50 | USE_TREE@[42; 52) | ||
51 | PATH@[42; 47) | ||
52 | PATH_SEGMENT@[42; 47) | ||
53 | COLONCOLON@[42; 44) | ||
54 | NAME_REF@[44; 47) | ||
55 | IDENT@[44; 47) "foo" | ||
56 | WHITESPACE@[47; 48) | ||
57 | ALIAS@[48; 52) | ||
58 | AS_KW@[48; 50) | ||
59 | WHITESPACE@[50; 51) | ||
60 | NAME@[51; 52) | ||
61 | IDENT@[51; 52) "x" | ||
62 | R_CURLY@[52; 53) | ||
63 | SEMI@[53; 54) | ||
64 | WHITESPACE@[54; 55) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0016_struct_flavors.rs b/crates/libsyntax2/tests/data/parser/ok/0016_struct_flavors.rs new file mode 100644 index 000000000..69638350c --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0016_struct_flavors.rs | |||
@@ -0,0 +1,10 @@ | |||
1 | struct A; | ||
2 | struct B {} | ||
3 | struct C(); | ||
4 | |||
5 | struct D { | ||
6 | a: u32, | ||
7 | pub b: u32 | ||
8 | } | ||
9 | |||
10 | struct E(pub x, y,); | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0016_struct_flavors.txt b/crates/libsyntax2/tests/data/parser/ok/0016_struct_flavors.txt new file mode 100644 index 000000000..5dd480d1b --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0016_struct_flavors.txt | |||
@@ -0,0 +1,89 @@ | |||
1 | FILE@[0; 97) | ||
2 | STRUCT_ITEM@[0; 9) | ||
3 | STRUCT_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | NAME@[7; 8) | ||
6 | IDENT@[7; 8) "A" | ||
7 | SEMI@[8; 9) | ||
8 | WHITESPACE@[9; 10) | ||
9 | STRUCT_ITEM@[10; 21) | ||
10 | STRUCT_KW@[10; 16) | ||
11 | WHITESPACE@[16; 17) | ||
12 | NAME@[17; 18) | ||
13 | IDENT@[17; 18) "B" | ||
14 | WHITESPACE@[18; 19) | ||
15 | L_CURLY@[19; 20) | ||
16 | R_CURLY@[20; 21) | ||
17 | WHITESPACE@[21; 22) | ||
18 | STRUCT_ITEM@[22; 33) | ||
19 | STRUCT_KW@[22; 28) | ||
20 | WHITESPACE@[28; 29) | ||
21 | NAME@[29; 30) | ||
22 | IDENT@[29; 30) "C" | ||
23 | L_PAREN@[30; 31) | ||
24 | R_PAREN@[31; 32) | ||
25 | SEMI@[32; 33) | ||
26 | WHITESPACE@[33; 35) | ||
27 | STRUCT_ITEM@[35; 74) | ||
28 | STRUCT_KW@[35; 41) | ||
29 | WHITESPACE@[41; 42) | ||
30 | NAME@[42; 43) | ||
31 | IDENT@[42; 43) "D" | ||
32 | WHITESPACE@[43; 44) | ||
33 | L_CURLY@[44; 45) | ||
34 | WHITESPACE@[45; 50) | ||
35 | NAMED_FIELD@[50; 56) | ||
36 | NAME@[50; 51) | ||
37 | IDENT@[50; 51) "a" | ||
38 | COLON@[51; 52) | ||
39 | WHITESPACE@[52; 53) | ||
40 | PATH_TYPE@[53; 56) | ||
41 | PATH@[53; 56) | ||
42 | PATH_SEGMENT@[53; 56) | ||
43 | NAME_REF@[53; 56) | ||
44 | IDENT@[53; 56) "u32" | ||
45 | COMMA@[56; 57) | ||
46 | WHITESPACE@[57; 62) | ||
47 | NAMED_FIELD@[62; 72) | ||
48 | VISIBILITY@[62; 65) | ||
49 | PUB_KW@[62; 65) | ||
50 | WHITESPACE@[65; 66) | ||
51 | NAME@[66; 67) | ||
52 | IDENT@[66; 67) "b" | ||
53 | COLON@[67; 68) | ||
54 | WHITESPACE@[68; 69) | ||
55 | PATH_TYPE@[69; 72) | ||
56 | PATH@[69; 72) | ||
57 | PATH_SEGMENT@[69; 72) | ||
58 | NAME_REF@[69; 72) | ||
59 | IDENT@[69; 72) "u32" | ||
60 | WHITESPACE@[72; 73) | ||
61 | R_CURLY@[73; 74) | ||
62 | WHITESPACE@[74; 76) | ||
63 | STRUCT_ITEM@[76; 96) | ||
64 | STRUCT_KW@[76; 82) | ||
65 | WHITESPACE@[82; 83) | ||
66 | NAME@[83; 84) | ||
67 | IDENT@[83; 84) "E" | ||
68 | L_PAREN@[84; 85) | ||
69 | POS_FIELD@[85; 90) | ||
70 | VISIBILITY@[85; 88) | ||
71 | PUB_KW@[85; 88) | ||
72 | WHITESPACE@[88; 89) | ||
73 | PATH_TYPE@[89; 90) | ||
74 | PATH@[89; 90) | ||
75 | PATH_SEGMENT@[89; 90) | ||
76 | NAME_REF@[89; 90) | ||
77 | IDENT@[89; 90) "x" | ||
78 | COMMA@[90; 91) | ||
79 | WHITESPACE@[91; 92) | ||
80 | POS_FIELD@[92; 93) | ||
81 | PATH_TYPE@[92; 93) | ||
82 | PATH@[92; 93) | ||
83 | PATH_SEGMENT@[92; 93) | ||
84 | NAME_REF@[92; 93) | ||
85 | IDENT@[92; 93) "y" | ||
86 | COMMA@[93; 94) | ||
87 | R_PAREN@[94; 95) | ||
88 | SEMI@[95; 96) | ||
89 | WHITESPACE@[96; 97) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0017_attr_trailing_comma.rs b/crates/libsyntax2/tests/data/parser/ok/0017_attr_trailing_comma.rs new file mode 100644 index 000000000..fe0a7bb97 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0017_attr_trailing_comma.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | #[foo(a,)] | ||
2 | fn foo() {} | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0017_attr_trailing_comma.txt b/crates/libsyntax2/tests/data/parser/ok/0017_attr_trailing_comma.txt new file mode 100644 index 000000000..69724cdc8 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0017_attr_trailing_comma.txt | |||
@@ -0,0 +1,26 @@ | |||
1 | FILE@[0; 23) | ||
2 | FUNCTION@[0; 22) | ||
3 | ATTR@[0; 10) | ||
4 | POUND@[0; 1) | ||
5 | L_BRACK@[1; 2) | ||
6 | META_ITEM@[2; 9) | ||
7 | IDENT@[2; 5) "foo" | ||
8 | L_PAREN@[5; 6) | ||
9 | META_ITEM@[6; 7) | ||
10 | IDENT@[6; 7) "a" | ||
11 | COMMA@[7; 8) | ||
12 | R_PAREN@[8; 9) | ||
13 | R_BRACK@[9; 10) | ||
14 | WHITESPACE@[10; 11) | ||
15 | FN_KW@[11; 13) | ||
16 | WHITESPACE@[13; 14) | ||
17 | NAME@[14; 17) | ||
18 | IDENT@[14; 17) "foo" | ||
19 | PARAM_LIST@[17; 19) | ||
20 | L_PAREN@[17; 18) | ||
21 | R_PAREN@[18; 19) | ||
22 | WHITESPACE@[19; 20) | ||
23 | BLOCK_EXPR@[20; 22) | ||
24 | L_CURLY@[20; 21) | ||
25 | R_CURLY@[21; 22) | ||
26 | WHITESPACE@[22; 23) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0018_struct_type_params.rs b/crates/libsyntax2/tests/data/parser/ok/0018_struct_type_params.rs new file mode 100644 index 000000000..88c544923 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0018_struct_type_params.rs | |||
@@ -0,0 +1,17 @@ | |||
1 | struct S1<T>; | ||
2 | struct S2<T>(u32); | ||
3 | struct S3<T> { u: u32 } | ||
4 | |||
5 | struct S4<>; | ||
6 | struct S5<'a>; | ||
7 | struct S6<'a:>; | ||
8 | struct S7<'a: 'b>; | ||
9 | struct S8<'a: 'b + >; | ||
10 | struct S9<'a: 'b + 'c>; | ||
11 | struct S10<'a,>; | ||
12 | struct S11<'a, 'b>; | ||
13 | struct S12<'a: 'b+, 'b: 'c,>; | ||
14 | |||
15 | struct S13<T>; | ||
16 | struct S14<T, U>; | ||
17 | struct S15<'a, T, U>; | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0018_struct_type_params.txt b/crates/libsyntax2/tests/data/parser/ok/0018_struct_type_params.txt new file mode 100644 index 000000000..6457c2639 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0018_struct_type_params.txt | |||
@@ -0,0 +1,255 @@ | |||
1 | FILE@[0; 290) | ||
2 | STRUCT_ITEM@[0; 13) | ||
3 | STRUCT_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | NAME@[7; 9) | ||
6 | IDENT@[7; 9) "S1" | ||
7 | TYPE_PARAM_LIST@[9; 12) | ||
8 | L_ANGLE@[9; 10) | ||
9 | TYPE_PARAM@[10; 11) | ||
10 | NAME@[10; 11) | ||
11 | IDENT@[10; 11) "T" | ||
12 | R_ANGLE@[11; 12) | ||
13 | SEMI@[12; 13) | ||
14 | WHITESPACE@[13; 14) | ||
15 | STRUCT_ITEM@[14; 32) | ||
16 | STRUCT_KW@[14; 20) | ||
17 | WHITESPACE@[20; 21) | ||
18 | NAME@[21; 23) | ||
19 | IDENT@[21; 23) "S2" | ||
20 | TYPE_PARAM_LIST@[23; 26) | ||
21 | L_ANGLE@[23; 24) | ||
22 | TYPE_PARAM@[24; 25) | ||
23 | NAME@[24; 25) | ||
24 | IDENT@[24; 25) "T" | ||
25 | R_ANGLE@[25; 26) | ||
26 | L_PAREN@[26; 27) | ||
27 | POS_FIELD@[27; 30) | ||
28 | PATH_TYPE@[27; 30) | ||
29 | PATH@[27; 30) | ||
30 | PATH_SEGMENT@[27; 30) | ||
31 | NAME_REF@[27; 30) | ||
32 | IDENT@[27; 30) "u32" | ||
33 | R_PAREN@[30; 31) | ||
34 | SEMI@[31; 32) | ||
35 | WHITESPACE@[32; 33) | ||
36 | STRUCT_ITEM@[33; 56) | ||
37 | STRUCT_KW@[33; 39) | ||
38 | WHITESPACE@[39; 40) | ||
39 | NAME@[40; 42) | ||
40 | IDENT@[40; 42) "S3" | ||
41 | TYPE_PARAM_LIST@[42; 45) | ||
42 | L_ANGLE@[42; 43) | ||
43 | TYPE_PARAM@[43; 44) | ||
44 | NAME@[43; 44) | ||
45 | IDENT@[43; 44) "T" | ||
46 | R_ANGLE@[44; 45) | ||
47 | WHITESPACE@[45; 46) | ||
48 | L_CURLY@[46; 47) | ||
49 | WHITESPACE@[47; 48) | ||
50 | NAMED_FIELD@[48; 54) | ||
51 | NAME@[48; 49) | ||
52 | IDENT@[48; 49) "u" | ||
53 | COLON@[49; 50) | ||
54 | WHITESPACE@[50; 51) | ||
55 | PATH_TYPE@[51; 54) | ||
56 | PATH@[51; 54) | ||
57 | PATH_SEGMENT@[51; 54) | ||
58 | NAME_REF@[51; 54) | ||
59 | IDENT@[51; 54) "u32" | ||
60 | WHITESPACE@[54; 55) | ||
61 | R_CURLY@[55; 56) | ||
62 | WHITESPACE@[56; 58) | ||
63 | STRUCT_ITEM@[58; 70) | ||
64 | STRUCT_KW@[58; 64) | ||
65 | WHITESPACE@[64; 65) | ||
66 | NAME@[65; 67) | ||
67 | IDENT@[65; 67) "S4" | ||
68 | TYPE_PARAM_LIST@[67; 69) | ||
69 | L_ANGLE@[67; 68) | ||
70 | R_ANGLE@[68; 69) | ||
71 | SEMI@[69; 70) | ||
72 | WHITESPACE@[70; 71) | ||
73 | STRUCT_ITEM@[71; 85) | ||
74 | STRUCT_KW@[71; 77) | ||
75 | WHITESPACE@[77; 78) | ||
76 | NAME@[78; 80) | ||
77 | IDENT@[78; 80) "S5" | ||
78 | TYPE_PARAM_LIST@[80; 84) | ||
79 | L_ANGLE@[80; 81) | ||
80 | LIFETIME_PARAM@[81; 83) | ||
81 | LIFETIME@[81; 83) "'a" | ||
82 | R_ANGLE@[83; 84) | ||
83 | SEMI@[84; 85) | ||
84 | WHITESPACE@[85; 86) | ||
85 | STRUCT_ITEM@[86; 101) | ||
86 | STRUCT_KW@[86; 92) | ||
87 | WHITESPACE@[92; 93) | ||
88 | NAME@[93; 95) | ||
89 | IDENT@[93; 95) "S6" | ||
90 | TYPE_PARAM_LIST@[95; 100) | ||
91 | L_ANGLE@[95; 96) | ||
92 | LIFETIME_PARAM@[96; 99) | ||
93 | LIFETIME@[96; 98) "'a" | ||
94 | COLON@[98; 99) | ||
95 | R_ANGLE@[99; 100) | ||
96 | SEMI@[100; 101) | ||
97 | WHITESPACE@[101; 102) | ||
98 | STRUCT_ITEM@[102; 120) | ||
99 | STRUCT_KW@[102; 108) | ||
100 | WHITESPACE@[108; 109) | ||
101 | NAME@[109; 111) | ||
102 | IDENT@[109; 111) "S7" | ||
103 | TYPE_PARAM_LIST@[111; 119) | ||
104 | L_ANGLE@[111; 112) | ||
105 | LIFETIME_PARAM@[112; 118) | ||
106 | LIFETIME@[112; 114) "'a" | ||
107 | COLON@[114; 115) | ||
108 | WHITESPACE@[115; 116) | ||
109 | LIFETIME@[116; 118) "'b" | ||
110 | R_ANGLE@[118; 119) | ||
111 | SEMI@[119; 120) | ||
112 | WHITESPACE@[120; 121) | ||
113 | STRUCT_ITEM@[121; 142) | ||
114 | STRUCT_KW@[121; 127) | ||
115 | WHITESPACE@[127; 128) | ||
116 | NAME@[128; 130) | ||
117 | IDENT@[128; 130) "S8" | ||
118 | TYPE_PARAM_LIST@[130; 141) | ||
119 | L_ANGLE@[130; 131) | ||
120 | LIFETIME_PARAM@[131; 139) | ||
121 | LIFETIME@[131; 133) "'a" | ||
122 | COLON@[133; 134) | ||
123 | WHITESPACE@[134; 135) | ||
124 | LIFETIME@[135; 137) "'b" | ||
125 | WHITESPACE@[137; 138) | ||
126 | PLUS@[138; 139) | ||
127 | WHITESPACE@[139; 140) | ||
128 | R_ANGLE@[140; 141) | ||
129 | SEMI@[141; 142) | ||
130 | WHITESPACE@[142; 143) | ||
131 | STRUCT_ITEM@[143; 166) | ||
132 | STRUCT_KW@[143; 149) | ||
133 | WHITESPACE@[149; 150) | ||
134 | NAME@[150; 152) | ||
135 | IDENT@[150; 152) "S9" | ||
136 | TYPE_PARAM_LIST@[152; 165) | ||
137 | L_ANGLE@[152; 153) | ||
138 | LIFETIME_PARAM@[153; 164) | ||
139 | LIFETIME@[153; 155) "'a" | ||
140 | COLON@[155; 156) | ||
141 | WHITESPACE@[156; 157) | ||
142 | LIFETIME@[157; 159) "'b" | ||
143 | WHITESPACE@[159; 160) | ||
144 | PLUS@[160; 161) | ||
145 | WHITESPACE@[161; 162) | ||
146 | LIFETIME@[162; 164) "'c" | ||
147 | R_ANGLE@[164; 165) | ||
148 | SEMI@[165; 166) | ||
149 | WHITESPACE@[166; 167) | ||
150 | STRUCT_ITEM@[167; 183) | ||
151 | STRUCT_KW@[167; 173) | ||
152 | WHITESPACE@[173; 174) | ||
153 | NAME@[174; 177) | ||
154 | IDENT@[174; 177) "S10" | ||
155 | TYPE_PARAM_LIST@[177; 182) | ||
156 | L_ANGLE@[177; 178) | ||
157 | LIFETIME_PARAM@[178; 180) | ||
158 | LIFETIME@[178; 180) "'a" | ||
159 | COMMA@[180; 181) | ||
160 | R_ANGLE@[181; 182) | ||
161 | SEMI@[182; 183) | ||
162 | WHITESPACE@[183; 184) | ||
163 | STRUCT_ITEM@[184; 203) | ||
164 | STRUCT_KW@[184; 190) | ||
165 | WHITESPACE@[190; 191) | ||
166 | NAME@[191; 194) | ||
167 | IDENT@[191; 194) "S11" | ||
168 | TYPE_PARAM_LIST@[194; 202) | ||
169 | L_ANGLE@[194; 195) | ||
170 | LIFETIME_PARAM@[195; 197) | ||
171 | LIFETIME@[195; 197) "'a" | ||
172 | COMMA@[197; 198) | ||
173 | WHITESPACE@[198; 199) | ||
174 | LIFETIME_PARAM@[199; 201) | ||
175 | LIFETIME@[199; 201) "'b" | ||
176 | R_ANGLE@[201; 202) | ||
177 | SEMI@[202; 203) | ||
178 | WHITESPACE@[203; 204) | ||
179 | STRUCT_ITEM@[204; 233) | ||
180 | STRUCT_KW@[204; 210) | ||
181 | WHITESPACE@[210; 211) | ||
182 | NAME@[211; 214) | ||
183 | IDENT@[211; 214) "S12" | ||
184 | TYPE_PARAM_LIST@[214; 232) | ||
185 | L_ANGLE@[214; 215) | ||
186 | LIFETIME_PARAM@[215; 222) | ||
187 | LIFETIME@[215; 217) "'a" | ||
188 | COLON@[217; 218) | ||
189 | WHITESPACE@[218; 219) | ||
190 | LIFETIME@[219; 221) "'b" | ||
191 | PLUS@[221; 222) | ||
192 | COMMA@[222; 223) | ||
193 | WHITESPACE@[223; 224) | ||
194 | LIFETIME_PARAM@[224; 230) | ||
195 | LIFETIME@[224; 226) "'b" | ||
196 | COLON@[226; 227) | ||
197 | WHITESPACE@[227; 228) | ||
198 | LIFETIME@[228; 230) "'c" | ||
199 | COMMA@[230; 231) | ||
200 | R_ANGLE@[231; 232) | ||
201 | SEMI@[232; 233) | ||
202 | WHITESPACE@[233; 235) | ||
203 | STRUCT_ITEM@[235; 249) | ||
204 | STRUCT_KW@[235; 241) | ||
205 | WHITESPACE@[241; 242) | ||
206 | NAME@[242; 245) | ||
207 | IDENT@[242; 245) "S13" | ||
208 | TYPE_PARAM_LIST@[245; 248) | ||
209 | L_ANGLE@[245; 246) | ||
210 | TYPE_PARAM@[246; 247) | ||
211 | NAME@[246; 247) | ||
212 | IDENT@[246; 247) "T" | ||
213 | R_ANGLE@[247; 248) | ||
214 | SEMI@[248; 249) | ||
215 | WHITESPACE@[249; 250) | ||
216 | STRUCT_ITEM@[250; 267) | ||
217 | STRUCT_KW@[250; 256) | ||
218 | WHITESPACE@[256; 257) | ||
219 | NAME@[257; 260) | ||
220 | IDENT@[257; 260) "S14" | ||
221 | TYPE_PARAM_LIST@[260; 266) | ||
222 | L_ANGLE@[260; 261) | ||
223 | TYPE_PARAM@[261; 262) | ||
224 | NAME@[261; 262) | ||
225 | IDENT@[261; 262) "T" | ||
226 | COMMA@[262; 263) | ||
227 | WHITESPACE@[263; 264) | ||
228 | TYPE_PARAM@[264; 265) | ||
229 | NAME@[264; 265) | ||
230 | IDENT@[264; 265) "U" | ||
231 | R_ANGLE@[265; 266) | ||
232 | SEMI@[266; 267) | ||
233 | WHITESPACE@[267; 268) | ||
234 | STRUCT_ITEM@[268; 289) | ||
235 | STRUCT_KW@[268; 274) | ||
236 | WHITESPACE@[274; 275) | ||
237 | NAME@[275; 278) | ||
238 | IDENT@[275; 278) "S15" | ||
239 | TYPE_PARAM_LIST@[278; 288) | ||
240 | L_ANGLE@[278; 279) | ||
241 | LIFETIME_PARAM@[279; 281) | ||
242 | LIFETIME@[279; 281) "'a" | ||
243 | COMMA@[281; 282) | ||
244 | WHITESPACE@[282; 283) | ||
245 | TYPE_PARAM@[283; 284) | ||
246 | NAME@[283; 284) | ||
247 | IDENT@[283; 284) "T" | ||
248 | COMMA@[284; 285) | ||
249 | WHITESPACE@[285; 286) | ||
250 | TYPE_PARAM@[286; 287) | ||
251 | NAME@[286; 287) | ||
252 | IDENT@[286; 287) "U" | ||
253 | R_ANGLE@[287; 288) | ||
254 | SEMI@[288; 289) | ||
255 | WHITESPACE@[289; 290) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0019_enums.rs b/crates/libsyntax2/tests/data/parser/ok/0019_enums.rs new file mode 100644 index 000000000..7a1afa0e6 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0019_enums.rs | |||
@@ -0,0 +1,25 @@ | |||
1 | enum E1 { | ||
2 | } | ||
3 | |||
4 | enum E2<T> { | ||
5 | } | ||
6 | |||
7 | enum E3 { | ||
8 | X | ||
9 | } | ||
10 | |||
11 | enum E4 { | ||
12 | X, | ||
13 | } | ||
14 | |||
15 | enum E5 { | ||
16 | A, | ||
17 | B = 92, | ||
18 | C { | ||
19 | a: u32, | ||
20 | pub b: f64, | ||
21 | }, | ||
22 | F {}, | ||
23 | D(u32,), | ||
24 | E(), | ||
25 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0019_enums.txt b/crates/libsyntax2/tests/data/parser/ok/0019_enums.txt new file mode 100644 index 000000000..8650381cd --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0019_enums.txt | |||
@@ -0,0 +1,146 @@ | |||
1 | FILE@[0; 182) | ||
2 | ENUM_ITEM@[0; 11) | ||
3 | ENUM_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | NAME@[5; 7) | ||
6 | IDENT@[5; 7) "E1" | ||
7 | WHITESPACE@[7; 8) | ||
8 | L_CURLY@[8; 9) | ||
9 | WHITESPACE@[9; 10) | ||
10 | R_CURLY@[10; 11) | ||
11 | WHITESPACE@[11; 13) | ||
12 | ENUM_ITEM@[13; 27) | ||
13 | ENUM_KW@[13; 17) | ||
14 | WHITESPACE@[17; 18) | ||
15 | NAME@[18; 20) | ||
16 | IDENT@[18; 20) "E2" | ||
17 | TYPE_PARAM_LIST@[20; 23) | ||
18 | L_ANGLE@[20; 21) | ||
19 | TYPE_PARAM@[21; 22) | ||
20 | NAME@[21; 22) | ||
21 | IDENT@[21; 22) "T" | ||
22 | R_ANGLE@[22; 23) | ||
23 | WHITESPACE@[23; 24) | ||
24 | L_CURLY@[24; 25) | ||
25 | WHITESPACE@[25; 26) | ||
26 | R_CURLY@[26; 27) | ||
27 | WHITESPACE@[27; 29) | ||
28 | ENUM_ITEM@[29; 46) | ||
29 | ENUM_KW@[29; 33) | ||
30 | WHITESPACE@[33; 34) | ||
31 | NAME@[34; 36) | ||
32 | IDENT@[34; 36) "E3" | ||
33 | WHITESPACE@[36; 37) | ||
34 | L_CURLY@[37; 38) | ||
35 | WHITESPACE@[38; 43) | ||
36 | ENUM_VARIANT@[43; 44) | ||
37 | NAME@[43; 44) | ||
38 | IDENT@[43; 44) "X" | ||
39 | WHITESPACE@[44; 45) | ||
40 | R_CURLY@[45; 46) | ||
41 | WHITESPACE@[46; 48) | ||
42 | ENUM_ITEM@[48; 66) | ||
43 | ENUM_KW@[48; 52) | ||
44 | WHITESPACE@[52; 53) | ||
45 | NAME@[53; 55) | ||
46 | IDENT@[53; 55) "E4" | ||
47 | WHITESPACE@[55; 56) | ||
48 | L_CURLY@[56; 57) | ||
49 | WHITESPACE@[57; 62) | ||
50 | ENUM_VARIANT@[62; 63) | ||
51 | NAME@[62; 63) | ||
52 | IDENT@[62; 63) "X" | ||
53 | COMMA@[63; 64) | ||
54 | WHITESPACE@[64; 65) | ||
55 | R_CURLY@[65; 66) | ||
56 | WHITESPACE@[66; 68) | ||
57 | ENUM_ITEM@[68; 181) | ||
58 | ENUM_KW@[68; 72) | ||
59 | WHITESPACE@[72; 73) | ||
60 | NAME@[73; 75) | ||
61 | IDENT@[73; 75) "E5" | ||
62 | WHITESPACE@[75; 76) | ||
63 | L_CURLY@[76; 77) | ||
64 | WHITESPACE@[77; 82) | ||
65 | ENUM_VARIANT@[82; 83) | ||
66 | NAME@[82; 83) | ||
67 | IDENT@[82; 83) "A" | ||
68 | COMMA@[83; 84) | ||
69 | WHITESPACE@[84; 89) | ||
70 | ENUM_VARIANT@[89; 95) | ||
71 | NAME@[89; 90) | ||
72 | IDENT@[89; 90) "B" | ||
73 | WHITESPACE@[90; 91) | ||
74 | EQ@[91; 92) | ||
75 | WHITESPACE@[92; 93) | ||
76 | LITERAL@[93; 95) | ||
77 | INT_NUMBER@[93; 95) "92" | ||
78 | COMMA@[95; 96) | ||
79 | WHITESPACE@[96; 101) | ||
80 | ENUM_VARIANT@[101; 146) | ||
81 | NAME@[101; 102) | ||
82 | IDENT@[101; 102) "C" | ||
83 | WHITESPACE@[102; 103) | ||
84 | L_CURLY@[103; 104) | ||
85 | WHITESPACE@[104; 113) | ||
86 | NAMED_FIELD@[113; 119) | ||
87 | NAME@[113; 114) | ||
88 | IDENT@[113; 114) "a" | ||
89 | COLON@[114; 115) | ||
90 | WHITESPACE@[115; 116) | ||
91 | PATH_TYPE@[116; 119) | ||
92 | PATH@[116; 119) | ||
93 | PATH_SEGMENT@[116; 119) | ||
94 | NAME_REF@[116; 119) | ||
95 | IDENT@[116; 119) "u32" | ||
96 | COMMA@[119; 120) | ||
97 | WHITESPACE@[120; 129) | ||
98 | NAMED_FIELD@[129; 139) | ||
99 | VISIBILITY@[129; 132) | ||
100 | PUB_KW@[129; 132) | ||
101 | WHITESPACE@[132; 133) | ||
102 | NAME@[133; 134) | ||
103 | IDENT@[133; 134) "b" | ||
104 | COLON@[134; 135) | ||
105 | WHITESPACE@[135; 136) | ||
106 | PATH_TYPE@[136; 139) | ||
107 | PATH@[136; 139) | ||
108 | PATH_SEGMENT@[136; 139) | ||
109 | NAME_REF@[136; 139) | ||
110 | IDENT@[136; 139) "f64" | ||
111 | COMMA@[139; 140) | ||
112 | WHITESPACE@[140; 145) | ||
113 | R_CURLY@[145; 146) | ||
114 | COMMA@[146; 147) | ||
115 | WHITESPACE@[147; 152) | ||
116 | ENUM_VARIANT@[152; 156) | ||
117 | NAME@[152; 153) | ||
118 | IDENT@[152; 153) "F" | ||
119 | WHITESPACE@[153; 154) | ||
120 | L_CURLY@[154; 155) | ||
121 | R_CURLY@[155; 156) | ||
122 | COMMA@[156; 157) | ||
123 | WHITESPACE@[157; 162) | ||
124 | ENUM_VARIANT@[162; 169) | ||
125 | NAME@[162; 163) | ||
126 | IDENT@[162; 163) "D" | ||
127 | L_PAREN@[163; 164) | ||
128 | POS_FIELD@[164; 167) | ||
129 | PATH_TYPE@[164; 167) | ||
130 | PATH@[164; 167) | ||
131 | PATH_SEGMENT@[164; 167) | ||
132 | NAME_REF@[164; 167) | ||
133 | IDENT@[164; 167) "u32" | ||
134 | COMMA@[167; 168) | ||
135 | R_PAREN@[168; 169) | ||
136 | COMMA@[169; 170) | ||
137 | WHITESPACE@[170; 175) | ||
138 | ENUM_VARIANT@[175; 178) | ||
139 | NAME@[175; 176) | ||
140 | IDENT@[175; 176) "E" | ||
141 | L_PAREN@[176; 177) | ||
142 | R_PAREN@[177; 178) | ||
143 | COMMA@[178; 179) | ||
144 | WHITESPACE@[179; 180) | ||
145 | R_CURLY@[180; 181) | ||
146 | WHITESPACE@[181; 182) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0020_type_param_bounds.rs b/crates/libsyntax2/tests/data/parser/ok/0020_type_param_bounds.rs new file mode 100644 index 000000000..a1b9f00a4 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0020_type_param_bounds.rs | |||
@@ -0,0 +1,9 @@ | |||
1 | struct A<T>; | ||
2 | struct B<T:>; | ||
3 | struct C<T: 'a>; | ||
4 | struct D<T: 'a + >; | ||
5 | struct E<T: 'a + 'd >; | ||
6 | struct F<T: 'a + 'd + Clone>; | ||
7 | struct G<T: Clone + Copy>; | ||
8 | struct H<T: ::Foo + self::Bar + 'a>; | ||
9 | struct I<T:, U:,>; | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0020_type_param_bounds.txt b/crates/libsyntax2/tests/data/parser/ok/0020_type_param_bounds.txt new file mode 100644 index 000000000..fe12cbb94 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0020_type_param_bounds.txt | |||
@@ -0,0 +1,193 @@ | |||
1 | FILE@[0; 200) | ||
2 | STRUCT_ITEM@[0; 12) | ||
3 | STRUCT_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | NAME@[7; 8) | ||
6 | IDENT@[7; 8) "A" | ||
7 | TYPE_PARAM_LIST@[8; 11) | ||
8 | L_ANGLE@[8; 9) | ||
9 | TYPE_PARAM@[9; 10) | ||
10 | NAME@[9; 10) | ||
11 | IDENT@[9; 10) "T" | ||
12 | R_ANGLE@[10; 11) | ||
13 | SEMI@[11; 12) | ||
14 | WHITESPACE@[12; 13) | ||
15 | STRUCT_ITEM@[13; 26) | ||
16 | STRUCT_KW@[13; 19) | ||
17 | WHITESPACE@[19; 20) | ||
18 | NAME@[20; 21) | ||
19 | IDENT@[20; 21) "B" | ||
20 | TYPE_PARAM_LIST@[21; 25) | ||
21 | L_ANGLE@[21; 22) | ||
22 | TYPE_PARAM@[22; 24) | ||
23 | NAME@[22; 23) | ||
24 | IDENT@[22; 23) "T" | ||
25 | COLON@[23; 24) | ||
26 | R_ANGLE@[24; 25) | ||
27 | SEMI@[25; 26) | ||
28 | WHITESPACE@[26; 27) | ||
29 | STRUCT_ITEM@[27; 43) | ||
30 | STRUCT_KW@[27; 33) | ||
31 | WHITESPACE@[33; 34) | ||
32 | NAME@[34; 35) | ||
33 | IDENT@[34; 35) "C" | ||
34 | TYPE_PARAM_LIST@[35; 42) | ||
35 | L_ANGLE@[35; 36) | ||
36 | TYPE_PARAM@[36; 41) | ||
37 | NAME@[36; 37) | ||
38 | IDENT@[36; 37) "T" | ||
39 | COLON@[37; 38) | ||
40 | WHITESPACE@[38; 39) | ||
41 | LIFETIME@[39; 41) "'a" | ||
42 | R_ANGLE@[41; 42) | ||
43 | SEMI@[42; 43) | ||
44 | WHITESPACE@[43; 44) | ||
45 | STRUCT_ITEM@[44; 63) | ||
46 | STRUCT_KW@[44; 50) | ||
47 | WHITESPACE@[50; 51) | ||
48 | NAME@[51; 52) | ||
49 | IDENT@[51; 52) "D" | ||
50 | TYPE_PARAM_LIST@[52; 62) | ||
51 | L_ANGLE@[52; 53) | ||
52 | TYPE_PARAM@[53; 60) | ||
53 | NAME@[53; 54) | ||
54 | IDENT@[53; 54) "T" | ||
55 | COLON@[54; 55) | ||
56 | WHITESPACE@[55; 56) | ||
57 | LIFETIME@[56; 58) "'a" | ||
58 | WHITESPACE@[58; 59) | ||
59 | PLUS@[59; 60) | ||
60 | WHITESPACE@[60; 61) | ||
61 | R_ANGLE@[61; 62) | ||
62 | SEMI@[62; 63) | ||
63 | WHITESPACE@[63; 64) | ||
64 | STRUCT_ITEM@[64; 86) | ||
65 | STRUCT_KW@[64; 70) | ||
66 | WHITESPACE@[70; 71) | ||
67 | NAME@[71; 72) | ||
68 | IDENT@[71; 72) "E" | ||
69 | TYPE_PARAM_LIST@[72; 85) | ||
70 | L_ANGLE@[72; 73) | ||
71 | TYPE_PARAM@[73; 83) | ||
72 | NAME@[73; 74) | ||
73 | IDENT@[73; 74) "T" | ||
74 | COLON@[74; 75) | ||
75 | WHITESPACE@[75; 76) | ||
76 | LIFETIME@[76; 78) "'a" | ||
77 | WHITESPACE@[78; 79) | ||
78 | PLUS@[79; 80) | ||
79 | WHITESPACE@[80; 81) | ||
80 | LIFETIME@[81; 83) "'d" | ||
81 | WHITESPACE@[83; 84) | ||
82 | R_ANGLE@[84; 85) | ||
83 | SEMI@[85; 86) | ||
84 | WHITESPACE@[86; 87) | ||
85 | STRUCT_ITEM@[87; 116) | ||
86 | STRUCT_KW@[87; 93) | ||
87 | WHITESPACE@[93; 94) | ||
88 | NAME@[94; 95) | ||
89 | IDENT@[94; 95) "F" | ||
90 | TYPE_PARAM_LIST@[95; 115) | ||
91 | L_ANGLE@[95; 96) | ||
92 | TYPE_PARAM@[96; 114) | ||
93 | NAME@[96; 97) | ||
94 | IDENT@[96; 97) "T" | ||
95 | COLON@[97; 98) | ||
96 | WHITESPACE@[98; 99) | ||
97 | LIFETIME@[99; 101) "'a" | ||
98 | WHITESPACE@[101; 102) | ||
99 | PLUS@[102; 103) | ||
100 | WHITESPACE@[103; 104) | ||
101 | LIFETIME@[104; 106) "'d" | ||
102 | WHITESPACE@[106; 107) | ||
103 | PLUS@[107; 108) | ||
104 | WHITESPACE@[108; 109) | ||
105 | PATH@[109; 114) | ||
106 | PATH_SEGMENT@[109; 114) | ||
107 | NAME_REF@[109; 114) | ||
108 | IDENT@[109; 114) "Clone" | ||
109 | R_ANGLE@[114; 115) | ||
110 | SEMI@[115; 116) | ||
111 | WHITESPACE@[116; 117) | ||
112 | STRUCT_ITEM@[117; 143) | ||
113 | STRUCT_KW@[117; 123) | ||
114 | WHITESPACE@[123; 124) | ||
115 | NAME@[124; 125) | ||
116 | IDENT@[124; 125) "G" | ||
117 | TYPE_PARAM_LIST@[125; 142) | ||
118 | L_ANGLE@[125; 126) | ||
119 | TYPE_PARAM@[126; 141) | ||
120 | NAME@[126; 127) | ||
121 | IDENT@[126; 127) "T" | ||
122 | COLON@[127; 128) | ||
123 | WHITESPACE@[128; 129) | ||
124 | PATH@[129; 134) | ||
125 | PATH_SEGMENT@[129; 134) | ||
126 | NAME_REF@[129; 134) | ||
127 | IDENT@[129; 134) "Clone" | ||
128 | WHITESPACE@[134; 135) | ||
129 | PLUS@[135; 136) | ||
130 | WHITESPACE@[136; 137) | ||
131 | PATH@[137; 141) | ||
132 | PATH_SEGMENT@[137; 141) | ||
133 | NAME_REF@[137; 141) | ||
134 | IDENT@[137; 141) "Copy" | ||
135 | R_ANGLE@[141; 142) | ||
136 | SEMI@[142; 143) | ||
137 | WHITESPACE@[143; 144) | ||
138 | STRUCT_ITEM@[144; 180) | ||
139 | STRUCT_KW@[144; 150) | ||
140 | WHITESPACE@[150; 151) | ||
141 | NAME@[151; 152) | ||
142 | IDENT@[151; 152) "H" | ||
143 | TYPE_PARAM_LIST@[152; 179) | ||
144 | L_ANGLE@[152; 153) | ||
145 | TYPE_PARAM@[153; 178) | ||
146 | NAME@[153; 154) | ||
147 | IDENT@[153; 154) "T" | ||
148 | COLON@[154; 155) | ||
149 | WHITESPACE@[155; 156) | ||
150 | PATH@[156; 161) | ||
151 | PATH_SEGMENT@[156; 161) | ||
152 | COLONCOLON@[156; 158) | ||
153 | NAME_REF@[158; 161) | ||
154 | IDENT@[158; 161) "Foo" | ||
155 | WHITESPACE@[161; 162) | ||
156 | PLUS@[162; 163) | ||
157 | WHITESPACE@[163; 164) | ||
158 | PATH@[164; 173) | ||
159 | PATH@[164; 168) | ||
160 | PATH_SEGMENT@[164; 168) | ||
161 | SELF_KW@[164; 168) | ||
162 | COLONCOLON@[168; 170) | ||
163 | PATH_SEGMENT@[170; 173) | ||
164 | NAME_REF@[170; 173) | ||
165 | IDENT@[170; 173) "Bar" | ||
166 | WHITESPACE@[173; 174) | ||
167 | PLUS@[174; 175) | ||
168 | WHITESPACE@[175; 176) | ||
169 | LIFETIME@[176; 178) "'a" | ||
170 | R_ANGLE@[178; 179) | ||
171 | SEMI@[179; 180) | ||
172 | WHITESPACE@[180; 181) | ||
173 | STRUCT_ITEM@[181; 199) | ||
174 | STRUCT_KW@[181; 187) | ||
175 | WHITESPACE@[187; 188) | ||
176 | NAME@[188; 189) | ||
177 | IDENT@[188; 189) "I" | ||
178 | TYPE_PARAM_LIST@[189; 198) | ||
179 | L_ANGLE@[189; 190) | ||
180 | TYPE_PARAM@[190; 192) | ||
181 | NAME@[190; 191) | ||
182 | IDENT@[190; 191) "T" | ||
183 | COLON@[191; 192) | ||
184 | COMMA@[192; 193) | ||
185 | WHITESPACE@[193; 194) | ||
186 | TYPE_PARAM@[194; 196) | ||
187 | NAME@[194; 195) | ||
188 | IDENT@[194; 195) "U" | ||
189 | COLON@[195; 196) | ||
190 | COMMA@[196; 197) | ||
191 | R_ANGLE@[197; 198) | ||
192 | SEMI@[198; 199) | ||
193 | WHITESPACE@[199; 200) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0021_extern_fn.rs b/crates/libsyntax2/tests/data/parser/ok/0021_extern_fn.rs new file mode 100644 index 000000000..e929eef74 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0021_extern_fn.rs | |||
@@ -0,0 +1,8 @@ | |||
1 | extern fn foo() { | ||
2 | } | ||
3 | |||
4 | extern "C" fn bar() { | ||
5 | } | ||
6 | |||
7 | extern r"D" fn baz() { | ||
8 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0021_extern_fn.txt b/crates/libsyntax2/tests/data/parser/ok/0021_extern_fn.txt new file mode 100644 index 000000000..07d5cc157 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0021_extern_fn.txt | |||
@@ -0,0 +1,56 @@ | |||
1 | FILE@[0; 71) | ||
2 | FUNCTION@[0; 19) | ||
3 | ABI@[0; 6) | ||
4 | EXTERN_KW@[0; 6) | ||
5 | WHITESPACE@[6; 7) | ||
6 | FN_KW@[7; 9) | ||
7 | WHITESPACE@[9; 10) | ||
8 | NAME@[10; 13) | ||
9 | IDENT@[10; 13) "foo" | ||
10 | PARAM_LIST@[13; 15) | ||
11 | L_PAREN@[13; 14) | ||
12 | R_PAREN@[14; 15) | ||
13 | WHITESPACE@[15; 16) | ||
14 | BLOCK_EXPR@[16; 19) | ||
15 | L_CURLY@[16; 17) | ||
16 | WHITESPACE@[17; 18) | ||
17 | R_CURLY@[18; 19) | ||
18 | WHITESPACE@[19; 21) | ||
19 | FUNCTION@[21; 44) | ||
20 | ABI@[21; 31) | ||
21 | EXTERN_KW@[21; 27) | ||
22 | WHITESPACE@[27; 28) | ||
23 | STRING@[28; 31) | ||
24 | WHITESPACE@[31; 32) | ||
25 | FN_KW@[32; 34) | ||
26 | WHITESPACE@[34; 35) | ||
27 | NAME@[35; 38) | ||
28 | IDENT@[35; 38) "bar" | ||
29 | PARAM_LIST@[38; 40) | ||
30 | L_PAREN@[38; 39) | ||
31 | R_PAREN@[39; 40) | ||
32 | WHITESPACE@[40; 41) | ||
33 | BLOCK_EXPR@[41; 44) | ||
34 | L_CURLY@[41; 42) | ||
35 | WHITESPACE@[42; 43) | ||
36 | R_CURLY@[43; 44) | ||
37 | WHITESPACE@[44; 46) | ||
38 | FUNCTION@[46; 70) | ||
39 | ABI@[46; 57) | ||
40 | EXTERN_KW@[46; 52) | ||
41 | WHITESPACE@[52; 53) | ||
42 | RAW_STRING@[53; 57) | ||
43 | WHITESPACE@[57; 58) | ||
44 | FN_KW@[58; 60) | ||
45 | WHITESPACE@[60; 61) | ||
46 | NAME@[61; 64) | ||
47 | IDENT@[61; 64) "baz" | ||
48 | PARAM_LIST@[64; 66) | ||
49 | L_PAREN@[64; 65) | ||
50 | R_PAREN@[65; 66) | ||
51 | WHITESPACE@[66; 67) | ||
52 | BLOCK_EXPR@[67; 70) | ||
53 | L_CURLY@[67; 68) | ||
54 | WHITESPACE@[68; 69) | ||
55 | R_CURLY@[69; 70) | ||
56 | WHITESPACE@[70; 71) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0022_empty_extern_block.rs b/crates/libsyntax2/tests/data/parser/ok/0022_empty_extern_block.rs new file mode 100644 index 000000000..f5fe0e6ef --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0022_empty_extern_block.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | extern { | ||
2 | } | ||
3 | |||
4 | extern "C" { | ||
5 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0022_empty_extern_block.txt b/crates/libsyntax2/tests/data/parser/ok/0022_empty_extern_block.txt new file mode 100644 index 000000000..81b92d394 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0022_empty_extern_block.txt | |||
@@ -0,0 +1,19 @@ | |||
1 | FILE@[0; 27) | ||
2 | EXTERN_BLOCK_EXPR@[0; 10) | ||
3 | ABI@[0; 6) | ||
4 | EXTERN_KW@[0; 6) | ||
5 | WHITESPACE@[6; 7) | ||
6 | L_CURLY@[7; 8) | ||
7 | WHITESPACE@[8; 9) | ||
8 | R_CURLY@[9; 10) | ||
9 | WHITESPACE@[10; 12) | ||
10 | EXTERN_BLOCK_EXPR@[12; 26) | ||
11 | ABI@[12; 22) | ||
12 | EXTERN_KW@[12; 18) | ||
13 | WHITESPACE@[18; 19) | ||
14 | STRING@[19; 22) | ||
15 | WHITESPACE@[22; 23) | ||
16 | L_CURLY@[23; 24) | ||
17 | WHITESPACE@[24; 25) | ||
18 | R_CURLY@[25; 26) | ||
19 | WHITESPACE@[26; 27) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0023_static_items.rs b/crates/libsyntax2/tests/data/parser/ok/0023_static_items.rs new file mode 100644 index 000000000..5fb92ce33 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0023_static_items.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | static FOO: u32 = 1; | ||
2 | static mut BAR: i32 = 92; | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0023_static_items.txt b/crates/libsyntax2/tests/data/parser/ok/0023_static_items.txt new file mode 100644 index 000000000..b8dfdd251 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0023_static_items.txt | |||
@@ -0,0 +1,41 @@ | |||
1 | FILE@[0; 47) | ||
2 | STATIC_ITEM@[0; 20) | ||
3 | STATIC_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | NAME@[7; 10) | ||
6 | IDENT@[7; 10) "FOO" | ||
7 | COLON@[10; 11) | ||
8 | WHITESPACE@[11; 12) | ||
9 | PATH_TYPE@[12; 15) | ||
10 | PATH@[12; 15) | ||
11 | PATH_SEGMENT@[12; 15) | ||
12 | NAME_REF@[12; 15) | ||
13 | IDENT@[12; 15) "u32" | ||
14 | WHITESPACE@[15; 16) | ||
15 | EQ@[16; 17) | ||
16 | WHITESPACE@[17; 18) | ||
17 | LITERAL@[18; 19) | ||
18 | INT_NUMBER@[18; 19) "1" | ||
19 | SEMI@[19; 20) | ||
20 | WHITESPACE@[20; 21) | ||
21 | STATIC_ITEM@[21; 46) | ||
22 | STATIC_KW@[21; 27) | ||
23 | WHITESPACE@[27; 28) | ||
24 | MUT_KW@[28; 31) | ||
25 | WHITESPACE@[31; 32) | ||
26 | NAME@[32; 35) | ||
27 | IDENT@[32; 35) "BAR" | ||
28 | COLON@[35; 36) | ||
29 | WHITESPACE@[36; 37) | ||
30 | PATH_TYPE@[37; 40) | ||
31 | PATH@[37; 40) | ||
32 | PATH_SEGMENT@[37; 40) | ||
33 | NAME_REF@[37; 40) | ||
34 | IDENT@[37; 40) "i32" | ||
35 | WHITESPACE@[40; 41) | ||
36 | EQ@[41; 42) | ||
37 | WHITESPACE@[42; 43) | ||
38 | LITERAL@[43; 45) | ||
39 | INT_NUMBER@[43; 45) "92" | ||
40 | SEMI@[45; 46) | ||
41 | WHITESPACE@[46; 47) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0024_const_item.rs b/crates/libsyntax2/tests/data/parser/ok/0024_const_item.rs new file mode 100644 index 000000000..7446859b5 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0024_const_item.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | const FOO: u32 = 92; | ||
2 | const mut BAR: u32 = 62; | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0024_const_item.txt b/crates/libsyntax2/tests/data/parser/ok/0024_const_item.txt new file mode 100644 index 000000000..85083e9c1 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0024_const_item.txt | |||
@@ -0,0 +1,41 @@ | |||
1 | FILE@[0; 46) | ||
2 | CONST_ITEM@[0; 20) | ||
3 | CONST_KW@[0; 5) | ||
4 | WHITESPACE@[5; 6) | ||
5 | NAME@[6; 9) | ||
6 | IDENT@[6; 9) "FOO" | ||
7 | COLON@[9; 10) | ||
8 | WHITESPACE@[10; 11) | ||
9 | PATH_TYPE@[11; 14) | ||
10 | PATH@[11; 14) | ||
11 | PATH_SEGMENT@[11; 14) | ||
12 | NAME_REF@[11; 14) | ||
13 | IDENT@[11; 14) "u32" | ||
14 | WHITESPACE@[14; 15) | ||
15 | EQ@[15; 16) | ||
16 | WHITESPACE@[16; 17) | ||
17 | LITERAL@[17; 19) | ||
18 | INT_NUMBER@[17; 19) "92" | ||
19 | SEMI@[19; 20) | ||
20 | WHITESPACE@[20; 21) | ||
21 | CONST_ITEM@[21; 45) | ||
22 | CONST_KW@[21; 26) | ||
23 | WHITESPACE@[26; 27) | ||
24 | MUT_KW@[27; 30) | ||
25 | WHITESPACE@[30; 31) | ||
26 | NAME@[31; 34) | ||
27 | IDENT@[31; 34) "BAR" | ||
28 | COLON@[34; 35) | ||
29 | WHITESPACE@[35; 36) | ||
30 | PATH_TYPE@[36; 39) | ||
31 | PATH@[36; 39) | ||
32 | PATH_SEGMENT@[36; 39) | ||
33 | NAME_REF@[36; 39) | ||
34 | IDENT@[36; 39) "u32" | ||
35 | WHITESPACE@[39; 40) | ||
36 | EQ@[40; 41) | ||
37 | WHITESPACE@[41; 42) | ||
38 | LITERAL@[42; 44) | ||
39 | INT_NUMBER@[42; 44) "62" | ||
40 | SEMI@[44; 45) | ||
41 | WHITESPACE@[45; 46) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0025_extern_fn_in_block.rs b/crates/libsyntax2/tests/data/parser/ok/0025_extern_fn_in_block.rs new file mode 100644 index 000000000..289809809 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0025_extern_fn_in_block.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn main() { | ||
2 | extern fn f() {} | ||
3 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0025_extern_fn_in_block.txt b/crates/libsyntax2/tests/data/parser/ok/0025_extern_fn_in_block.txt new file mode 100644 index 000000000..46fb177b2 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0025_extern_fn_in_block.txt | |||
@@ -0,0 +1,31 @@ | |||
1 | FILE@[0; 35) | ||
2 | FUNCTION@[0; 34) | ||
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; 34) | ||
12 | L_CURLY@[10; 11) | ||
13 | WHITESPACE@[11; 16) | ||
14 | FUNCTION@[16; 32) | ||
15 | ABI@[16; 22) | ||
16 | EXTERN_KW@[16; 22) | ||
17 | WHITESPACE@[22; 23) | ||
18 | FN_KW@[23; 25) | ||
19 | WHITESPACE@[25; 26) | ||
20 | NAME@[26; 27) | ||
21 | IDENT@[26; 27) "f" | ||
22 | PARAM_LIST@[27; 29) | ||
23 | L_PAREN@[27; 28) | ||
24 | R_PAREN@[28; 29) | ||
25 | WHITESPACE@[29; 30) | ||
26 | BLOCK_EXPR@[30; 32) | ||
27 | L_CURLY@[30; 31) | ||
28 | R_CURLY@[31; 32) | ||
29 | WHITESPACE@[32; 33) | ||
30 | R_CURLY@[33; 34) | ||
31 | WHITESPACE@[34; 35) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0026_const_fn_in_block.rs b/crates/libsyntax2/tests/data/parser/ok/0026_const_fn_in_block.rs new file mode 100644 index 000000000..7641a3d28 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0026_const_fn_in_block.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn main() { | ||
2 | const fn f() {} | ||
3 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0026_const_fn_in_block.txt b/crates/libsyntax2/tests/data/parser/ok/0026_const_fn_in_block.txt new file mode 100644 index 000000000..a450762a8 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0026_const_fn_in_block.txt | |||
@@ -0,0 +1,30 @@ | |||
1 | FILE@[0; 34) | ||
2 | FUNCTION@[0; 33) | ||
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; 33) | ||
12 | L_CURLY@[10; 11) | ||
13 | WHITESPACE@[11; 16) | ||
14 | FUNCTION@[16; 31) | ||
15 | CONST_KW@[16; 21) | ||
16 | WHITESPACE@[21; 22) | ||
17 | FN_KW@[22; 24) | ||
18 | WHITESPACE@[24; 25) | ||
19 | NAME@[25; 26) | ||
20 | IDENT@[25; 26) "f" | ||
21 | PARAM_LIST@[26; 28) | ||
22 | L_PAREN@[26; 27) | ||
23 | R_PAREN@[27; 28) | ||
24 | WHITESPACE@[28; 29) | ||
25 | BLOCK_EXPR@[29; 31) | ||
26 | L_CURLY@[29; 30) | ||
27 | R_CURLY@[30; 31) | ||
28 | WHITESPACE@[31; 32) | ||
29 | R_CURLY@[32; 33) | ||
30 | WHITESPACE@[33; 34) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0027_unsafe_fn_in_block.rs b/crates/libsyntax2/tests/data/parser/ok/0027_unsafe_fn_in_block.rs new file mode 100644 index 000000000..f3c5ff938 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0027_unsafe_fn_in_block.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn main() { | ||
2 | unsafe fn f() {} | ||
3 | unsafe { 92 } | ||
4 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0027_unsafe_fn_in_block.txt b/crates/libsyntax2/tests/data/parser/ok/0027_unsafe_fn_in_block.txt new file mode 100644 index 000000000..28cd7ad3d --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0027_unsafe_fn_in_block.txt | |||
@@ -0,0 +1,40 @@ | |||
1 | FILE@[0; 53) | ||
2 | FUNCTION@[0; 52) | ||
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; 52) | ||
12 | L_CURLY@[10; 11) | ||
13 | WHITESPACE@[11; 16) | ||
14 | FUNCTION@[16; 32) | ||
15 | UNSAFE_KW@[16; 22) | ||
16 | WHITESPACE@[22; 23) | ||
17 | FN_KW@[23; 25) | ||
18 | WHITESPACE@[25; 26) | ||
19 | NAME@[26; 27) | ||
20 | IDENT@[26; 27) "f" | ||
21 | PARAM_LIST@[27; 29) | ||
22 | L_PAREN@[27; 28) | ||
23 | R_PAREN@[28; 29) | ||
24 | WHITESPACE@[29; 30) | ||
25 | BLOCK_EXPR@[30; 32) | ||
26 | L_CURLY@[30; 31) | ||
27 | R_CURLY@[31; 32) | ||
28 | WHITESPACE@[32; 37) | ||
29 | BLOCK_EXPR@[37; 50) | ||
30 | UNSAFE_KW@[37; 43) | ||
31 | WHITESPACE@[43; 44) | ||
32 | L_CURLY@[44; 45) | ||
33 | WHITESPACE@[45; 46) | ||
34 | LITERAL@[46; 48) | ||
35 | INT_NUMBER@[46; 48) "92" | ||
36 | WHITESPACE@[48; 49) | ||
37 | R_CURLY@[49; 50) | ||
38 | WHITESPACE@[50; 51) | ||
39 | R_CURLY@[51; 52) | ||
40 | WHITESPACE@[52; 53) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0028_operator_binding_power.rs b/crates/libsyntax2/tests/data/parser/ok/0028_operator_binding_power.rs new file mode 100644 index 000000000..cc9598470 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0028_operator_binding_power.rs | |||
@@ -0,0 +1,14 @@ | |||
1 | fn binding_power() { | ||
2 | let x = 1 + 2 * 3 % 4 - 5 / 6; | ||
3 | 1 + 2 * 3; | ||
4 | 1 << 2 + 3; | ||
5 | 1 & 2 >> 3; | ||
6 | 1 ^ 2 & 3; | ||
7 | 1 | 2 ^ 3; | ||
8 | 1 == 2 | 3; | ||
9 | 1 && 2 == 3; | ||
10 | //1 || 2 && 2; | ||
11 | //1 .. 2 || 3; | ||
12 | //1 = 2 .. 3; | ||
13 | //---&*1 - --2 * 9; | ||
14 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0028_operator_binding_power.txt b/crates/libsyntax2/tests/data/parser/ok/0028_operator_binding_power.txt new file mode 100644 index 000000000..3fb1ae811 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0028_operator_binding_power.txt | |||
@@ -0,0 +1,185 @@ | |||
1 | FILE@[0; 248) | ||
2 | FUNCTION@[0; 247) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 16) | ||
6 | IDENT@[3; 16) "binding_power" | ||
7 | PARAM_LIST@[16; 18) | ||
8 | L_PAREN@[16; 17) | ||
9 | R_PAREN@[17; 18) | ||
10 | WHITESPACE@[18; 19) | ||
11 | BLOCK_EXPR@[19; 247) | ||
12 | L_CURLY@[19; 20) | ||
13 | WHITESPACE@[20; 25) | ||
14 | LET_STMT@[25; 55) | ||
15 | LET_KW@[25; 28) | ||
16 | WHITESPACE@[28; 29) | ||
17 | BIND_PAT@[29; 30) | ||
18 | NAME@[29; 30) | ||
19 | IDENT@[29; 30) "x" | ||
20 | WHITESPACE@[30; 31) | ||
21 | EQ@[31; 32) | ||
22 | WHITESPACE@[32; 33) | ||
23 | BIN_EXPR@[33; 54) | ||
24 | BIN_EXPR@[33; 46) | ||
25 | LITERAL@[33; 34) | ||
26 | INT_NUMBER@[33; 34) "1" | ||
27 | WHITESPACE@[34; 35) | ||
28 | PLUS@[35; 36) | ||
29 | WHITESPACE@[36; 37) | ||
30 | BIN_EXPR@[37; 46) | ||
31 | BIN_EXPR@[37; 42) | ||
32 | LITERAL@[37; 38) | ||
33 | INT_NUMBER@[37; 38) "2" | ||
34 | WHITESPACE@[38; 39) | ||
35 | STAR@[39; 40) | ||
36 | WHITESPACE@[40; 41) | ||
37 | LITERAL@[41; 42) | ||
38 | INT_NUMBER@[41; 42) "3" | ||
39 | WHITESPACE@[42; 43) | ||
40 | PERCENT@[43; 44) | ||
41 | WHITESPACE@[44; 45) | ||
42 | LITERAL@[45; 46) | ||
43 | INT_NUMBER@[45; 46) "4" | ||
44 | WHITESPACE@[46; 47) | ||
45 | MINUS@[47; 48) | ||
46 | WHITESPACE@[48; 49) | ||
47 | BIN_EXPR@[49; 54) | ||
48 | LITERAL@[49; 50) | ||
49 | INT_NUMBER@[49; 50) "5" | ||
50 | WHITESPACE@[50; 51) | ||
51 | SLASH@[51; 52) | ||
52 | WHITESPACE@[52; 53) | ||
53 | LITERAL@[53; 54) | ||
54 | INT_NUMBER@[53; 54) "6" | ||
55 | SEMI@[54; 55) | ||
56 | WHITESPACE@[55; 60) | ||
57 | EXPR_STMT@[60; 70) | ||
58 | BIN_EXPR@[60; 69) | ||
59 | LITERAL@[60; 61) | ||
60 | INT_NUMBER@[60; 61) "1" | ||
61 | WHITESPACE@[61; 62) | ||
62 | PLUS@[62; 63) | ||
63 | WHITESPACE@[63; 64) | ||
64 | BIN_EXPR@[64; 69) | ||
65 | LITERAL@[64; 65) | ||
66 | INT_NUMBER@[64; 65) "2" | ||
67 | WHITESPACE@[65; 66) | ||
68 | STAR@[66; 67) | ||
69 | WHITESPACE@[67; 68) | ||
70 | LITERAL@[68; 69) | ||
71 | INT_NUMBER@[68; 69) "3" | ||
72 | SEMI@[69; 70) | ||
73 | WHITESPACE@[70; 75) | ||
74 | EXPR_STMT@[75; 86) | ||
75 | BIN_EXPR@[75; 85) | ||
76 | LITERAL@[75; 76) | ||
77 | INT_NUMBER@[75; 76) "1" | ||
78 | WHITESPACE@[76; 77) | ||
79 | SHL@[77; 79) | ||
80 | WHITESPACE@[79; 80) | ||
81 | BIN_EXPR@[80; 85) | ||
82 | LITERAL@[80; 81) | ||
83 | INT_NUMBER@[80; 81) "2" | ||
84 | WHITESPACE@[81; 82) | ||
85 | PLUS@[82; 83) | ||
86 | WHITESPACE@[83; 84) | ||
87 | LITERAL@[84; 85) | ||
88 | INT_NUMBER@[84; 85) "3" | ||
89 | SEMI@[85; 86) | ||
90 | WHITESPACE@[86; 91) | ||
91 | EXPR_STMT@[91; 102) | ||
92 | BIN_EXPR@[91; 101) | ||
93 | LITERAL@[91; 92) | ||
94 | INT_NUMBER@[91; 92) "1" | ||
95 | WHITESPACE@[92; 93) | ||
96 | AMP@[93; 94) | ||
97 | WHITESPACE@[94; 95) | ||
98 | BIN_EXPR@[95; 101) | ||
99 | LITERAL@[95; 96) | ||
100 | INT_NUMBER@[95; 96) "2" | ||
101 | WHITESPACE@[96; 97) | ||
102 | SHR@[97; 99) | ||
103 | WHITESPACE@[99; 100) | ||
104 | LITERAL@[100; 101) | ||
105 | INT_NUMBER@[100; 101) "3" | ||
106 | SEMI@[101; 102) | ||
107 | WHITESPACE@[102; 107) | ||
108 | EXPR_STMT@[107; 117) | ||
109 | BIN_EXPR@[107; 116) | ||
110 | LITERAL@[107; 108) | ||
111 | INT_NUMBER@[107; 108) "1" | ||
112 | WHITESPACE@[108; 109) | ||
113 | CARET@[109; 110) | ||
114 | WHITESPACE@[110; 111) | ||
115 | BIN_EXPR@[111; 116) | ||
116 | LITERAL@[111; 112) | ||
117 | INT_NUMBER@[111; 112) "2" | ||
118 | WHITESPACE@[112; 113) | ||
119 | AMP@[113; 114) | ||
120 | WHITESPACE@[114; 115) | ||
121 | LITERAL@[115; 116) | ||
122 | INT_NUMBER@[115; 116) "3" | ||
123 | SEMI@[116; 117) | ||
124 | WHITESPACE@[117; 122) | ||
125 | EXPR_STMT@[122; 132) | ||
126 | BIN_EXPR@[122; 131) | ||
127 | LITERAL@[122; 123) | ||
128 | INT_NUMBER@[122; 123) "1" | ||
129 | WHITESPACE@[123; 124) | ||
130 | PIPE@[124; 125) | ||
131 | WHITESPACE@[125; 126) | ||
132 | BIN_EXPR@[126; 131) | ||
133 | LITERAL@[126; 127) | ||
134 | INT_NUMBER@[126; 127) "2" | ||
135 | WHITESPACE@[127; 128) | ||
136 | CARET@[128; 129) | ||
137 | WHITESPACE@[129; 130) | ||
138 | LITERAL@[130; 131) | ||
139 | INT_NUMBER@[130; 131) "3" | ||
140 | SEMI@[131; 132) | ||
141 | WHITESPACE@[132; 137) | ||
142 | EXPR_STMT@[137; 148) | ||
143 | BIN_EXPR@[137; 147) | ||
144 | LITERAL@[137; 138) | ||
145 | INT_NUMBER@[137; 138) "1" | ||
146 | WHITESPACE@[138; 139) | ||
147 | EQEQ@[139; 141) | ||
148 | WHITESPACE@[141; 142) | ||
149 | BIN_EXPR@[142; 147) | ||
150 | LITERAL@[142; 143) | ||
151 | INT_NUMBER@[142; 143) "2" | ||
152 | WHITESPACE@[143; 144) | ||
153 | PIPE@[144; 145) | ||
154 | WHITESPACE@[145; 146) | ||
155 | LITERAL@[146; 147) | ||
156 | INT_NUMBER@[146; 147) "3" | ||
157 | SEMI@[147; 148) | ||
158 | WHITESPACE@[148; 153) | ||
159 | EXPR_STMT@[153; 165) | ||
160 | BIN_EXPR@[153; 164) | ||
161 | LITERAL@[153; 154) | ||
162 | INT_NUMBER@[153; 154) "1" | ||
163 | WHITESPACE@[154; 155) | ||
164 | AMPAMP@[155; 157) | ||
165 | WHITESPACE@[157; 158) | ||
166 | BIN_EXPR@[158; 164) | ||
167 | LITERAL@[158; 159) | ||
168 | INT_NUMBER@[158; 159) "2" | ||
169 | WHITESPACE@[159; 160) | ||
170 | EQEQ@[160; 162) | ||
171 | WHITESPACE@[162; 163) | ||
172 | LITERAL@[163; 164) | ||
173 | INT_NUMBER@[163; 164) "3" | ||
174 | SEMI@[164; 165) | ||
175 | WHITESPACE@[165; 170) | ||
176 | COMMENT@[170; 184) | ||
177 | WHITESPACE@[184; 189) | ||
178 | COMMENT@[189; 203) | ||
179 | WHITESPACE@[203; 208) | ||
180 | COMMENT@[208; 221) | ||
181 | WHITESPACE@[221; 226) | ||
182 | COMMENT@[226; 245) | ||
183 | WHITESPACE@[245; 246) | ||
184 | R_CURLY@[246; 247) | ||
185 | WHITESPACE@[247; 248) | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0029_range_forms.rs b/crates/libsyntax2/tests/data/parser/ok/0029_range_forms.rs new file mode 100644 index 000000000..03f4ae7b2 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0029_range_forms.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | ..1 + 1; | ||
3 | ..z = 2; | ||
4 | x = false..1 == 1; | ||
5 | let x = 1..; | ||
6 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0029_range_forms.txt b/crates/libsyntax2/tests/data/parser/ok/0029_range_forms.txt new file mode 100644 index 000000000..91d5e5bba --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0029_range_forms.txt | |||
@@ -0,0 +1,83 @@ | |||
1 | FILE@[0; 79) | ||
2 | FUNCTION@[0; 78) | ||
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; 78) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 23) | ||
15 | RANGE_EXPR@[15; 22) | ||
16 | DOTDOT@[15; 17) | ||
17 | BIN_EXPR@[17; 22) | ||
18 | LITERAL@[17; 18) | ||
19 | INT_NUMBER@[17; 18) "1" | ||
20 | WHITESPACE@[18; 19) | ||
21 | PLUS@[19; 20) | ||
22 | WHITESPACE@[20; 21) | ||
23 | LITERAL@[21; 22) | ||
24 | INT_NUMBER@[21; 22) "1" | ||
25 | SEMI@[22; 23) | ||
26 | WHITESPACE@[23; 28) | ||
27 | EXPR_STMT@[28; 36) | ||
28 | BIN_EXPR@[28; 35) | ||
29 | RANGE_EXPR@[28; 31) | ||
30 | DOTDOT@[28; 30) | ||
31 | PATH_EXPR@[30; 31) | ||
32 | PATH@[30; 31) | ||
33 | PATH_SEGMENT@[30; 31) | ||
34 | NAME_REF@[30; 31) | ||
35 | IDENT@[30; 31) "z" | ||
36 | WHITESPACE@[31; 32) | ||
37 | EQ@[32; 33) | ||
38 | WHITESPACE@[33; 34) | ||
39 | LITERAL@[34; 35) | ||
40 | INT_NUMBER@[34; 35) "2" | ||
41 | SEMI@[35; 36) | ||
42 | WHITESPACE@[36; 41) | ||
43 | EXPR_STMT@[41; 59) | ||
44 | BIN_EXPR@[41; 58) | ||
45 | PATH_EXPR@[41; 42) | ||
46 | PATH@[41; 42) | ||
47 | PATH_SEGMENT@[41; 42) | ||
48 | NAME_REF@[41; 42) | ||
49 | IDENT@[41; 42) "x" | ||
50 | WHITESPACE@[42; 43) | ||
51 | EQ@[43; 44) | ||
52 | WHITESPACE@[44; 45) | ||
53 | RANGE_EXPR@[45; 58) | ||
54 | LITERAL@[45; 50) | ||
55 | FALSE_KW@[45; 50) | ||
56 | DOTDOT@[50; 52) | ||
57 | BIN_EXPR@[52; 58) | ||
58 | LITERAL@[52; 53) | ||
59 | INT_NUMBER@[52; 53) "1" | ||
60 | WHITESPACE@[53; 54) | ||
61 | EQEQ@[54; 56) | ||
62 | WHITESPACE@[56; 57) | ||
63 | LITERAL@[57; 58) | ||
64 | INT_NUMBER@[57; 58) "1" | ||
65 | SEMI@[58; 59) | ||
66 | WHITESPACE@[59; 64) | ||
67 | LET_STMT@[64; 76) | ||
68 | LET_KW@[64; 67) | ||
69 | WHITESPACE@[67; 68) | ||
70 | BIND_PAT@[68; 69) | ||
71 | NAME@[68; 69) | ||
72 | IDENT@[68; 69) "x" | ||
73 | WHITESPACE@[69; 70) | ||
74 | EQ@[70; 71) | ||
75 | WHITESPACE@[71; 72) | ||
76 | RANGE_EXPR@[72; 75) | ||
77 | LITERAL@[72; 73) | ||
78 | INT_NUMBER@[72; 73) "1" | ||
79 | DOTDOT@[73; 75) | ||
80 | SEMI@[75; 76) | ||
81 | WHITESPACE@[76; 77) | ||
82 | R_CURLY@[77; 78) | ||
83 | WHITESPACE@[78; 79) | ||