aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax
diff options
context:
space:
mode:
authorEdwin Cheng <[email protected]>2019-04-23 04:10:41 +0100
committerEdwin Cheng <[email protected]>2019-04-23 04:10:41 +0100
commit6c913d8fa700c8ab58cf386dc958707a248f1379 (patch)
treee1cc915077e76d097ddd9bc6739ba7af8c05dd9f /crates/ra_syntax
parent1705e5887d5c71cad846cb7e840b3c4e03942856 (diff)
Add `...` parsing for fn pointer type
Diffstat (limited to 'crates/ra_syntax')
-rw-r--r--crates/ra_syntax/tests/data/parser/inline/ok/0032_fn_pointer_type.rs1
-rw-r--r--crates/ra_syntax/tests/data/parser/inline/ok/0032_fn_pointer_type.txt44
2 files changed, 44 insertions, 1 deletions
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0032_fn_pointer_type.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0032_fn_pointer_type.rs
index c9bf3bdb4..9493da83d 100644
--- a/crates/ra_syntax/tests/data/parser/inline/ok/0032_fn_pointer_type.rs
+++ b/crates/ra_syntax/tests/data/parser/inline/ok/0032_fn_pointer_type.rs
@@ -1,3 +1,4 @@
1type A = fn(); 1type A = fn();
2type B = unsafe fn(); 2type B = unsafe fn();
3type C = unsafe extern "C" fn(); 3type C = unsafe extern "C" fn();
4type D = extern "C" fn ( u8 , ... ) -> u8;
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0032_fn_pointer_type.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0032_fn_pointer_type.txt
index 89cf543e7..a0a8aea76 100644
--- a/crates/ra_syntax/tests/data/parser/inline/ok/0032_fn_pointer_type.txt
+++ b/crates/ra_syntax/tests/data/parser/inline/ok/0032_fn_pointer_type.txt
@@ -1,4 +1,4 @@
1SOURCE_FILE@[0; 70) 1SOURCE_FILE@[0; 113)
2 TYPE_ALIAS_DEF@[0; 14) 2 TYPE_ALIAS_DEF@[0; 14)
3 TYPE_KW@[0; 4) "type" 3 TYPE_KW@[0; 4) "type"
4 WHITESPACE@[4; 5) " " 4 WHITESPACE@[4; 5) " "
@@ -53,3 +53,45 @@ SOURCE_FILE@[0; 70)
53 R_PAREN@[67; 68) ")" 53 R_PAREN@[67; 68) ")"
54 SEMI@[68; 69) ";" 54 SEMI@[68; 69) ";"
55 WHITESPACE@[69; 70) "\n" 55 WHITESPACE@[69; 70) "\n"
56 TYPE_ALIAS_DEF@[70; 112)
57 TYPE_KW@[70; 74) "type"
58 WHITESPACE@[74; 75) " "
59 NAME@[75; 76)
60 IDENT@[75; 76) "D"
61 WHITESPACE@[76; 77) " "
62 EQ@[77; 78) "="
63 WHITESPACE@[78; 79) " "
64 FN_POINTER_TYPE@[79; 111)
65 ABI@[79; 89)
66 EXTERN_KW@[79; 85) "extern"
67 WHITESPACE@[85; 86) " "
68 STRING@[86; 89) "\"C\""
69 WHITESPACE@[89; 90) " "
70 FN_KW@[90; 92) "fn"
71 WHITESPACE@[92; 93) " "
72 PARAM_LIST@[93; 105)
73 L_PAREN@[93; 94) "("
74 WHITESPACE@[94; 95) " "
75 PARAM@[95; 97)
76 PATH_TYPE@[95; 97)
77 PATH@[95; 97)
78 PATH_SEGMENT@[95; 97)
79 NAME_REF@[95; 97)
80 IDENT@[95; 97) "u8"
81 WHITESPACE@[97; 98) " "
82 COMMA@[98; 99) ","
83 WHITESPACE@[99; 100) " "
84 DOTDOTDOT@[100; 103) "..."
85 WHITESPACE@[103; 104) " "
86 R_PAREN@[104; 105) ")"
87 WHITESPACE@[105; 106) " "
88 RET_TYPE@[106; 111)
89 THIN_ARROW@[106; 108) "->"
90 WHITESPACE@[108; 109) " "
91 PATH_TYPE@[109; 111)
92 PATH@[109; 111)
93 PATH_SEGMENT@[109; 111)
94 NAME_REF@[109; 111)
95 IDENT@[109; 111) "u8"
96 SEMI@[111; 112) ";"
97 WHITESPACE@[112; 113) "\n"