diff options
author | Aleksey Kladov <[email protected]> | 2018-08-24 09:21:13 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-08-24 09:21:13 +0100 |
commit | 719710a13256a32b9fcbf06c1ff43f8961b9b2e6 (patch) | |
tree | c194449b1fe2f6e7d4a1133cd10bf30b73d81998 /crates/libsyntax2/tests/data | |
parent | a66c94af1bad3c2dcfd8dd4c07494d0cf6cc8b1b (diff) |
break&continue
Diffstat (limited to 'crates/libsyntax2/tests/data')
5 files changed, 102 insertions, 12 deletions
diff --git a/crates/libsyntax2/tests/data/parser/err/0012_broken_lambda.rs b/crates/libsyntax2/tests/data/parser/err/0012_broken_lambda.rs deleted file mode 100644 index ad0d8eb4c..000000000 --- a/crates/libsyntax2/tests/data/parser/err/0012_broken_lambda.rs +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
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/inline/0105_continue_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0105_continue_expr.rs new file mode 100644 index 000000000..474cc3f0e --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0105_continue_expr.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | loop { | ||
3 | continue; | ||
4 | continue 'l; | ||
5 | } | ||
6 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0105_continue_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0105_continue_expr.txt new file mode 100644 index 000000000..05526fda6 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0105_continue_expr.txt | |||
@@ -0,0 +1,35 @@ | |||
1 | FILE@[0; 69) | ||
2 | FN_DEF@[0; 68) | ||
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; 68) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | LOOP_EXPR@[15; 66) | ||
15 | LOOP_KW@[15; 19) | ||
16 | WHITESPACE@[19; 20) | ||
17 | BLOCK_EXPR@[20; 66) | ||
18 | L_CURLY@[20; 21) | ||
19 | WHITESPACE@[21; 30) | ||
20 | EXPR_STMT@[30; 39) | ||
21 | CONTINUE_EXPR@[30; 38) | ||
22 | CONTINUE_KW@[30; 38) | ||
23 | SEMI@[38; 39) | ||
24 | WHITESPACE@[39; 48) | ||
25 | EXPR_STMT@[48; 60) | ||
26 | CONTINUE_EXPR@[48; 59) | ||
27 | CONTINUE_KW@[48; 56) | ||
28 | WHITESPACE@[56; 57) | ||
29 | LIFETIME@[57; 59) "'l" | ||
30 | SEMI@[59; 60) | ||
31 | WHITESPACE@[60; 65) | ||
32 | R_CURLY@[65; 66) | ||
33 | WHITESPACE@[66; 67) | ||
34 | R_CURLY@[67; 68) | ||
35 | WHITESPACE@[68; 69) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0106_break_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0106_break_expr.rs new file mode 100644 index 000000000..1b4094636 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0106_break_expr.rs | |||
@@ -0,0 +1,8 @@ | |||
1 | fn foo() { | ||
2 | loop { | ||
3 | break; | ||
4 | break 'l; | ||
5 | break 92; | ||
6 | break 'l 92; | ||
7 | } | ||
8 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0106_break_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0106_break_expr.txt new file mode 100644 index 000000000..bb490e441 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0106_break_expr.txt | |||
@@ -0,0 +1,53 @@ | |||
1 | FILE@[0; 102) | ||
2 | FN_DEF@[0; 101) | ||
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; 101) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | LOOP_EXPR@[15; 99) | ||
15 | LOOP_KW@[15; 19) | ||
16 | WHITESPACE@[19; 20) | ||
17 | BLOCK_EXPR@[20; 99) | ||
18 | L_CURLY@[20; 21) | ||
19 | WHITESPACE@[21; 30) | ||
20 | EXPR_STMT@[30; 36) | ||
21 | BREAK_EXPR@[30; 35) | ||
22 | BREAK_KW@[30; 35) | ||
23 | SEMI@[35; 36) | ||
24 | WHITESPACE@[36; 45) | ||
25 | EXPR_STMT@[45; 54) | ||
26 | BREAK_EXPR@[45; 53) | ||
27 | BREAK_KW@[45; 50) | ||
28 | WHITESPACE@[50; 51) | ||
29 | LIFETIME@[51; 53) "'l" | ||
30 | SEMI@[53; 54) | ||
31 | WHITESPACE@[54; 63) | ||
32 | EXPR_STMT@[63; 72) | ||
33 | BREAK_EXPR@[63; 71) | ||
34 | BREAK_KW@[63; 68) | ||
35 | WHITESPACE@[68; 69) | ||
36 | LITERAL@[69; 71) | ||
37 | INT_NUMBER@[69; 71) "92" | ||
38 | SEMI@[71; 72) | ||
39 | WHITESPACE@[72; 81) | ||
40 | EXPR_STMT@[81; 93) | ||
41 | BREAK_EXPR@[81; 92) | ||
42 | BREAK_KW@[81; 86) | ||
43 | WHITESPACE@[86; 87) | ||
44 | LIFETIME@[87; 89) "'l" | ||
45 | WHITESPACE@[89; 90) | ||
46 | LITERAL@[90; 92) | ||
47 | INT_NUMBER@[90; 92) "92" | ||
48 | SEMI@[92; 93) | ||
49 | WHITESPACE@[93; 98) | ||
50 | R_CURLY@[98; 99) | ||
51 | WHITESPACE@[99; 100) | ||
52 | R_CURLY@[100; 101) | ||
53 | WHITESPACE@[101; 102) | ||