diff options
author | Li Jin <dragon-fly@qq.com> | 2022-09-08 09:26:49 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2022-09-08 09:26:49 +0800 |
commit | d4af1fa275b1d27229fc995f4a45137380040933 (patch) | |
tree | 955c76511d7021e6d1a0f06b46de3852eeac4176 /spec/inputs/switch.yue | |
parent | df85ad2e7f975026ca1e6bd84b26fff81c8d99c8 (diff) | |
download | yuescript-d4af1fa275b1d27229fc995f4a45137380040933.tar.gz yuescript-d4af1fa275b1d27229fc995f4a45137380040933.tar.bz2 yuescript-d4af1fa275b1d27229fc995f4a45137380040933.zip |
redesigned metatable syntax. add support for destructuring a field with string and expression
Diffstat (limited to 'spec/inputs/switch.yue')
-rw-r--r-- | spec/inputs/switch.yue | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/inputs/switch.yue b/spec/inputs/switch.yue index 442d15f..cb1eb31 100644 --- a/spec/inputs/switch.yue +++ b/spec/inputs/switch.yue | |||
@@ -101,7 +101,7 @@ do | |||
101 | print "Object A" | 101 | print "Object A" |
102 | when ClassB | 102 | when ClassB |
103 | print "Object B" | 103 | print "Object B" |
104 | when #: mt | 104 | when <>: mt |
105 | print "A table with metatable" | 105 | print "A table with metatable" |
106 | else | 106 | else |
107 | print "item not accepted!" | 107 | print "item not accepted!" |
@@ -156,7 +156,7 @@ do | |||
156 | 156 | ||
157 | do | 157 | do |
158 | switch y | 158 | switch y |
159 | when {x: #: mt} | 159 | when {x: <>: mt} |
160 | print mt | 160 | print mt |
161 | 161 | ||
162 | nil | 162 | nil |