diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-01-26 15:18:56 -0800 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-01-26 15:19:05 -0800 |
| commit | d5aa4e52983712f9f4c5b23528d0c2dab12b0b33 (patch) | |
| tree | f7d03c285b9fa9f62dbe5cc4b01f13f5c289488a | |
| parent | 95f3f55ff2598cd3f00baa3317ebd98ce252f0be (diff) | |
Minor fix for value_to_nomsu
| -rw-r--r-- | nomsu.lua | 2 | ||||
| -rwxr-xr-x | nomsu.moon | 4 |
2 files changed, 3 insertions, 3 deletions
@@ -806,7 +806,7 @@ do local _accum_0 = { } local _len_0 = 1 for k, v in pairs(value) do - _accum_0[_len_0] = tostring(self:value_to_nomsu(k)) .. "=" .. tostring(self:value_to_nomsu(v)) + _accum_0[_len_0] = tostring(self:value_to_nomsu(k)) .. ":" .. tostring(self:value_to_nomsu(v)) _len_0 = _len_0 + 1 end return _accum_0 @@ -39,7 +39,6 @@ do -- Add compiler options for optimization level (compile-fast vs. run-fast, etc.) -- Do a pass on all actions to enforce parameters-are-nouns heuristic -- Maybe do some sort of lazy definitions of actions that defer until they're used in code --- Change nomsu:tree_to_lua() to use a table lookup instead of a switch statement lpeg.setmaxstack 10000 -- whoa {:P,:R,:V,:S,:Cg,:C,:Cp,:B,:Cmt} = lpeg @@ -580,12 +579,13 @@ class NomsuCompiler when "bool" return value and "(yes)" or "(no)" when "number" + -- TODO: support NaN, inf, etc.? return repr(value) when "table" if is_list(value) return "[#{concat [@value_to_nomsu(v) for v in *value], ", "}]" else - return "{#{concat ["#{@value_to_nomsu(k)}=#{@value_to_nomsu(v)}" for k,v in pairs(value)], ", "}}" + return "{#{concat ["#{@value_to_nomsu(k)}:#{@value_to_nomsu(v)}" for k,v in pairs(value)], ", "}}" when "string" if value == "\n" return "'\\n'" |
