fixup do statement
This commit is contained in:
parent
654eda0737
commit
4d3ae67617
2 changed files with 5 additions and 1 deletions
2
lib.nix
2
lib.nix
|
@ -172,7 +172,7 @@ let
|
||||||
]));
|
]));
|
||||||
if' = condition: trueBody: ifelse condition trueBody [ ];
|
if' = condition: trueBody: ifelse condition trueBody [ ];
|
||||||
|
|
||||||
do = body: spaceBetween [ kw_do ] ++ body ++ [ kw_end ];
|
do = body: spaceBetween ([ kw_do ] ++ body ++ [ kw_end ]);
|
||||||
|
|
||||||
isLuaNil = expr: getType expr == "nil";
|
isLuaNil = expr: getType expr == "nil";
|
||||||
LuaNil = { _type = "nil"; };
|
LuaNil = { _type = "nil"; };
|
||||||
|
|
|
@ -258,4 +258,8 @@ with nix2lua; pkgs.lib.runTests {
|
||||||
expr = toLua (requireTo "ls" "luasnip");
|
expr = toLua (requireTo "ls" "luasnip");
|
||||||
expected = ''local ls = require("luasnip")'';
|
expected = ''local ls = require("luasnip")'';
|
||||||
};
|
};
|
||||||
|
"test returns a do-block" = {
|
||||||
|
expr = toLua (do [ (requireTo "ls" "luasnip") ]);
|
||||||
|
expected = ''do local ls = require("luasnip") end'';
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue