diff options
author | Li Jin <dragon-fly@qq.com> | 2022-05-16 10:25:19 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2022-05-16 10:25:19 +0800 |
commit | de91fff7af15ae9c4a27d34b5b9266f900412a29 (patch) | |
tree | 9ececd242d326c8d5fec84043112782c95174b76 /spec/inputs | |
parent | a9fe6a5c4c17cf7e8305c1d614939ce510fb1103 (diff) | |
download | yuescript-de91fff7af15ae9c4a27d34b5b9266f900412a29.tar.gz yuescript-de91fff7af15ae9c4a27d34b5b9266f900412a29.tar.bz2 yuescript-de91fff7af15ae9c4a27d34b5b9266f900412a29.zip |
fix issue #101 by supporting metamethod syntax in class block.
Diffstat (limited to 'spec/inputs')
-rw-r--r-- | spec/inputs/class.yue | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/spec/inputs/class.yue b/spec/inputs/class.yue index c7be481..9091d23 100644 --- a/spec/inputs/class.yue +++ b/spec/inputs/class.yue | |||
@@ -232,7 +232,14 @@ class extends lapis.Application | |||
232 | class A using B, C, D, {value: 123} | 232 | class A using B, C, D, {value: 123} |
233 | 233 | ||
234 | class Example | 234 | class Example |
235 | @field1 = 1 | 235 | @field1 = 1 |
236 | @field2 = @field1 + 1 | 236 | @field2 = @field1 + 1 |
237 | |||
238 | class Foo | ||
239 | new: (x) => @x = x | ||
240 | mul#: (y) => @x * y | ||
241 | ["dsd-dsd"]#: 123 | ||
242 | :add | ||
243 | :add# | ||
237 | 244 | ||
238 | nil | 245 | nil |