irc: support merge operator
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Icfb0cc81542e637d4b91c6a5788370fb6a6a6964
This commit is contained in:
parent
95baf44a9c
commit
3387e0d822
4 changed files with 71 additions and 18 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue