Support let..in
parent
5c95b808ba
commit
7f3eda388c
@ -0,0 +1 @@
|
||||
let x = { a = 1; b = x.a + 1; c = x.b + 1; }; in x.c
|
@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
|
||||
const nixTypes = require("./_nix-types");
|
||||
|
||||
module.exports = {
|
||||
name: "let-in",
|
||||
visitors: {
|
||||
NixLetIn: (node) => {
|
||||
return nixTypes.NixAttributeSelection(
|
||||
nixTypes.NixAttributeSet([
|
||||
... node.bind,
|
||||
nixTypes.NixBinding(
|
||||
[ nixTypes.NixAttributeIdentifier("$$jsNix$letBody") ],
|
||||
node.body
|
||||
)
|
||||
], true),
|
||||
[ nixTypes.NixAttributeIdentifier("$$jsNix$letBody") ]
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue