diff options
author | Li Jin <dragon-fly@qq.com> | 2025-07-17 19:39:27 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2025-07-17 19:39:27 +0800 |
commit | 51a74726e6f68851bafccba0fe69900274a81d59 (patch) | |
tree | 29e648ce3279736bff20f364c5e8d54a7fcdc4d7 /src | |
parent | 828fee1907a8fd8773d304d3d9a49fc0e2f8cb84 (diff) | |
download | yuescript-51a74726e6f68851bafccba0fe69900274a81d59.tar.gz yuescript-51a74726e6f68851bafccba0fe69900274a81d59.tar.bz2 yuescript-51a74726e6f68851bafccba0fe69900274a81d59.zip |
Fixed a reference issue.
Diffstat (limited to 'src')
-rw-r--r-- | src/yuescript/yue_compiler.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/yuescript/yue_compiler.cpp b/src/yuescript/yue_compiler.cpp index f952e9a..3768fc9 100644 --- a/src/yuescript/yue_compiler.cpp +++ b/src/yuescript/yue_compiler.cpp | |||
@@ -9179,7 +9179,7 @@ private: | |||
9179 | } | 9179 | } |
9180 | 9180 | ||
9181 | void transformYAMLMultiline(YAMLMultiline_t* multiline, str_list& out) { | 9181 | void transformYAMLMultiline(YAMLMultiline_t* multiline, str_list& out) { |
9182 | std::optional<std::string_view> indent; | 9182 | std::optional<std::string> indent; |
9183 | str_list temp; | 9183 | str_list temp; |
9184 | for (auto line_ : multiline->lines.objects()) { | 9184 | for (auto line_ : multiline->lines.objects()) { |
9185 | auto line = static_cast<YAMLLine_t*>(line_); | 9185 | auto line = static_cast<YAMLLine_t*>(line_); |
@@ -9210,7 +9210,7 @@ private: | |||
9210 | if (pos == std::string::npos) { | 9210 | if (pos == std::string::npos) { |
9211 | throw CompileError("expecting first line indent"sv, line); | 9211 | throw CompileError("expecting first line indent"sv, line); |
9212 | } | 9212 | } |
9213 | indent = std::string_view{lineStr.c_str(), pos}; | 9213 | indent = std::string{lineStr.c_str(), pos}; |
9214 | } else { | 9214 | } else { |
9215 | if (std::string_view{lineStr}.substr(0, indent.value().size()) != indent.value()) { | 9215 | if (std::string_view{lineStr}.substr(0, indent.value().size()) != indent.value()) { |
9216 | throw CompileError("inconsistent indent"sv, line); | 9216 | throw CompileError("inconsistent indent"sv, line); |