mirror of
https://github.com/Noratrieb/uwucc.git
synced 2026-01-14 16:45:07 +01:00
fix plus
This commit is contained in:
parent
dc200d2046
commit
37772658bd
6 changed files with 96 additions and 42 deletions
|
|
@ -196,13 +196,13 @@ where
|
|||
first = false;
|
||||
|
||||
let (declarator, span) = self.declarator()?;
|
||||
if let Some((token, span)) = eat!(self, Tok::Punct(Punct::Eq)) {
|
||||
return Err(ParserError::unsupported(span, &token));
|
||||
}
|
||||
let init_decl = InitDecl {
|
||||
declarator,
|
||||
init: None,
|
||||
let init = if eat!(self, Tok::Punct(Punct::Eq)).is_some() {
|
||||
let expr = self.expr()?;
|
||||
Some(expr)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let init_decl = InitDecl { declarator, init };
|
||||
init_decls.push((init_decl, span));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue