diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-01-16 15:49:23 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-01-16 15:49:23 +0000 |
commit | e614356de10256c64e02f5d0f82cfa39e27b0f07 (patch) | |
tree | 1ad38d73f8cac5a82e1cb9493016b645a335074a /crates/ra_syntax | |
parent | f4eeff2c82e7d8b95706c2bcb0388eeeb3ddd24e (diff) | |
parent | a766883a751096e5b912b59a14d7b6fc3372c791 (diff) |
Merge #2827
2827: Fix array element attribute position r=matklad a=edwin0cheng
This PR fixed a bug which an ATTR node insert in the wrong place in array element. ~~And introduce `precede_next` for allow outer attributes to insert into a parsed `expr`.~~
related #2783
Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/ra_syntax')
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0135_first_array_member_attributes.txt | 28 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0136_subsequent_array_member_attributes.txt | 28 |
2 files changed, 28 insertions, 28 deletions
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0135_first_array_member_attributes.txt b/crates/ra_syntax/test_data/parser/inline/ok/0135_first_array_member_attributes.txt index 8f2e91bdf..2e3a13005 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0135_first_array_member_attributes.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0135_first_array_member_attributes.txt | |||
@@ -27,20 +27,20 @@ SOURCE_FILE@[0; 56) | |||
27 | ARRAY_EXPR@[23; 54) | 27 | ARRAY_EXPR@[23; 54) |
28 | L_BRACK@[23; 24) "[" | 28 | L_BRACK@[23; 24) "[" |
29 | WHITESPACE@[24; 28) "\n " | 29 | WHITESPACE@[24; 28) "\n " |
30 | ATTR@[28; 40) | 30 | LITERAL@[28; 45) |
31 | POUND@[28; 29) "#" | 31 | ATTR@[28; 40) |
32 | L_BRACK@[29; 30) "[" | 32 | POUND@[28; 29) "#" |
33 | PATH@[30; 33) | 33 | L_BRACK@[29; 30) "[" |
34 | PATH_SEGMENT@[30; 33) | 34 | PATH@[30; 33) |
35 | NAME_REF@[30; 33) | 35 | PATH_SEGMENT@[30; 33) |
36 | IDENT@[30; 33) "cfg" | 36 | NAME_REF@[30; 33) |
37 | TOKEN_TREE@[33; 39) | 37 | IDENT@[30; 33) "cfg" |
38 | L_PAREN@[33; 34) "(" | 38 | TOKEN_TREE@[33; 39) |
39 | IDENT@[34; 38) "test" | 39 | L_PAREN@[33; 34) "(" |
40 | R_PAREN@[38; 39) ")" | 40 | IDENT@[34; 38) "test" |
41 | R_BRACK@[39; 40) "]" | 41 | R_PAREN@[38; 39) ")" |
42 | WHITESPACE@[40; 44) "\n " | 42 | R_BRACK@[39; 40) "]" |
43 | LITERAL@[44; 45) | 43 | WHITESPACE@[40; 44) "\n " |
44 | INT_NUMBER@[44; 45) "1" | 44 | INT_NUMBER@[44; 45) "1" |
45 | COMMA@[45; 46) "," | 45 | COMMA@[45; 46) "," |
46 | WHITESPACE@[46; 50) "\n " | 46 | WHITESPACE@[46; 50) "\n " |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0136_subsequent_array_member_attributes.txt b/crates/ra_syntax/test_data/parser/inline/ok/0136_subsequent_array_member_attributes.txt index 41914eb8e..1bb8a0afc 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0136_subsequent_array_member_attributes.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0136_subsequent_array_member_attributes.txt | |||
@@ -31,20 +31,20 @@ SOURCE_FILE@[0; 56) | |||
31 | INT_NUMBER@[28; 29) "1" | 31 | INT_NUMBER@[28; 29) "1" |
32 | COMMA@[29; 30) "," | 32 | COMMA@[29; 30) "," |
33 | WHITESPACE@[30; 34) "\n " | 33 | WHITESPACE@[30; 34) "\n " |
34 | ATTR@[34; 46) | 34 | LITERAL@[34; 51) |
35 | POUND@[34; 35) "#" | 35 | ATTR@[34; 46) |
36 | L_BRACK@[35; 36) "[" | 36 | POUND@[34; 35) "#" |
37 | PATH@[36; 39) | 37 | L_BRACK@[35; 36) "[" |
38 | PATH_SEGMENT@[36; 39) | 38 | PATH@[36; 39) |
39 | NAME_REF@[36; 39) | 39 | PATH_SEGMENT@[36; 39) |
40 | IDENT@[36; 39) "cfg" | 40 | NAME_REF@[36; 39) |
41 | TOKEN_TREE@[39; 45) | 41 | IDENT@[36; 39) "cfg" |
42 | L_PAREN@[39; 40) "(" | 42 | TOKEN_TREE@[39; 45) |
43 | IDENT@[40; 44) "test" | 43 | L_PAREN@[39; 40) "(" |
44 | R_PAREN@[44; 45) ")" | 44 | IDENT@[40; 44) "test" |
45 | R_BRACK@[45; 46) "]" | 45 | R_PAREN@[44; 45) ")" |
46 | WHITESPACE@[46; 50) "\n " | 46 | R_BRACK@[45; 46) "]" |
47 | LITERAL@[50; 51) | 47 | WHITESPACE@[46; 50) "\n " |
48 | INT_NUMBER@[50; 51) "2" | 48 | INT_NUMBER@[50; 51) "2" |
49 | COMMA@[51; 52) "," | 49 | COMMA@[51; 52) "," |
50 | WHITESPACE@[52; 53) "\n" | 50 | WHITESPACE@[52; 53) "\n" |