forked from mirrors/gomod2nix
Merge pull request #9 from yihuang/fix-regex
fix regex expression on macos
This commit is contained in:
commit
67f22dd738
1 changed files with 3 additions and 3 deletions
|
@ -12,14 +12,14 @@ let
|
||||||
(lines: map
|
(lines: map
|
||||||
(l:
|
(l:
|
||||||
let
|
let
|
||||||
m = match "(.*)( |)//.*" l;
|
m = match "(.*)( )?//.*" l;
|
||||||
hasComment = m != null;
|
hasComment = m != null;
|
||||||
in
|
in
|
||||||
stripStr (if hasComment then elemAt m 0 else l))
|
stripStr (if hasComment then elemAt m 0 else l))
|
||||||
lines)
|
lines)
|
||||||
|
|
||||||
# Strip leading tabs characters
|
# Strip leading tabs characters
|
||||||
(lines: map (l: elemAt (match "(\t|)(.*)" l) 1) lines)
|
(lines: map (l: elemAt (match "(\t)?(.*)" l) 1) lines)
|
||||||
|
|
||||||
# Filter empty lines
|
# Filter empty lines
|
||||||
(filter (l: l != ""))
|
(filter (l: l != ""))
|
||||||
|
@ -102,7 +102,7 @@ let
|
||||||
mapAttrs
|
mapAttrs
|
||||||
(n: v:
|
(n: v:
|
||||||
let
|
let
|
||||||
m = match "=> (.+?) (.+)" v;
|
m = match "=> ([^ ]+) (.+)" v;
|
||||||
m2 = match "=> (.*+)" v;
|
m2 = match "=> (.*+)" v;
|
||||||
in
|
in
|
||||||
if m != null then {
|
if m != null then {
|
||||||
|
|
Loading…
Reference in a new issue