diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuescript/yue_compiler.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/yuescript/yue_compiler.cpp b/src/yuescript/yue_compiler.cpp index a443f39..1864846 100644 --- a/src/yuescript/yue_compiler.cpp +++ b/src/yuescript/yue_compiler.cpp | |||
| @@ -3787,11 +3787,6 @@ private: | |||
| 3787 | } | 3787 | } |
| 3788 | 3788 | ||
| 3789 | void transformNilCoalesedExp(Exp_t* exp, str_list& out, ExpUsage usage, ExpList_t* assignList = nullptr, bool nilBranchOnly = false) { | 3789 | void transformNilCoalesedExp(Exp_t* exp, str_list& out, ExpUsage usage, ExpList_t* assignList = nullptr, bool nilBranchOnly = false) { |
| 3790 | if (usage == ExpUsage::Closure) { | ||
| 3791 | if (transformAsUpValueFunc(exp, out)) { | ||
| 3792 | return; | ||
| 3793 | } | ||
| 3794 | } | ||
| 3795 | auto x = exp; | 3790 | auto x = exp; |
| 3796 | str_list temp; | 3791 | str_list temp; |
| 3797 | auto left = exp->new_ptr<Exp_t>(); | 3792 | auto left = exp->new_ptr<Exp_t>(); |
| @@ -3814,6 +3809,12 @@ private: | |||
| 3814 | } | 3809 | } |
| 3815 | std::string* funcStart = nullptr; | 3810 | std::string* funcStart = nullptr; |
| 3816 | if (usage == ExpUsage::Closure) { | 3811 | if (usage == ExpUsage::Closure) { |
| 3812 | left->nilCoalesed.set(exp->nilCoalesed); | ||
| 3813 | if (transformAsUpValueFunc(left, temp)) { | ||
| 3814 | out.push_back(join(temp)); | ||
| 3815 | return; | ||
| 3816 | } | ||
| 3817 | left->nilCoalesed.set(nullptr); | ||
| 3817 | pushAnonFunctionScope(); | 3818 | pushAnonFunctionScope(); |
| 3818 | pushAnonVarArg(); | 3819 | pushAnonVarArg(); |
| 3819 | funcStart = &temp.emplace_back(); | 3820 | funcStart = &temp.emplace_back(); |
