add pipe, lambda shorts
This commit is contained in:
parent
6f94ad4a53
commit
278cd32830
1 changed files with 13 additions and 7 deletions
20
lib.nix
20
lib.nix
|
@ -119,8 +119,8 @@ let
|
|||
|
||||
local = expr: spaceBetween [ kw_local expr ];
|
||||
set = variable: value: join " = " [ (raw variable) value ];
|
||||
func = fnName: params: body:
|
||||
(concatLines
|
||||
func' = fnName: params: body:
|
||||
(spaceBetween
|
||||
([
|
||||
(concat [
|
||||
(spaceBetween [ kw_function (validFuncName fnName) ])
|
||||
|
@ -130,7 +130,10 @@ let
|
|||
++ body
|
||||
++ [ kw_end ])
|
||||
);
|
||||
lambda = func "";
|
||||
func = fnName: params: body:
|
||||
func' fnName params (concatLines body);
|
||||
lambda = func' "";
|
||||
lambda0 = lambda [ ];
|
||||
|
||||
return = expr: spaceBetween ([ kw_return expr ]);
|
||||
return_void = return null;
|
||||
|
@ -195,8 +198,13 @@ in
|
|||
inherit toLua;
|
||||
|
||||
inherit LuaNil;
|
||||
inherit raw join concat concatLines pipe;
|
||||
inherit namedField call require local set func ifelse if';
|
||||
inherit raw join concat concatLines;
|
||||
inherit pipe pipe1;
|
||||
|
||||
inherit namedField require local set ifelse if';
|
||||
|
||||
inherit call call0 call1;
|
||||
inherit func lambda lambda0;
|
||||
|
||||
inherit op;
|
||||
inherit eq ne gt lt gte lte;
|
||||
|
@ -208,8 +216,6 @@ in
|
|||
# useful aliases
|
||||
var = raw;
|
||||
vars = map raw;
|
||||
inherit call0 call1;
|
||||
inherit lambda;
|
||||
|
||||
inherit validString;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue