diff options
| author | Thomas Voss <mail@thomasvoss.com> | 2026-03-04 19:23:32 +0100 |
|---|---|---|
| committer | Thomas Voss <mail@thomasvoss.com> | 2026-03-04 19:23:32 +0100 |
| commit | 85747946c426de7d988998541457e7ab8c6f29f4 (patch) | |
| tree | 24215a61702e0ae3deaaac8c16744a2b1dff8fbb /oryxc/src | |
| parent | 8b370ba7af9d40b36e3a28d4c1af465830a3dfc7 (diff) | |
Minor refactor
Diffstat (limited to 'oryxc/src')
| -rw-r--r-- | oryxc/src/parser.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/oryxc/src/parser.rs b/oryxc/src/parser.rs index 1d68747..54526bc 100644 --- a/oryxc/src/parser.rs +++ b/oryxc/src/parser.rs @@ -436,11 +436,12 @@ impl<'a> Parser<'a> { )); } - let extra_data_beg = p.extra_data.len(); + let lhsbeg = p.extra_data.len(); p.extra_data.push(nlexprs as u32); for x in &p.scratch[lhs..rhs] { p.extra_data.push(*x); } + let rhsbeg = p.extra_data.len(); p.extra_data.push(nrexprs as u32); for x in &p.scratch[rhs..] { p.extra_data.push(*x); @@ -449,10 +450,7 @@ impl<'a> Parser<'a> { return Ok(p.new_node(AstNode { kind: AstType::Assign, tok: main_tok, - sub: SubNodes( - extra_data_beg as u32, - (extra_data_beg + nlexprs + 1) as u32, - ), + sub: SubNodes(lhsbeg as u32, rhsbeg as u32), })); }) { Ok(e) => e, |