aboutsummaryrefslogtreecommitdiff
path: root/src/parser/grammar
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-02-11 08:57:05 +0000
committerAleksey Kladov <[email protected]>2018-02-11 08:57:05 +0000
commit2fb33b2d0d14f09ee06a42bca252dccbf57185e1 (patch)
tree466298401a342259c20c27b141b157a8d5e61fe3 /src/parser/grammar
parenteb4c05d572ff0c4e92452232d6591d7a2796e785 (diff)
G: placeholder types
Diffstat (limited to 'src/parser/grammar')
-rw-r--r--src/parser/grammar/types.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/parser/grammar/types.rs b/src/parser/grammar/types.rs
index 003341db5..37b74bfe7 100644
--- a/src/parser/grammar/types.rs
+++ b/src/parser/grammar/types.rs
@@ -7,6 +7,7 @@ pub(super) fn type_(p: &mut Parser) {
7 STAR => pointer_type(p), 7 STAR => pointer_type(p),
8 L_BRACK => array_or_slice_type(p), 8 L_BRACK => array_or_slice_type(p),
9 AMPERSAND => reference_type(p), 9 AMPERSAND => reference_type(p),
10 UNDERSCORE => placeholder_type(p),
10 IDENT => path_type(p), 11 IDENT => path_type(p),
11 _ => { 12 _ => {
12 p.error("expected type"); 13 p.error("expected type");
@@ -130,6 +131,15 @@ fn reference_type(p: &mut Parser) {
130 m.complete(p, REFERENCE_TYPE); 131 m.complete(p, REFERENCE_TYPE);
131} 132}
132 133
134// test placeholder_type
135// type Placeholder = _;
136fn placeholder_type(p: &mut Parser) {
137 assert!(p.at(UNDERSCORE));
138 let m = p.start();
139 p.bump();
140 m.complete(p, PLACEHOLDER_TYPE);
141}
142
133fn path_type(p: &mut Parser) { 143fn path_type(p: &mut Parser) {
134 assert!(p.at(IDENT)); 144 assert!(p.at(IDENT));
135 let m = p.start(); 145 let m = p.start();