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.lua | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'containers.lua') diff --git a/containers.lua b/containers.lua index ed0825e..865098d 100644 --- a/containers.lua +++ b/containers.lua @@ -379,28 +379,6 @@ do return text_methods[i] end end - assert(("abc"):matches_1("ab")) - local _ = [==[ 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) - ]==] end return { List = List, -- cgit v1.2.3