summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2021-04-23 08:56:10 +0800
committerLi Jin <dragon-fly@qq.com>2021-04-23 08:56:10 +0800
commit68499e8060e6fadbf478528b390a8e9168896d4c (patch)
tree7e9f015aca259f6e591775b8a1bab812ff6f00d3
parent6d290f08181a543778c75748b66c513bb8e33423 (diff)
downloadyuescript-68499e8060e6fadbf478528b390a8e9168896d4c.tar.gz
yuescript-68499e8060e6fadbf478528b390a8e9168896d4c.tar.bz2
yuescript-68499e8060e6fadbf478528b390a8e9168896d4c.zip
cleanup.
-rw-r--r--src/yuescript/yue_compiler.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/yuescript/yue_compiler.cpp b/src/yuescript/yue_compiler.cpp
index bc55eb3..1cc5284 100644
--- a/src/yuescript/yue_compiler.cpp
+++ b/src/yuescript/yue_compiler.cpp
@@ -3639,7 +3639,7 @@ private:
3639 info = _parser.parse<BlockEnd_t>(codes); 3639 info = _parser.parse<BlockEnd_t>(codes);
3640 if (!info.node) { 3640 if (!info.node) {
3641 info.error = info.error.substr(info.error.find(':') + 2); 3641 info.error = info.error.substr(info.error.find(':') + 2);
3642 throw std::logic_error(_info.errorMessage(s("failed to expanded macro as block: "sv) + info.error, x)); 3642 throw std::logic_error(_info.errorMessage(s("failed to expand macro as block: "sv) + info.error, x));
3643 } 3643 }
3644 } else { 3644 } else {
3645 info = _parser.parse<Exp_t>(codes); 3645 info = _parser.parse<Exp_t>(codes);
@@ -3647,12 +3647,12 @@ private:
3647 info = _parser.parse<BlockEnd_t>(codes); 3647 info = _parser.parse<BlockEnd_t>(codes);
3648 if (!info.node) { 3648 if (!info.node) {
3649 info.error = info.error.substr(info.error.find(':') + 2); 3649 info.error = info.error.substr(info.error.find(':') + 2);
3650 throw std::logic_error(_info.errorMessage(s("failed to expanded macro as expr or block: "sv) + info.error, x)); 3650 throw std::logic_error(_info.errorMessage(s("failed to expand macro as expr or block: "sv) + info.error, x));
3651 } 3651 }
3652 isBlock = true; 3652 isBlock = true;
3653 } else if (!info.node) { 3653 } else if (!info.node) {
3654 info.error = info.error.substr(info.error.find(':') + 2); 3654 info.error = info.error.substr(info.error.find(':') + 2);
3655 throw std::logic_error(_info.errorMessage(s("failed to expanded macro as expr: "sv) + info.error, x)); 3655 throw std::logic_error(_info.errorMessage(s("failed to expand macro as expr: "sv) + info.error, x));
3656 } 3656 }
3657 } 3657 }
3658 int line = x->m_begin.m_line; 3658 int line = x->m_begin.m_line;
@@ -3715,7 +3715,7 @@ private:
3715 } 3715 }
3716 return {info.node, std::move(info.codes), Empty, std::move(localVars)}; 3716 return {info.node, std::move(info.codes), Empty, std::move(localVars)};
3717 } else { 3717 } else {
3718 if (!isBlock) throw std::logic_error(_info.errorMessage(s("failed to expanded empty macro as expr"sv), x)); 3718 if (!isBlock) throw std::logic_error(_info.errorMessage(s("failed to expand empty macro as expr"sv), x));
3719 return {x->new_ptr<Block_t>().get(), std::move(info.codes), Empty, std::move(localVars)}; 3719 return {x->new_ptr<Block_t>().get(), std::move(info.codes), Empty, std::move(localVars)};
3720 } 3720 }
3721 } 3721 }