implemented infix operator parsing

This commit is contained in:
Karma Riuk
2025-07-11 10:30:37 +02:00
parent 6e471a91d5
commit a7f5950a55
7 changed files with 155 additions and 6 deletions

View File

@@ -4,6 +4,13 @@
namespace ast {
infix_expr::infix_expr(
token::token token, std::string op, ast::expression* left
)
: token(std::move(token)),
op(op),
left(left) {}
std::string infix_expr::token_literal() const {
return token.literal;
}

View File

@@ -5,6 +5,7 @@
namespace ast {
struct infix_expr : expression {
infix_expr(token::token, std::string, ast::expression*);
token::token token;
expression* left;
std::string op;