From 1cd6d6539a9d85bc44db364bb9165e6d9253790d Mon Sep 17 00:00:00 2001 From: Josh Robson Chase Date: Wed, 23 Jan 2019 12:15:47 -0500 Subject: Add raw idents to lexer and parser --- .../tests/data/parser/ok/0039_raw_fn_item.rs | 2 ++ .../tests/data/parser/ok/0039_raw_fn_item.txt | 15 +++++++++++++++ .../data/parser/ok/0040_raw_struct_item_field.rs | 3 +++ .../data/parser/ok/0040_raw_struct_item_field.txt | 22 ++++++++++++++++++++++ 4 files changed, 42 insertions(+) create mode 100644 crates/ra_syntax/tests/data/parser/ok/0039_raw_fn_item.rs create mode 100644 crates/ra_syntax/tests/data/parser/ok/0039_raw_fn_item.txt create mode 100644 crates/ra_syntax/tests/data/parser/ok/0040_raw_struct_item_field.rs create mode 100644 crates/ra_syntax/tests/data/parser/ok/0040_raw_struct_item_field.txt (limited to 'crates/ra_syntax/tests/data/parser') diff --git a/crates/ra_syntax/tests/data/parser/ok/0039_raw_fn_item.rs b/crates/ra_syntax/tests/data/parser/ok/0039_raw_fn_item.rs new file mode 100644 index 000000000..8380d1e79 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/ok/0039_raw_fn_item.rs @@ -0,0 +1,2 @@ +fn r#foo() { +} diff --git a/crates/ra_syntax/tests/data/parser/ok/0039_raw_fn_item.txt b/crates/ra_syntax/tests/data/parser/ok/0039_raw_fn_item.txt new file mode 100644 index 000000000..865a680f2 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/ok/0039_raw_fn_item.txt @@ -0,0 +1,15 @@ +SOURCE_FILE@[0; 15) + FN_DEF@[0; 14) + FN_KW@[0; 2) + WHITESPACE@[2; 3) + NAME@[3; 8) + RAW_IDENT@[3; 8) "r#foo" + PARAM_LIST@[8; 10) + L_PAREN@[8; 9) + R_PAREN@[9; 10) + WHITESPACE@[10; 11) + BLOCK@[11; 14) + L_CURLY@[11; 12) + WHITESPACE@[12; 13) + R_CURLY@[13; 14) + WHITESPACE@[14; 15) diff --git a/crates/ra_syntax/tests/data/parser/ok/0040_raw_struct_item_field.rs b/crates/ra_syntax/tests/data/parser/ok/0040_raw_struct_item_field.rs new file mode 100644 index 000000000..098a60a72 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/ok/0040_raw_struct_item_field.rs @@ -0,0 +1,3 @@ +struct S { + r#foo: u32 +} \ No newline at end of file diff --git a/crates/ra_syntax/tests/data/parser/ok/0040_raw_struct_item_field.txt b/crates/ra_syntax/tests/data/parser/ok/0040_raw_struct_item_field.txt new file mode 100644 index 000000000..4e244cbc5 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/ok/0040_raw_struct_item_field.txt @@ -0,0 +1,22 @@ +SOURCE_FILE@[0; 27) + STRUCT_DEF@[0; 27) + STRUCT_KW@[0; 6) + WHITESPACE@[6; 7) + NAME@[7; 8) + IDENT@[7; 8) "S" + WHITESPACE@[8; 9) + NAMED_FIELD_DEF_LIST@[9; 27) + L_CURLY@[9; 10) + WHITESPACE@[10; 15) + NAMED_FIELD_DEF@[15; 25) + NAME@[15; 20) + RAW_IDENT@[15; 20) "r#foo" + COLON@[20; 21) + WHITESPACE@[21; 22) + PATH_TYPE@[22; 25) + PATH@[22; 25) + PATH_SEGMENT@[22; 25) + NAME_REF@[22; 25) + IDENT@[22; 25) "u32" + WHITESPACE@[25; 26) + R_CURLY@[26; 27) -- cgit v1.2.3 From 3b70acad0106e4ffe5ee68d565c9130b5b271e22 Mon Sep 17 00:00:00 2001 From: Josh Robson Chase Date: Wed, 23 Jan 2019 13:14:34 -0500 Subject: Use IDENT for both raw and normal idents --- crates/ra_syntax/tests/data/parser/ok/0039_raw_fn_item.txt | 2 +- crates/ra_syntax/tests/data/parser/ok/0040_raw_struct_item_field.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_syntax/tests/data/parser') diff --git a/crates/ra_syntax/tests/data/parser/ok/0039_raw_fn_item.txt b/crates/ra_syntax/tests/data/parser/ok/0039_raw_fn_item.txt index 865a680f2..dcd055d86 100644 --- a/crates/ra_syntax/tests/data/parser/ok/0039_raw_fn_item.txt +++ b/crates/ra_syntax/tests/data/parser/ok/0039_raw_fn_item.txt @@ -3,7 +3,7 @@ SOURCE_FILE@[0; 15) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 8) - RAW_IDENT@[3; 8) "r#foo" + IDENT@[3; 8) "r#foo" PARAM_LIST@[8; 10) L_PAREN@[8; 9) R_PAREN@[9; 10) diff --git a/crates/ra_syntax/tests/data/parser/ok/0040_raw_struct_item_field.txt b/crates/ra_syntax/tests/data/parser/ok/0040_raw_struct_item_field.txt index 4e244cbc5..361e53152 100644 --- a/crates/ra_syntax/tests/data/parser/ok/0040_raw_struct_item_field.txt +++ b/crates/ra_syntax/tests/data/parser/ok/0040_raw_struct_item_field.txt @@ -10,7 +10,7 @@ SOURCE_FILE@[0; 27) WHITESPACE@[10; 15) NAMED_FIELD_DEF@[15; 25) NAME@[15; 20) - RAW_IDENT@[15; 20) "r#foo" + IDENT@[15; 20) "r#foo" COLON@[20; 21) WHITESPACE@[21; 22) PATH_TYPE@[22; 25) -- cgit v1.2.3