From b454eb5a600779a9ab6f7bea251772bdd98b81b9 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Tue, 30 Apr 2019 23:22:48 +0800 Subject: Add macro pat parsing --- .../tests/data/parser/inline/ok/0129_marco_pat.rs | 3 ++ .../tests/data/parser/inline/ok/0129_marco_pat.txt | 36 ++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 crates/ra_syntax/tests/data/parser/inline/ok/0129_marco_pat.rs create mode 100644 crates/ra_syntax/tests/data/parser/inline/ok/0129_marco_pat.txt (limited to 'crates/ra_syntax/tests/data') diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0129_marco_pat.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0129_marco_pat.rs new file mode 100644 index 000000000..811181d9b --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0129_marco_pat.rs @@ -0,0 +1,3 @@ +fn main() { + let m!(x) = 0; +} diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0129_marco_pat.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0129_marco_pat.txt new file mode 100644 index 000000000..50b4ab2e7 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0129_marco_pat.txt @@ -0,0 +1,36 @@ +SOURCE_FILE@[0; 33) + FN_DEF@[0; 32) + 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; 32) + L_CURLY@[10; 11) "{" + WHITESPACE@[11; 16) "\n " + LET_STMT@[16; 30) + LET_KW@[16; 19) "let" + WHITESPACE@[19; 20) " " + MACRO_CALL@[20; 25) + PATH_PAT@[20; 21) + PATH@[20; 21) + PATH_SEGMENT@[20; 21) + NAME_REF@[20; 21) + IDENT@[20; 21) "m" + EXCL@[21; 22) "!" + TOKEN_TREE@[22; 25) + L_PAREN@[22; 23) "(" + IDENT@[23; 24) "x" + R_PAREN@[24; 25) ")" + WHITESPACE@[25; 26) " " + EQ@[26; 27) "=" + WHITESPACE@[27; 28) " " + LITERAL@[28; 29) + INT_NUMBER@[28; 29) "0" + SEMI@[29; 30) ";" + WHITESPACE@[30; 31) "\n" + R_CURLY@[31; 32) "}" + WHITESPACE@[32; 33) "\n" -- cgit v1.2.3