mirror of
https://github.com/Noratrieb/uwucc.git
synced 2026-01-14 16:45:07 +01:00
analysis
This commit is contained in:
parent
b74c11987b
commit
475a520de3
8 changed files with 61 additions and 8 deletions
|
|
@ -261,4 +261,4 @@ pub enum ExternalDecl {
|
|||
FunctionDef(FunctionDef),
|
||||
}
|
||||
|
||||
pub type TranslationUnit = Vec<ExternalDecl>;
|
||||
pub type TranslationUnit = Vec<Spanned<ExternalDecl>>;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use std::fmt::Debug;
|
|||
|
||||
use crate::token::Token;
|
||||
|
||||
mod ast;
|
||||
pub mod ast;
|
||||
mod parser;
|
||||
mod pre;
|
||||
mod pretty;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use crate::{
|
|||
ast::{
|
||||
Decl, DeclAttr, DeclSpec, Declarator, DirectDeclarator, ExternalDecl, FunctionDef,
|
||||
FunctionParamDecl, Ident, InitDecl, IntTy, IntTyKind, IntTySignedness, NormalDecl, Stmt,
|
||||
TypeSpecifier,
|
||||
TypeSpecifier, TranslationUnit,
|
||||
},
|
||||
pre::Punctuator as P,
|
||||
token::{Keyword as Kw, Token as Tok},
|
||||
|
|
@ -567,7 +567,7 @@ where
|
|||
|
||||
pub fn parse_declarations<'src>(
|
||||
src: impl Iterator<Item = (Tok<'src>, Span)>,
|
||||
) -> Result<Vec<Spanned<ExternalDecl>>> {
|
||||
) -> Result<TranslationUnit> {
|
||||
use peekmore::PeekMore;
|
||||
|
||||
let mut parser = Parser {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue