mirror of
https://github.com/roc-lang/roc.git
synced 2025-11-03 06:02:54 +00:00
Unary SExpr node
This commit is contained in:
parent
69a8648754
commit
ee2a055a8d
1 changed files with 11 additions and 0 deletions
|
|
@ -3476,6 +3476,17 @@ pub const NodeStore = struct {
|
|||
operator: TokenIdx,
|
||||
expr: ExprIdx,
|
||||
region: Region,
|
||||
|
||||
pub fn toSExpr(self: *const @This(), env: *base.ModuleEnv, ir: *IR, line_starts: std.ArrayList((u32))) sexpr.Expr {
|
||||
var node = sexpr.Expr.init(env.gpa, "unary");
|
||||
node.appendRegionChild(env.gpa, ir.regionInfo(self.region, line_starts));
|
||||
node.appendStringChild(env.gpa, ir.resolve(self.operator));
|
||||
|
||||
var expr = ir.store.getExpr(self.expr).toSExpr(env, ir, line_starts);
|
||||
node.appendNodeChild(env.gpa, &expr);
|
||||
|
||||
return node;
|
||||
}
|
||||
};
|
||||
|
||||
pub const DataSpan = struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue