From 9e10c8bf006f42e90a011b8f9284e3ffa52a5859 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 10 Sep 2018 16:36:51 -0700 Subject: Removing dead code and string.as_lua_id() (now just set on string metametatable) --- containers.moon | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'containers.moon') diff --git a/containers.moon b/containers.moon index a9f6857..243e129 100644 --- a/containers.moon +++ b/containers.moon @@ -174,30 +174,5 @@ do if type(i) == 'number' then return sub(@, i, i) elseif type(i) == 'table' then return sub(@, i[1], i[2]) else return text_methods[i] - - assert(("abc")\matches_1("ab")) - - [==[ - text_metatable = - __mul: (other)=> - assert(type(other) == 'number', "Invalid type for multiplication") - return rep(@, other) - __index: (i)=> - -- Use [] for accessing text characters, or s[{3,4}] for s:sub(3,4) - if type(i) == 'number' then return sub(@, i, i) - elseif type(i) == 'table' then return sub(@, i[1], i[2]) - else return text_methods[i] - __tostring: => @_coalesce![1] - __len: => #tostring(@) - __concat: (other)=> tostring(@), tostring(other) - __len: => #tostring(@) - __eq: (other)=> - type(@) == type(other) and getmetatable(@) == getmetatable(other) and tostring(@) == tostring(other) - __lt: (other)=> tostring(@) < tostring(other) - __le: (other)=> tostring(@) <= tostring(other) - __newindex: => error("Cannot modify Text") - - Text = (s)-> setmetatable(s, text_metatable) - ]==] return {:List, :Dict, :Text} -- cgit v1.2.3