diff options
| author | Li Jin <dragon-fly@qq.com> | 2026-02-11 17:38:58 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2026-02-11 17:38:58 +0800 |
| commit | c65ead24430d0cb3b0af3f896df43827dbf7bbb2 (patch) | |
| tree | 4c2fc8a368ca6c39e74674e37384620d2b609ce8 /src | |
| parent | 663a8c622db13b3a9dad962071ff6f3cfb482de3 (diff) | |
| download | yuescript-c65ead24430d0cb3b0af3f896df43827dbf7bbb2.tar.gz yuescript-c65ead24430d0cb3b0af3f896df43827dbf7bbb2.tar.bz2 yuescript-c65ead24430d0cb3b0af3f896df43827dbf7bbb2.zip | |
Fixed issues.
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuescript/yue_compiler.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/yuescript/yue_compiler.cpp b/src/yuescript/yue_compiler.cpp index bd52d33..caeee53 100644 --- a/src/yuescript/yue_compiler.cpp +++ b/src/yuescript/yue_compiler.cpp | |||
| @@ -10391,6 +10391,10 @@ private: | |||
| 10391 | if (breakWithVar.empty()) { | 10391 | if (breakWithVar.empty()) { |
| 10392 | transformIf(ifNode, temp, ExpUsage::Common); | 10392 | transformIf(ifNode, temp, ExpUsage::Common); |
| 10393 | } else { | 10393 | } else { |
| 10394 | if (extraBreakVar) { | ||
| 10395 | addToScope(breakWithVar); | ||
| 10396 | temp.push_back(indent() + "local "s + breakWithVar + nl(with)); | ||
| 10397 | } | ||
| 10394 | auto simpleValue = x->new_ptr<SimpleValue_t>(); | 10398 | auto simpleValue = x->new_ptr<SimpleValue_t>(); |
| 10395 | simpleValue->value.set(ifNode); | 10399 | simpleValue->value.set(ifNode); |
| 10396 | auto exp = newExp(simpleValue, x); | 10400 | auto exp = newExp(simpleValue, x); |
| @@ -10404,10 +10408,7 @@ private: | |||
| 10404 | auto block = x->new_ptr<Block_t>(); | 10408 | auto block = x->new_ptr<Block_t>(); |
| 10405 | block->statementOrComments.push_back(stmt); | 10409 | block->statementOrComments.push_back(stmt); |
| 10406 | repeatNode->body.set(block); | 10410 | repeatNode->body.set(block); |
| 10407 | auto sVal = x->new_ptr<SimpleValue_t>(); | 10411 | transformRepeat(repeatNode, temp); |
| 10408 | sVal->value.set(repeatNode); | ||
| 10409 | auto asmt = assignmentFrom(toAst<Exp_t>(breakWithVar, x), newExp(sVal, x), x); | ||
| 10410 | transformAssignment(asmt, temp); | ||
| 10411 | } | 10412 | } |
| 10412 | } else { | 10413 | } else { |
| 10413 | bool transformed = false; | 10414 | bool transformed = false; |
