Return invalid statement if namespace is not followed by an identifier.

This commit is contained in:
Deukhoofd 2021-06-05 21:04:33 +02:00
parent 43644276bb
commit cf13fa9a90
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
2 changed files with 2 additions and 1 deletions

View File

@ -112,6 +112,7 @@ fn parse_namespace(
},
identifier_token.span,
);
return Box::new(ParsedStatement::Invalid);
}
}
reader.consume(TokenType::OpenCurlyBracket, log);

View File

@ -1,5 +1,5 @@
pub enum ParsedStatement {
Invalid,
Script(Vec<Box<ParsedStatement>>),
Namespace(String, Box<ParsedStatement>),
}