File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -11,10 +11,16 @@ function M.line_end(line_to_cursor)
1111end
1212
1313local memoization_mt = {
14+ -- logic operators
15+ -- not
1416 __unm = function (o1 ) return function (...) return not o1 (... ) end end ,
17+ -- or
1518 __add = function (o1 ,o2 ) return function (...) return o1 (... ) or o2 (... ) end end ,
19+ -- and
1620 __mul = function (o1 ,o2 ) return function (...) return o1 (... ) and o2 (... ) end end ,
17- -- TODO more logic operators
21+ -- xnor
22+ __eq = function (o1 ,o2 ) return function (...) return o1 (... ) == o2 (... ) end end ,
23+ -- use table like a function by overloading __call
1824 __call = function (tab , line_to_cursor , matched_trigger , captures )
1925 if not tab .mem or tab .invalidate (tab , line_to_cursor , matched_trigger , captures ) then
2026 tab .mem = tab .func (line_to_cursor , matched_trigger , captures )
You can’t perform that action at this time.
0 commit comments