mirror of
https://github.com/Noratrieb/uwucc.git
synced 2026-01-14 16:45:07 +01:00
can parse global variable declarations
This commit is contained in:
parent
f53c054a9a
commit
4b646b9128
5 changed files with 189 additions and 74 deletions
|
|
@ -371,10 +371,20 @@ where
|
|||
span.extend(span2),
|
||||
))
|
||||
} else {
|
||||
expect!(self, Tok::Punct(Punct::Semicolon));
|
||||
Ok((ExternalDecl::Decl(declaration), span))
|
||||
}
|
||||
}
|
||||
|
||||
fn external_declarations(&mut self) -> Result<Vec<Spanned<ExternalDecl>>> {
|
||||
let mut decls = Vec::new();
|
||||
while self.peek_t().is_ok() {
|
||||
let decl = self.external_declaration()?;
|
||||
decls.push(decl);
|
||||
}
|
||||
Ok(decls)
|
||||
}
|
||||
|
||||
fn function_param_declaration_list(&mut self) -> Result<FunctionParams> {
|
||||
// If the declarator includes a parameter type list, the declaration of each parameter shall
|
||||
// include an identifier, except for the special case of a parameter list consisting of a single
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue