Hello.
I am having some issues involving enums that could recurse.
Node::BinaryOpNode
will recurse with two other Node
s which could recurse farther or it could stop at Int, Float, or String. Is there a way to make it allow/work around this?
pub enum Node {
IntNode {
token: tokens::Token,
value: i32,
start: lexer::LexerPosition, end: lexer::LexerPosition
},
FloatNode {
token: tokens::Token,
value: f32,
start: lexer::LexerPosition, end: lexer::LexerPosition
},
StringNode {
token: tokens::Token,
value: String,
start: lexer::LexerPosition, end: lexer::LexerPosition
},
BinaryOpNode {
left : Node,
optoken: tokens::Token,
right : Node,
start: lexer::LexerPosition, end: lexer::LexerPosition
}
}