aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2022-04-02 09:50:09 +0800
committerLi Jin <dragon-fly@qq.com>2022-04-02 09:50:09 +0800
commit1f1af19560054b47935151f298ff06ff2cad5ef9 (patch)
tree0c051c0b137794eb15c8b87f7602c720ed0fe397 /src
parentca1ed557769352c0ac0ca7804dd25e18c1fdf2e1 (diff)
downloadyuescript-1f1af19560054b47935151f298ff06ff2cad5ef9.tar.gz
yuescript-1f1af19560054b47935151f298ff06ff2cad5ef9.tar.bz2
yuescript-1f1af19560054b47935151f298ff06ff2cad5ef9.zip
try fixing overriding issue mentioned in issue #84.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/yuescript/yue_compiler.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/yuescript/yue_compiler.cpp b/src/yuescript/yue_compiler.cpp
index 26a8c5a..3720915 100755
--- a/src/yuescript/yue_compiler.cpp
+++ b/src/yuescript/yue_compiler.cpp
@@ -60,7 +60,7 @@ using namespace parserlib;
60 60
61typedef std::list<std::string> str_list; 61typedef std::list<std::string> str_list;
62 62
63const std::string_view version = "0.10.8"sv; 63const std::string_view version = "0.10.9"sv;
64const std::string_view extension = "yue"sv; 64const std::string_view extension = "yue"sv;
65 65
66class YueCompilerImpl { 66class YueCompilerImpl {
@@ -5344,7 +5344,7 @@ private:
5344 auto mixins = _parser.toString(classDecl->mixes); 5344 auto mixins = _parser.toString(classDecl->mixes);
5345 _buf << "for "sv << mixin << " in *{"sv << mixins << "}\n"sv; 5345 _buf << "for "sv << mixin << " in *{"sv << mixins << "}\n"sv;
5346 _buf << "\tfor "sv << key << ',' << val << " in pairs "sv << mixin << ".__base\n"sv; 5346 _buf << "\tfor "sv << key << ',' << val << " in pairs "sv << mixin << ".__base\n"sv;
5347 _buf << "\t\t"sv << baseVar << '[' << key << "]="sv << val << " if not "sv << key << "\\match\"^__\""sv; 5347 _buf << "\t\t"sv << baseVar << '[' << key << "]="sv << val << " if not "sv << key << "\\match\"^__\" and "sv << baseVar << '[' << key << "] == nil"sv;
5348 transformBlock(toAst<Block_t>(clearBuf(), x), temp, ExpUsage::Common); 5348 transformBlock(toAst<Block_t>(clearBuf(), x), temp, ExpUsage::Common);
5349 } 5349 }
5350 temp.push_back(indent() + baseVar + ".__index = "s + baseVar + nll(classDecl)); 5350 temp.push_back(indent() + baseVar + ".__index = "s + baseVar + nll(classDecl));