diff --git a/moonscript/parse/env.lua b/moonscript/parse/env.lua index 6dbed84..f805211 100644 --- a/moonscript/parse/env.lua +++ b/moonscript/parse/env.lua @@ -34,8 +34,9 @@ wrap_env = function(debug, fn) end wrap_name = function(name) local v = V(name) - v = Cmt("", function() - iprint("* " .. name) + v = Cmt("", function(str, pos) + local rest = str:sub(pos, -1):match("^([^\n]*)") + iprint("* " .. tostring(name) .. " (" .. tostring(rest) .. ")") indent = indent + 1 return true end) * Cmt(v, function(str, pos, ...) diff --git a/moonscript/parse/env.moon b/moonscript/parse/env.moon index 25dcc1e..ea71c3d 100644 --- a/moonscript/parse/env.moon +++ b/moonscript/parse/env.moon @@ -18,8 +18,10 @@ wrap_env = (debug, fn) -> wrap_name = (name) -> v = V name - v = Cmt("", -> - iprint "* " .. name + v = Cmt("", (str, pos) -> + rest = str\sub(pos, -1)\match "^([^\n]*)" + + iprint "* #{name} (#{rest})" indent += 1 true ) * Cmt(v, (str, pos, ...) ->