Return invalid statement if namespace is not followed by an identifier.
This commit is contained in:
parent
43644276bb
commit
cf13fa9a90
|
@ -112,6 +112,7 @@ fn parse_namespace(
|
||||||
},
|
},
|
||||||
identifier_token.span,
|
identifier_token.span,
|
||||||
);
|
);
|
||||||
|
return Box::new(ParsedStatement::Invalid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
reader.consume(TokenType::OpenCurlyBracket, log);
|
reader.consume(TokenType::OpenCurlyBracket, log);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
pub enum ParsedStatement {
|
pub enum ParsedStatement {
|
||||||
|
Invalid,
|
||||||
Script(Vec<Box<ParsedStatement>>),
|
Script(Vec<Box<ParsedStatement>>),
|
||||||
Namespace(String, Box<ParsedStatement>),
|
Namespace(String, Box<ParsedStatement>),
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue