aboutsummaryrefslogtreecommitdiff
path: root/src/parser/grammar/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser/grammar/mod.rs')
-rw-r--r--src/parser/grammar/mod.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/parser/grammar/mod.rs b/src/parser/grammar/mod.rs
index b949583ff..6e82d7c69 100644
--- a/src/parser/grammar/mod.rs
+++ b/src/parser/grammar/mod.rs
@@ -44,12 +44,22 @@ fn alias(p: &mut Parser) -> bool {
44 if p.at(AS_KW) { 44 if p.at(AS_KW) {
45 let alias = p.start(); 45 let alias = p.start();
46 p.bump(); 46 p.bump();
47 p.expect(IDENT); 47 name(p);
48 alias.complete(p, ALIAS); 48 alias.complete(p, ALIAS);
49 } 49 }
50 true //FIXME: return false if three are errors 50 true //FIXME: return false if three are errors
51} 51}
52 52
53fn name(p: &mut Parser) {
54 if p.at(IDENT) {
55 let m = p.start();
56 p.bump();
57 m.complete(p, NAME);
58 } else {
59 p.error("expected a name");
60 }
61}
62
53fn error_block(p: &mut Parser, message: &str) { 63fn error_block(p: &mut Parser, message: &str) {
54 assert!(p.at(L_CURLY)); 64 assert!(p.at(L_CURLY));
55 let err = p.start(); 65 let err = p.start();