diff options
Diffstat (limited to 'nomsu_tree.lua')
| -rw-r--r-- | nomsu_tree.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/nomsu_tree.lua b/nomsu_tree.lua index bbb12ab..64b4efc 100644 --- a/nomsu_tree.lua +++ b/nomsu_tree.lua @@ -100,6 +100,17 @@ for _index_0 = 1, #types do end return replacement end + cls.__eq = function(self, other) + if type(self) ~= type(other) or #self ~= #other or getmetatable(self) ~= getmetatable(other) then + return false + end + for i = 1, #self do + if self[i] ~= other[i] then + return false + end + end + return true + end end AST[name] = setmetatable(cls, { __tostring = function(self) |
