diff options
| author | Thomas Voss <mail@thomasvoss.com> | 2026-03-04 01:44:45 +0100 |
|---|---|---|
| committer | Thomas Voss <mail@thomasvoss.com> | 2026-03-04 01:44:45 +0100 |
| commit | 35989b69510400cc6a28190e415687a847cd5a40 (patch) | |
| tree | 09caac6c1b316fcad06c4ce57f90795b4a443ed2 /oryxc | |
| parent | 5a3bb38d18da212d0ad18e406a602bf99e7631ee (diff) | |
Add preliminary root node
Diffstat (limited to 'oryxc')
| -rw-r--r-- | oryxc/src/parser.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/oryxc/src/parser.rs b/oryxc/src/parser.rs index 2b42a8f..815327a 100644 --- a/oryxc/src/parser.rs +++ b/oryxc/src/parser.rs @@ -26,6 +26,7 @@ const MAX_PREC: i64 = 6; #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum AstType { Assign, /* (extra-data-lhs, extra-data-rhs) */ + BinaryOperator, /* (lhs, rhs) */ Block, /* (extra-data, extra-data-len) */ Dereference, /* (lhs, _) */ Empty, /* (_, _) */ @@ -37,9 +38,10 @@ pub enum AstType { Number, /* (_, _) */ Pointer, /* (rhs, _) */ Return, /* (extra-data, extra-data-len) */ + /* TODO: Construct this thing */ + Root, /* (extra-data, extra-data-len) */ String, /* (_, _) */ UnaryOperator, /* (rhs, _) */ - BinaryOperator, /* (lhs, rhs) */ } #[derive(Clone, Copy)] @@ -190,7 +192,10 @@ impl<'a> Parser<'a> { (node, self.node_span_1(expr).1) }, AstType::Pointer => (node, self.node_span_1(_0).1), - AstType::Block | AstType::FunCall | AstType::Return => { + AstType::Block + | AstType::FunCall + | AstType::Return + | AstType::Root => { if _1 == 0 { (node, node) } else { |