From 281c9eeaff8eac4e666089f80f67cf684e1d001b Mon Sep 17 00:00:00 2001 From: Andrey Tkachenko Date: Thu, 6 Jun 2019 15:36:16 +0400 Subject: [#1083] Try block syntax --- .../tests/data/parser/ok/0051_try_block.rs | 5 ++++ .../tests/data/parser/ok/0051_try_block.txt | 32 ++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 crates/ra_syntax/tests/data/parser/ok/0051_try_block.rs create mode 100644 crates/ra_syntax/tests/data/parser/ok/0051_try_block.txt (limited to 'crates/ra_syntax/tests/data/parser/ok') 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 new file mode 100644 index 000000000..8cc11ddcc --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/ok/0051_try_block.rs @@ -0,0 +1,5 @@ +fn main() { + let res = try { + + }; +} 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 new file mode 100644 index 000000000..f94eb3bcd --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/ok/0051_try_block.txt @@ -0,0 +1,32 @@ +SOURCE_FILE@[0; 41) + FN_DEF@[0; 41) + FN_KW@[0; 2) "fn" + WHITESPACE@[2; 3) " " + NAME@[3; 7) + IDENT@[3; 7) "main" + PARAM_LIST@[7; 9) + L_PAREN@[7; 8) "(" + R_PAREN@[8; 9) ")" + WHITESPACE@[9; 10) " " + BLOCK@[10; 41) + L_CURLY@[10; 11) "{" + WHITESPACE@[11; 16) "\n " + LET_STMT@[16; 39) + LET_KW@[16; 19) "let" + WHITESPACE@[19; 20) " " + BIND_PAT@[20; 23) + NAME@[20; 23) + IDENT@[20; 23) "res" + WHITESPACE@[23; 24) " " + EQ@[24; 25) "=" + WHITESPACE@[25; 26) " " + TRY_EXPR@[26; 38) + TRY_KW@[26; 29) "try" + WHITESPACE@[29; 30) " " + BLOCK@[30; 38) + L_CURLY@[30; 31) "{" + WHITESPACE@[31; 37) "\n\n " + R_CURLY@[37; 38) "}" + SEMI@[38; 39) ";" + WHITESPACE@[39; 40) "\n" + R_CURLY@[40; 41) "}" \ No newline at end of file -- cgit v1.2.3