diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuescript/yue_compiler.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/yuescript/yue_compiler.cpp b/src/yuescript/yue_compiler.cpp index a8d8053..edab7f4 100644 --- a/src/yuescript/yue_compiler.cpp +++ b/src/yuescript/yue_compiler.cpp | |||
| @@ -806,6 +806,8 @@ private: | |||
| 806 | bool isAssignable(Assignable_t* assignable) { | 806 | bool isAssignable(Assignable_t* assignable) { |
| 807 | if (auto assignableChain = ast_cast<AssignableChain_t>(assignable->item)) { | 807 | if (auto assignableChain = ast_cast<AssignableChain_t>(assignable->item)) { |
| 808 | return isAssignable(assignableChain->items.objects()); | 808 | return isAssignable(assignableChain->items.objects()); |
| 809 | } else if (auto variable = assignable->item.as<Variable_t>()) { | ||
| 810 | checkConst(_parser.toString(variable), variable); | ||
| 809 | } | 811 | } |
| 810 | return true; | 812 | return true; |
| 811 | } | 813 | } |
| @@ -4779,10 +4781,7 @@ private: | |||
| 4779 | _buf << indent() << "end"sv << nll(classDecl); | 4781 | _buf << indent() << "end"sv << nll(classDecl); |
| 4780 | } | 4782 | } |
| 4781 | if (!assignItem.empty()) { | 4783 | if (!assignItem.empty()) { |
| 4782 | auto assignment = toAst<ExpListAssign_t>(assignItem + s(" = "sv) + classVar, classDecl); | 4784 | _buf << indent() << assignItem << " = "sv << classVar << nll(classDecl); |
| 4783 | str_list temp; | ||
| 4784 | transformAssignment(assignment, temp); | ||
| 4785 | _buf << indent() << temp.back() << nll(classDecl); | ||
| 4786 | } | 4785 | } |
| 4787 | switch (usage) { | 4786 | switch (usage) { |
| 4788 | case ExpUsage::Return: { | 4787 | case ExpUsage::Return: { |
