From 05283b77da4ba236f02b42d1205433f6b1fcb0d6 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Fri, 5 Mar 2021 10:14:10 +0800 Subject: fix issue #41, add square brackets support for metatable syntax. fix using metatable with "with" syntax issue. --- spec/inputs/metatable.yue | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'spec') diff --git a/spec/inputs/metatable.yue b/spec/inputs/metatable.yue index 6f7b418..13ea917 100644 --- a/spec/inputs/metatable.yue +++ b/spec/inputs/metatable.yue @@ -1,6 +1,8 @@ a = close: true, close#: => print "out of scope" b = add#: (left, right)-> right - left c = key1: true, :add#, key2: true +w = [name]#:123, ["new"]#:(val)=> {val} +w.#["new"] w.#[name] close _ = close#: -> print "out of scope" @@ -40,4 +42,10 @@ tb\func# list import "module" as :index#, newindex#:setFunc +with tb + print .add#, .x\index# "key" + a = .index#.add#\new# 123 + b = t#.close#.test + c = t #.close# .test + nil -- cgit v1.2.3-55-g6feb