aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/test_data
diff options
context:
space:
mode:
authorMichael Chesser <[email protected]>2020-01-06 22:59:03 +0000
committerMichael Chesser <[email protected]>2020-01-06 22:59:03 +0000
commitce1b34fd59a6145a4bb5682d672c846e101725d4 (patch)
tree8a9535261dac04f171caa68d4b908cdde0b4a34c /crates/ra_syntax/test_data
parentc92a090f49cad2fa540562536f07fcb619f16680 (diff)
Improve const generics parsing
- Handle const generics type args - Fix issue with const generic as first parameter in trait impl
Diffstat (limited to 'crates/ra_syntax/test_data')
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0039_type_arg.rs2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0039_type_arg.txt51
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0150_impl_type_params.rs1
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0150_impl_type_params.txt38
4 files changed, 73 insertions, 19 deletions
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0039_type_arg.rs b/crates/ra_syntax/test_data/parser/inline/ok/0039_type_arg.rs
index 385c43131..0d07d7651 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0039_type_arg.rs
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0039_type_arg.rs
@@ -1 +1 @@
type A = B<'static, i32, Item=u64>; type A = B<'static, i32, 1, { 2 }, Item=u64>;
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0039_type_arg.txt b/crates/ra_syntax/test_data/parser/inline/ok/0039_type_arg.txt
index 4786bf77a..025faf5ca 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0039_type_arg.txt
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0039_type_arg.txt
@@ -1,5 +1,5 @@
1SOURCE_FILE@[0; 36) 1SOURCE_FILE@[0; 46)
2 TYPE_ALIAS_DEF@[0; 35) 2 TYPE_ALIAS_DEF@[0; 45)
3 TYPE_KW@[0; 4) "type" 3 TYPE_KW@[0; 4) "type"
4 WHITESPACE@[4; 5) " " 4 WHITESPACE@[4; 5) " "
5 NAME@[5; 6) 5 NAME@[5; 6)
@@ -7,12 +7,12 @@ SOURCE_FILE@[0; 36)
7 WHITESPACE@[6; 7) " " 7 WHITESPACE@[6; 7) " "
8 EQ@[7; 8) "=" 8 EQ@[7; 8) "="
9 WHITESPACE@[8; 9) " " 9 WHITESPACE@[8; 9) " "
10 PATH_TYPE@[9; 34) 10 PATH_TYPE@[9; 44)
11 PATH@[9; 34) 11 PATH@[9; 44)
12 PATH_SEGMENT@[9; 34) 12 PATH_SEGMENT@[9; 44)
13 NAME_REF@[9; 10) 13 NAME_REF@[9; 10)
14 IDENT@[9; 10) "B" 14 IDENT@[9; 10) "B"
15 TYPE_ARG_LIST@[10; 34) 15 TYPE_ARG_LIST@[10; 44)
16 L_ANGLE@[10; 11) "<" 16 L_ANGLE@[10; 11) "<"
17 LIFETIME_ARG@[11; 18) 17 LIFETIME_ARG@[11; 18)
18 LIFETIME@[11; 18) "\'static" 18 LIFETIME@[11; 18) "\'static"
@@ -26,15 +26,30 @@ SOURCE_FILE@[0; 36)
26 IDENT@[20; 23) "i32" 26 IDENT@[20; 23) "i32"
27 COMMA@[23; 24) "," 27 COMMA@[23; 24) ","
28 WHITESPACE@[24; 25) " " 28 WHITESPACE@[24; 25) " "
29 ASSOC_TYPE_ARG@[25; 33) 29 CONST_ARG@[25; 26)
30 NAME_REF@[25; 29) 30 INT_NUMBER@[25; 26) "1"
31 IDENT@[25; 29) "Item" 31 COMMA@[26; 27) ","
32 EQ@[29; 30) "=" 32 WHITESPACE@[27; 28) " "
33 PATH_TYPE@[30; 33) 33 CONST_ARG@[28; 33)
34 PATH@[30; 33) 34 BLOCK_EXPR@[28; 33)
35 PATH_SEGMENT@[30; 33) 35 BLOCK@[28; 33)
36 NAME_REF@[30; 33) 36 L_CURLY@[28; 29) "{"
37 IDENT@[30; 33) "u64" 37 WHITESPACE@[29; 30) " "
38 R_ANGLE@[33; 34) ">" 38 LITERAL@[30; 31)
39 SEMI@[34; 35) ";" 39 INT_NUMBER@[30; 31) "2"
40 WHITESPACE@[35; 36) "\n" 40 WHITESPACE@[31; 32) " "
41 R_CURLY@[32; 33) "}"
42 COMMA@[33; 34) ","
43 WHITESPACE@[34; 35) " "
44 ASSOC_TYPE_ARG@[35; 43)
45 NAME_REF@[35; 39)
46 IDENT@[35; 39) "Item"
47 EQ@[39; 40) "="
48 PATH_TYPE@[40; 43)
49 PATH@[40; 43)
50 PATH_SEGMENT@[40; 43)
51 NAME_REF@[40; 43)
52 IDENT@[40; 43) "u64"
53 R_ANGLE@[43; 44) ">"
54 SEMI@[44; 45) ";"
55 WHITESPACE@[45; 46) "\n"
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0150_impl_type_params.rs b/crates/ra_syntax/test_data/parser/inline/ok/0150_impl_type_params.rs
new file mode 100644
index 000000000..cb0a105c2
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0150_impl_type_params.rs
@@ -0,0 +1 @@
impl<const N: u32> Bar<N> {}
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0150_impl_type_params.txt b/crates/ra_syntax/test_data/parser/inline/ok/0150_impl_type_params.txt
new file mode 100644
index 000000000..47fadef85
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0150_impl_type_params.txt
@@ -0,0 +1,38 @@
1SOURCE_FILE@[0; 29)
2 IMPL_BLOCK@[0; 28)
3 IMPL_KW@[0; 4) "impl"
4 TYPE_PARAM_LIST@[4; 18)
5 L_ANGLE@[4; 5) "<"
6 CONST_PARAM@[5; 17)
7 CONST_KW@[5; 10) "const"
8 WHITESPACE@[10; 11) " "
9 NAME@[11; 12)
10 IDENT@[11; 12) "N"
11 COLON@[12; 13) ":"
12 WHITESPACE@[13; 14) " "
13 PATH_TYPE@[14; 17)
14 PATH@[14; 17)
15 PATH_SEGMENT@[14; 17)
16 NAME_REF@[14; 17)
17 IDENT@[14; 17) "u32"
18 R_ANGLE@[17; 18) ">"
19 WHITESPACE@[18; 19) " "
20 PATH_TYPE@[19; 25)
21 PATH@[19; 25)
22 PATH_SEGMENT@[19; 25)
23 NAME_REF@[19; 22)
24 IDENT@[19; 22) "Bar"
25 TYPE_ARG_LIST@[22; 25)
26 L_ANGLE@[22; 23) "<"
27 TYPE_ARG@[23; 24)
28 PATH_TYPE@[23; 24)
29 PATH@[23; 24)
30 PATH_SEGMENT@[23; 24)
31 NAME_REF@[23; 24)
32 IDENT@[23; 24) "N"
33 R_ANGLE@[24; 25) ">"
34 WHITESPACE@[25; 26) " "
35 ITEM_LIST@[26; 28)
36 L_CURLY@[26; 27) "{"
37 R_CURLY@[27; 28) "}"
38 WHITESPACE@[28; 29) "\n"