diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/data/lexer/0011_keywords.rs | 2 | ||||
-rw-r--r-- | tests/data/lexer/0011_keywords.txt | 2 | ||||
-rw-r--r-- | tests/data/parser/err/0008_item_block_recovery.txt | 2 | ||||
-rw-r--r-- | tests/data/parser/inline/0065_if_expr.rs | 5 | ||||
-rw-r--r-- | tests/data/parser/inline/0065_if_expr.txt | 73 |
5 files changed, 82 insertions, 2 deletions
diff --git a/tests/data/lexer/0011_keywords.rs b/tests/data/lexer/0011_keywords.rs index 97ff3f954..2a78b5dd2 100644 --- a/tests/data/lexer/0011_keywords.rs +++ b/tests/data/lexer/0011_keywords.rs | |||
@@ -1,3 +1,3 @@ | |||
1 | fn use struct trait enum impl true false as extern crate | 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 | 2 | mod pub self super in where for loop while if match const |
3 | static mut type ref let | 3 | static mut type ref let else |
diff --git a/tests/data/lexer/0011_keywords.txt b/tests/data/lexer/0011_keywords.txt index 851a671f5..e25d7d4b4 100644 --- a/tests/data/lexer/0011_keywords.txt +++ b/tests/data/lexer/0011_keywords.txt | |||
@@ -53,4 +53,6 @@ WHITESPACE 1 " " | |||
53 | REF_KW 3 "ref" | 53 | REF_KW 3 "ref" |
54 | WHITESPACE 1 " " | 54 | WHITESPACE 1 " " |
55 | LET_KW 3 "let" | 55 | LET_KW 3 "let" |
56 | WHITESPACE 1 " " | ||
57 | ELSE_KW 4 "else" | ||
56 | WHITESPACE 1 "\n" | 58 | WHITESPACE 1 "\n" |
diff --git a/tests/data/parser/err/0008_item_block_recovery.txt b/tests/data/parser/err/0008_item_block_recovery.txt index 40ce2bc1a..81a5dd4c3 100644 --- a/tests/data/parser/err/0008_item_block_recovery.txt +++ b/tests/data/parser/err/0008_item_block_recovery.txt | |||
@@ -37,7 +37,7 @@ FILE@[0; 95) | |||
37 | WHITESPACE@[45; 50) | 37 | WHITESPACE@[45; 50) |
38 | R_CURLY@[50; 51) | 38 | R_CURLY@[50; 51) |
39 | WHITESPACE@[51; 52) | 39 | WHITESPACE@[51; 52) |
40 | IDENT@[52; 56) "else" | 40 | ELSE_KW@[52; 56) |
41 | WHITESPACE@[56; 57) | 41 | WHITESPACE@[56; 57) |
42 | L_CURLY@[57; 58) | 42 | L_CURLY@[57; 58) |
43 | WHITESPACE@[58; 67) | 43 | WHITESPACE@[58; 67) |
diff --git a/tests/data/parser/inline/0065_if_expr.rs b/tests/data/parser/inline/0065_if_expr.rs new file mode 100644 index 000000000..f1691c159 --- /dev/null +++ b/tests/data/parser/inline/0065_if_expr.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | fn foo() { | ||
2 | if true {}; | ||
3 | if true {} else {}; | ||
4 | if true {} else if false {} else {} | ||
5 | } | ||
diff --git a/tests/data/parser/inline/0065_if_expr.txt b/tests/data/parser/inline/0065_if_expr.txt new file mode 100644 index 000000000..5d9bdfb13 --- /dev/null +++ b/tests/data/parser/inline/0065_if_expr.txt | |||
@@ -0,0 +1,73 @@ | |||
1 | FILE@[0; 93) | ||
2 | FN_ITEM@[0; 93) | ||
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@[9; 93) | ||
12 | L_CURLY@[9; 10) | ||
13 | EXPR_STMT@[10; 31) | ||
14 | IF_EXPR@[10; 25) | ||
15 | WHITESPACE@[10; 15) | ||
16 | IF_KW@[15; 17) | ||
17 | LITERAL@[17; 23) | ||
18 | WHITESPACE@[17; 18) | ||
19 | TRUE_KW@[18; 22) | ||
20 | WHITESPACE@[22; 23) | ||
21 | BLOCK@[23; 25) | ||
22 | L_CURLY@[23; 24) | ||
23 | R_CURLY@[24; 25) | ||
24 | SEMI@[25; 26) | ||
25 | WHITESPACE@[26; 31) | ||
26 | EXPR_STMT@[31; 55) | ||
27 | IF_EXPR@[31; 49) | ||
28 | IF_KW@[31; 33) | ||
29 | LITERAL@[33; 39) | ||
30 | WHITESPACE@[33; 34) | ||
31 | TRUE_KW@[34; 38) | ||
32 | WHITESPACE@[38; 39) | ||
33 | BLOCK@[39; 42) | ||
34 | L_CURLY@[39; 40) | ||
35 | R_CURLY@[40; 41) | ||
36 | WHITESPACE@[41; 42) | ||
37 | ELSE_KW@[42; 46) | ||
38 | BLOCK@[46; 49) | ||
39 | WHITESPACE@[46; 47) | ||
40 | L_CURLY@[47; 48) | ||
41 | R_CURLY@[48; 49) | ||
42 | SEMI@[49; 50) | ||
43 | WHITESPACE@[50; 55) | ||
44 | IF_EXPR@[55; 91) | ||
45 | IF_KW@[55; 57) | ||
46 | LITERAL@[57; 63) | ||
47 | WHITESPACE@[57; 58) | ||
48 | TRUE_KW@[58; 62) | ||
49 | WHITESPACE@[62; 63) | ||
50 | BLOCK@[63; 66) | ||
51 | L_CURLY@[63; 64) | ||
52 | R_CURLY@[64; 65) | ||
53 | WHITESPACE@[65; 66) | ||
54 | ELSE_KW@[66; 70) | ||
55 | IF_EXPR@[70; 91) | ||
56 | WHITESPACE@[70; 71) | ||
57 | IF_KW@[71; 73) | ||
58 | LITERAL@[73; 80) | ||
59 | WHITESPACE@[73; 74) | ||
60 | FALSE_KW@[74; 79) | ||
61 | WHITESPACE@[79; 80) | ||
62 | BLOCK@[80; 83) | ||
63 | L_CURLY@[80; 81) | ||
64 | R_CURLY@[81; 82) | ||
65 | WHITESPACE@[82; 83) | ||
66 | ELSE_KW@[83; 87) | ||
67 | BLOCK@[87; 91) | ||
68 | WHITESPACE@[87; 88) | ||
69 | L_CURLY@[88; 89) | ||
70 | R_CURLY@[89; 90) | ||
71 | WHITESPACE@[90; 91) | ||
72 | R_CURLY@[91; 92) | ||
73 | WHITESPACE@[92; 93) | ||