aboutsummaryrefslogtreecommitdiff
path: root/crates/libsyntax2/tests/data/parser/inline
diff options
context:
space:
mode:
Diffstat (limited to 'crates/libsyntax2/tests/data/parser/inline')
-rw-r--r--crates/libsyntax2/tests/data/parser/inline/0067_block_expr.rs1
-rw-r--r--crates/libsyntax2/tests/data/parser/inline/0067_block_expr.txt23
-rw-r--r--crates/libsyntax2/tests/data/parser/inline/0108_misplaced_label_err.rs3
-rw-r--r--crates/libsyntax2/tests/data/parser/inline/0108_misplaced_label_err.txt28
4 files changed, 49 insertions, 6 deletions
diff --git a/crates/libsyntax2/tests/data/parser/inline/0067_block_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0067_block_expr.rs
index ec3780a04..2fed74c5e 100644
--- a/crates/libsyntax2/tests/data/parser/inline/0067_block_expr.rs
+++ b/crates/libsyntax2/tests/data/parser/inline/0067_block_expr.rs
@@ -1,4 +1,5 @@
1fn foo() { 1fn foo() {
2 {}; 2 {};
3 unsafe {}; 3 unsafe {};
4 'label: {};
4} 5}
diff --git a/crates/libsyntax2/tests/data/parser/inline/0067_block_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0067_block_expr.txt
index 94104e746..12a1ff49a 100644
--- a/crates/libsyntax2/tests/data/parser/inline/0067_block_expr.txt
+++ b/crates/libsyntax2/tests/data/parser/inline/0067_block_expr.txt
@@ -1,5 +1,5 @@
1ROOT@[0; 36) 1ROOT@[0; 52)
2 FN_DEF@[0; 35) 2 FN_DEF@[0; 51)
3 FN_KW@[0; 2) 3 FN_KW@[0; 2)
4 WHITESPACE@[2; 3) 4 WHITESPACE@[2; 3)
5 NAME@[3; 6) 5 NAME@[3; 6)
@@ -8,7 +8,7 @@ ROOT@[0; 36)
8 L_PAREN@[6; 7) 8 L_PAREN@[6; 7)
9 R_PAREN@[7; 8) 9 R_PAREN@[7; 8)
10 WHITESPACE@[8; 9) 10 WHITESPACE@[8; 9)
11 BLOCK@[9; 35) 11 BLOCK@[9; 51)
12 L_CURLY@[9; 10) 12 L_CURLY@[9; 10)
13 WHITESPACE@[10; 15) 13 WHITESPACE@[10; 15)
14 EXPR_STMT@[15; 18) 14 EXPR_STMT@[15; 18)
@@ -26,6 +26,17 @@ ROOT@[0; 36)
26 L_CURLY@[30; 31) 26 L_CURLY@[30; 31)
27 R_CURLY@[31; 32) 27 R_CURLY@[31; 32)
28 SEMI@[32; 33) 28 SEMI@[32; 33)
29 WHITESPACE@[33; 34) 29 WHITESPACE@[33; 38)
30 R_CURLY@[34; 35) 30 EXPR_STMT@[38; 49)
31 WHITESPACE@[35; 36) 31 BLOCK_EXPR@[38; 48)
32 LABEL@[38; 45)
33 LIFETIME@[38; 44) "'label"
34 COLON@[44; 45)
35 WHITESPACE@[45; 46)
36 BLOCK@[46; 48)
37 L_CURLY@[46; 47)
38 R_CURLY@[47; 48)
39 SEMI@[48; 49)
40 WHITESPACE@[49; 50)
41 R_CURLY@[50; 51)
42 WHITESPACE@[51; 52)
diff --git a/crates/libsyntax2/tests/data/parser/inline/0108_misplaced_label_err.rs b/crates/libsyntax2/tests/data/parser/inline/0108_misplaced_label_err.rs
new file mode 100644
index 000000000..a2164c510
--- /dev/null
+++ b/crates/libsyntax2/tests/data/parser/inline/0108_misplaced_label_err.rs
@@ -0,0 +1,3 @@
1fn main() {
2 'loop: impl
3}
diff --git a/crates/libsyntax2/tests/data/parser/inline/0108_misplaced_label_err.txt b/crates/libsyntax2/tests/data/parser/inline/0108_misplaced_label_err.txt
new file mode 100644
index 000000000..d00305b97
--- /dev/null
+++ b/crates/libsyntax2/tests/data/parser/inline/0108_misplaced_label_err.txt
@@ -0,0 +1,28 @@
1ROOT@[0; 30)
2 FN_DEF@[0; 29)
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@[10; 29)
12 L_CURLY@[10; 11)
13 WHITESPACE@[11; 16)
14 EXPR_STMT@[16; 22)
15 ERROR@[16; 22)
16 LABEL@[16; 22)
17 LIFETIME@[16; 21) "'loop"
18 COLON@[21; 22)
19 err: `expected a loop`
20 err: `expected SEMI`
21 WHITESPACE@[22; 23)
22 IMPL_ITEM@[23; 27)
23 IMPL_KW@[23; 27)
24 err: `expected type`
25 err: `expected `{``
26 WHITESPACE@[27; 28)
27 R_CURLY@[28; 29)
28 WHITESPACE@[29; 30)