clone
ssh://git@git.notashelf.dev:33/notashelf/nixir.gitCommit 59fedbe78d66
tarballunverified1 files changed+13-1
@@ -29,7 +29,8 @@ enum class NodeType : uint8_t { UNARY_OP = 0x23, ATTRSET = 0x30, SELECT = 0x31,- WITH = 0x32,+ HAS_ATTR = 0x32,+ WITH = 0x33, IF = 0x40, LET = 0x50, LETREC = 0x51,@@ -134,6 +135,13 @@ struct SelectNode { SelectNode(std::shared_ptr<Node> e, std::shared_ptr<Node> a, uint32_t l = 0); }; +struct HasAttrNode {+ std::shared_ptr<Node> expr;+ std::shared_ptr<Node> attr;+ uint32_t line = 0;+ HasAttrNode(std::shared_ptr<Node> e, std::shared_ptr<Node> a, uint32_t l = 0);+};+ struct WithNode { std::shared_ptr<Node> attrs; std::shared_ptr<Node> body;@@ -198,6 +206,7 @@ public: UnaryOpNode, AttrsetNode, SelectNode,+ HasAttrNode, WithNode, IfNode, LetNode,@@ -238,6 +247,9 @@ inline UnaryOpNode::UnaryOpNode(UnaryOp o, std::shared_ptr<Node> operand, uint32 inline SelectNode::SelectNode(std::shared_ptr<Node> e, std::shared_ptr<Node> a, uint32_t l) : expr(e), attr(a), line(l) {} +inline HasAttrNode::HasAttrNode(std::shared_ptr<Node> e, std::shared_ptr<Node> a, uint32_t l)+ : expr(e), attr(a), line(l) {}+ inline WithNode::WithNode(std::shared_ptr<Node> a, std::shared_ptr<Node> b, uint32_t l) : attrs(a), body(b), line(l) {}