refactor(lexer, ast): Rewrite decl with c standard grammar of decl
This commit is contained in:
@@ -225,7 +225,7 @@ impl Parser {
|
||||
self.must_match_token(&TokenValue::LParen, "`(`")?;
|
||||
let init = if self.peek().value == TokenValue::Semicolon {
|
||||
None
|
||||
} else if matches!(self.peek().value, TokenValue::TypeIdent(_)) {
|
||||
} else if matches!(self.peek().value, TokenValue::Static | TokenValue::TypeIdent(_)) {
|
||||
Some(ForInit::VarDecl(self.parse_var_decl_stmt_inner(ParseType::MustParse, false)?))
|
||||
} else {
|
||||
Some(ForInit::Expr(self.parse_expr()?))
|
||||
|
||||
Reference in New Issue
Block a user