diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-09-10 16:36:51 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-09-10 16:37:16 -0700 |
| commit | 9e10c8bf006f42e90a011b8f9284e3ffa52a5859 (patch) | |
| tree | 64af99533def69dbfc4f844e7927418c516ff7cd /containers.lua | |
| parent | 989e133a5798850a9778bc6db8d07c2e5a274893 (diff) | |
Removing dead code and string.as_lua_id() (now just set on string
metametatable)
Diffstat (limited to 'containers.lua')
| -rw-r--r-- | containers.lua | 22 |
1 files changed, 0 insertions, 22 deletions
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, |
