From 6891c86c58459798159519e534659cda55f8b575 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 5 Jun 2023 21:37:12 +0300 Subject: [PATCH] docs: add comments to lua converters --- lib/lua.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/lua.nix b/lib/lua.nix index be285c1..75f96e1 100644 --- a/lib/lua.nix +++ b/lib/lua.nix @@ -12,6 +12,7 @@ then "nil" else "'${value}'"; + # convert an expression to lua expToLua = exp: if builtins.isList exp then listToLuaTable exp @@ -19,9 +20,11 @@ then attrsetToLuaTable exp else ("\"" + builtins.toJSON exp + "\""); + # convert list to a lua table listToLuaTable = list: "{ " + (builtins.concatStringsSep ", " (map expToLua list)) + " }"; + # convert attrset to a lua table attrsetToLuaTable = attrset: "{ " + (