From af2ff6eb58f1ebbc374bc2fa0c23fa105b2d490f Mon Sep 17 00:00:00 2001 From: yihuang Date: Fri, 2 Apr 2021 10:59:32 +0800 Subject: [PATCH] fix regex expression on macos --- builder/parser.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builder/parser.nix b/builder/parser.nix index 3c6131d..88bcffa 100644 --- a/builder/parser.nix +++ b/builder/parser.nix @@ -12,14 +12,14 @@ let (lines: map (l: let - m = match "(.*)( |)//.*" l; + m = match "(.*)( )?//.*" l; hasComment = m != null; in stripStr (if hasComment then elemAt m 0 else l)) lines) # 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 (l: l != "")) @@ -102,7 +102,7 @@ let mapAttrs (n: v: let - m = match "=> (.+?) (.+)" v; + m = match "=> ([^ ]+) (.+)" v; m2 = match "=> (.*+)" v; in if m != null then {