From db11ea02d777a33fedb6af4ee056e85f52fbb008 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Tue, 17 Mar 2026 19:56:03 +0100 Subject: Lots of code simplification --- oryxc/src/parser.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'oryxc/src/parser.rs') 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, - pub extra: Vec, + pub nodes: Soa, + pub extra: Vec, + pub types: Box<[TypeId]>, + pub textra: boxcar::Vec, } struct Parser<'a> { @@ -917,8 +919,12 @@ pub fn parse(tokens: &Soa) -> Result> { 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![], }); } -- cgit v1.2.3