aboutsummaryrefslogtreecommitdiff
path: root/nomsu.moon
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-03-06 16:50:20 -0800
committerBruce Hill <bitbucket@bruce-hill.com>2018-03-06 16:50:25 -0800
commit972de38421d14882de192ddbd51afd89c4ffb06c (patch)
tree7d4807fd0f5e6bce6a34a747dabe32d1ce46de20 /nomsu.moon
parent4bc1f59725cfa0f765467c968cbaa7700fddf820 (diff)
Minor cleanup.
Diffstat (limited to 'nomsu.moon')
-rwxr-xr-xnomsu.moon3
1 files changed, 1 insertions, 2 deletions
diff --git a/nomsu.moon b/nomsu.moon
index ecd4cef..51e22c0 100755
--- a/nomsu.moon
+++ b/nomsu.moon
@@ -21,8 +21,6 @@ colors = setmetatable({}, {__index:->""})
colored = setmetatable({}, {__index:(_,color)-> ((msg)-> colors[color]..(msg or '')..colors.reset)})
{:insert, :remove, :concat} = table
-Tuple = immutable(nil, {name:"Tuple", __tostring:=> "Tuple(#{concat [repr(x) for x in *@], ", "})"})
-
-- Use + operator for string coercive concatenation (note: "asdf" + 3 == "asdf3")
-- Use [] for accessing string characters, or s[{3,4}] for s:sub(3,4)
-- Note: This globally affects all strings in this instance of Lua!
@@ -52,6 +50,7 @@ lpeg.setmaxstack 10000 -- whoa
Types = {}
type_tostring = =>
"#{@name}(#{concat [repr(x) for x in *@], ", "})"
+Tuple = immutable(nil, {name:"Tuple"})
for t in *{"File", "Nomsu", "Block", "List", "FunctionCall", "Text", "Dict", "Number", "Word", "Var", "Comment"}
Types[t] = immutable({"id","value"}, {type:t, name:t, __tostring:type_tostring})
Types.DictEntry = immutable({"key","value"}, {name:"DictEntry"})