[Parser]
`mod` keyword is now used to declare modules and no longer define them inline
@@ -3,7 +3,9 @@ use super::*;
pub struct ModuleParser;
impl ModuleParser {
- pub(crate) fn parse_module_definition(parser: &mut Parser) -> Result<(String, Program), ParserError> {
+ pub(crate) fn parse_module_decl(parser: &mut Parser) -> Result<String, ParserError> {
+ // Currently on the mod keyword
+ //
parser.peek_check_kind_advance(TokenKind::Ident)?;
let module_identifier = match parser.curr_token.token() {
@@ -11,12 +13,8 @@ impl ModuleParser {
_=> unreachable!()
};
- parser.peek_check_variant_advance(&Token::LeftBrace)?;
- // Advance past the Left brace
- parser.advance_tokens();
+ parser.peek_check_variant_advance(&Token::Semicolon)?;
- let module = parser.parse_module();
-
- Ok((module_identifier, module))
+ Ok(module_identifier)
}
}
\ No newline at end of file
