mirror of
https://github.com/vale981/poetry2nix
synced 2025-03-04 16:51:40 -05:00
pep508: Also return ungrouped expressions
This commit is contained in:
parent
ff8d58af7d
commit
17cfb71c37
1 changed files with 4 additions and 4 deletions
|
@ -14,9 +14,9 @@ let
|
|||
posNew = acc.pos + 1;
|
||||
isOpen = acc.openP == 0;
|
||||
startPos = if isOpen then posNew else acc.startPos;
|
||||
exprs = if isOpen then acc.exprs else acc.exprs ++ [ (substr acc.exprPos (acc.pos - 1) acc.expr) ];
|
||||
in acc // {
|
||||
inherit exprs startPos;
|
||||
inherit startPos;
|
||||
exprs = acc.exprs ++ [ (substr acc.exprPos (acc.pos - 1) acc.expr) ];
|
||||
pos = posNew;
|
||||
openP = acc.openP + 1;
|
||||
}
|
||||
|
@ -47,8 +47,8 @@ let
|
|||
|
||||
parseExpressions = exprs: let
|
||||
splitCond = (s: builtins.map
|
||||
(x: if builtins.typeOf x == "list" then (builtins.elemAt x 0) else x)
|
||||
(builtins.split " (and|or) " s));
|
||||
(x: stripStr (if builtins.typeOf x == "list" then (builtins.elemAt x 0) else x))
|
||||
(builtins.split " (and|or) " (s + " ")));
|
||||
|
||||
mapfn = expr: (
|
||||
if (builtins.match "^ ?$" expr != null) then null # Filter empty
|
||||
|
|
Loading…
Add table
Reference in a new issue