Skip to content

Commit

Permalink
nixd/Syntax: record these address for GC
Browse files Browse the repository at this point in the history
  • Loading branch information
inclyc committed Sep 16, 2023
1 parent 65bd3bd commit e782f19
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions nixd/lib/Syntax/Parser/Parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ expr_function
.Formals = nullptr,
.Body = $3
};
Data->Nodes.record(Func);
Func->Range = mkRange(yylloc, *Data);
$$ = Func;
}
Expand All @@ -84,6 +85,7 @@ expr_function
.Formals = $2,
.Body = $5
};
Data->Nodes.record(Func);
Func->Range = mkRange(yylloc, *Data);
$$ = Func;
}
Expand All @@ -93,6 +95,7 @@ expr_function
.Formals = $2,
.Body = $7
};
Data->Nodes.record(Func);
Func->Range = mkRange(yylloc, *Data);
$$ = Func;
}
Expand All @@ -101,6 +104,7 @@ expr_function
.Cond = $2,
.Body = $4
};
Data->Nodes.record(Assert);
Assert->Range = mkRange(yylloc, *Data);
$$ = Assert;
}
Expand All @@ -109,6 +113,7 @@ expr_function
.Attrs = $2,
.Body = $4
};
Data->Nodes.record(With);
With->Range = mkRange(yylloc, *Data);
$$ = With;
}
Expand All @@ -117,6 +122,7 @@ expr_function
.Binds = $2,
.Body = $4
};
Data->Nodes.record(Let);
Let->Range = mkRange(yylloc, *Data);
$$ = Let;
}
Expand All @@ -131,6 +137,7 @@ expr_if
.Then = $4,
.Else = $6
};
Data->Nodes.record(If);
If->Range = mkRange(yylloc, *Data);
$$ = If;
}
Expand Down

0 comments on commit e782f19

Please sign in to comment.