diff options
Diffstat (limited to 'oryxc/src/parser.rs')
| -rw-r--r-- | oryxc/src/parser.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/oryxc/src/parser.rs b/oryxc/src/parser.rs index 629b290..8c24df1 100644 --- a/oryxc/src/parser.rs +++ b/oryxc/src/parser.rs @@ -46,8 +46,10 @@ pub struct AstNode { #[derive(Debug)] pub struct Ast { - pub nodes: Soa<AstNode>, - pub extra: Vec<u32>, + pub nodes: Soa<AstNode>, + pub extra: Vec<u32>, + pub types: Box<[TypeId]>, + pub textra: boxcar::Vec<TypeId>, } struct Parser<'a> { @@ -917,8 +919,12 @@ pub fn parse(tokens: &Soa<Token>) -> Result<Ast, Vec<OryxError>> { tok: 0, sub: SubNodes(stmtsbeg as u32, nstmts as u32), }); + let nodecnt = p.ast.len(); return Ok(Ast { - nodes: p.ast, - extra: p.extra_data, + nodes: p.ast, + extra: p.extra_data, + types: vec![TypeId::INVALID; nodecnt].into_boxed_slice(), + /* TODO: Get the parser to try to compute the required capacity */ + textra: boxcar::vec![], }); } |