aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/tests
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/tests')
-rw-r--r--crates/ra_syntax/tests/data/parser/inline/ok/0130_try_block_expr.rs3
-rw-r--r--crates/ra_syntax/tests/data/parser/inline/ok/0130_try_block_expr.txt31
-rw-r--r--crates/ra_syntax/tests/data/parser/ok/0051_try_block.rs5
-rw-r--r--crates/ra_syntax/tests/data/parser/ok/0051_try_block.txt32
4 files changed, 34 insertions, 37 deletions
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0130_try_block_expr.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0130_try_block_expr.rs
new file mode 100644
index 000000000..0f1b41eb6
--- /dev/null
+++ b/crates/ra_syntax/tests/data/parser/inline/ok/0130_try_block_expr.rs
@@ -0,0 +1,3 @@
1fn foo() {
2 let _ = try {};
3}
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0130_try_block_expr.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0130_try_block_expr.txt
new file mode 100644
index 000000000..53f49b9b5
--- /dev/null
+++ b/crates/ra_syntax/tests/data/parser/inline/ok/0130_try_block_expr.txt
@@ -0,0 +1,31 @@
1SOURCE_FILE@[0; 33)
2 FN_DEF@[0; 32)
3 FN_KW@[0; 2) "fn"
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@[9; 32)
12 L_CURLY@[9; 10) "{"
13 WHITESPACE@[10; 15) "\n "
14 LET_STMT@[15; 30)
15 LET_KW@[15; 18) "let"
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 TRY_EXPR@[23; 29)
23 TRY_KW@[23; 26) "try"
24 WHITESPACE@[26; 27) " "
25 BLOCK@[27; 29)
26 L_CURLY@[27; 28) "{"
27 R_CURLY@[28; 29) "}"
28 SEMI@[29; 30) ";"
29 WHITESPACE@[30; 31) "\n"
30 R_CURLY@[31; 32) "}"
31 WHITESPACE@[32; 33) "\n"
diff --git a/crates/ra_syntax/tests/data/parser/ok/0051_try_block.rs b/crates/ra_syntax/tests/data/parser/ok/0051_try_block.rs
deleted file mode 100644
index 8cc11ddcc..000000000
--- a/crates/ra_syntax/tests/data/parser/ok/0051_try_block.rs
+++ /dev/null
@@ -1,5 +0,0 @@
1fn main() {
2 let res = try {
3
4 };
5}
diff --git a/crates/ra_syntax/tests/data/parser/ok/0051_try_block.txt b/crates/ra_syntax/tests/data/parser/ok/0051_try_block.txt
deleted file mode 100644
index f94eb3bcd..000000000
--- a/crates/ra_syntax/tests/data/parser/ok/0051_try_block.txt
+++ /dev/null
@@ -1,32 +0,0 @@
1SOURCE_FILE@[0; 41)
2 FN_DEF@[0; 41)
3 FN_KW@[0; 2) "fn"
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; 41)
12 L_CURLY@[10; 11) "{"
13 WHITESPACE@[11; 16) "\n "
14 LET_STMT@[16; 39)
15 LET_KW@[16; 19) "let"
16 WHITESPACE@[19; 20) " "
17 BIND_PAT@[20; 23)
18 NAME@[20; 23)
19 IDENT@[20; 23) "res"
20 WHITESPACE@[23; 24) " "
21 EQ@[24; 25) "="
22 WHITESPACE@[25; 26) " "
23 TRY_EXPR@[26; 38)
24 TRY_KW@[26; 29) "try"
25 WHITESPACE@[29; 30) " "
26 BLOCK@[30; 38)
27 L_CURLY@[30; 31) "{"
28 WHITESPACE@[31; 37) "\n\n "
29 R_CURLY@[37; 38) "}"
30 SEMI@[38; 39) ";"
31 WHITESPACE@[39; 40) "\n"
32 R_CURLY@[40; 41) "}" \ No newline at end of file