diff --git a/to-edn.nix b/to-edn.nix index 738e675..ffde9f5 100644 --- a/to-edn.nix +++ b/to-edn.nix @@ -2,10 +2,14 @@ with lib; let + isSymbol = str: isNull (match "^'.+" str); + stripQuote = head (match "^'(.+)"); + parseStr = str: if (isSymbol str) then (stripQuote str) else ''"${str}"''; + join-str = concatStringsSep " "; toEDN = ds: if isString ds then - ''"${ds}"'' + parseStr ds else (if isInt ds then ds