irc: support merge operator

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Icfb0cc81542e637d4b91c6a5788370fb6a6a6964
This commit is contained in:
raf 2026-02-22 01:37:35 +03:00
commit 3387e0d822
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
4 changed files with 71 additions and 18 deletions

View file

@ -43,7 +43,23 @@ enum class NodeType : uint8_t {
ERROR = 0xFF
};
enum class BinaryOp : uint8_t { ADD, SUB, MUL, DIV, CONCAT, EQ, NE, LT, GT, LE, GE, AND, OR, IMPL };
enum class BinaryOp : uint8_t {
ADD,
SUB,
MUL,
DIV,
CONCAT,
EQ,
NE,
LT,
GT,
LE,
GE,
AND,
OR,
IMPL,
MERGE
};
enum class UnaryOp : uint8_t { NEG, NOT };
@ -203,11 +219,11 @@ struct ForceNode {
// Node wraps a variant for type-safe AST
class Node {
public:
using Variant = std::variant<ConstIntNode, ConstFloatNode, ConstStringNode, ConstPathNode,
ConstBoolNode, ConstNullNode, ConstURINode, VarNode, LambdaNode,
AppNode, BinaryOpNode, UnaryOpNode, AttrsetNode, SelectNode,
HasAttrNode, WithNode, IfNode, LetNode, LetRecNode, AssertNode,
ThunkNode, ForceNode>;
using Variant =
std::variant<ConstIntNode, ConstFloatNode, ConstStringNode, ConstPathNode, ConstBoolNode,
ConstNullNode, ConstURINode, VarNode, LambdaNode, AppNode, BinaryOpNode,
UnaryOpNode, AttrsetNode, SelectNode, HasAttrNode, WithNode, IfNode, LetNode,
LetRecNode, AssertNode, ThunkNode, ForceNode>;
Variant data;