From 70a7abacbb36783fb77025814242faf32a6c8a47 Mon Sep 17 00:00:00 2001 From: SoniEx2 Date: Mon, 10 Jun 2024 15:01:41 -0300 Subject: Fix parsing of certain constructs --- test/tests.cratera | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') diff --git a/test/tests.cratera b/test/tests.cratera index fd97917..8977b74 100644 --- a/test/tests.cratera +++ b/test/tests.cratera @@ -9,6 +9,7 @@ t[T] = t t.f = print t.ff = print t.g = function(self, a) print(self, a[1]) end +t.h = function(self, v) return v end t[F] = print local _f="f" local _t="t" @@ -48,6 +49,17 @@ _=(t:[_t].f(11)) -- inside () t:[_t].g {12} -- table call t:[_t].f "13" -- string call +;(function()return t end)():[(function() return t:[(function()return"t"end)()].h("t") end)()].f(14) -- function using traits in trait key +;(function()return t end)():[(function() return (function()return t end)():[(function()return"t"end)()].h("t") end)()].f(15) -- function using traits in trait key +local function call_f(v) + (function()return t end)():["t"].f(v) +end +call_f(16) +call_f = function(v) + (function()return t end)():["t"].f(v) +end +call_f(17) +;t.t.t.t.h(t, t):["t"].f(18) entity = {} -- cgit 1.4.1