diff options
author | Li Jin <dragon-fly@qq.com> | 2025-05-30 17:48:14 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2025-05-30 17:48:21 +0800 |
commit | 444ba6e326a0100fc7265961a846159df92c9716 (patch) | |
tree | 28ad87d43a0821016780d02b6733a0cc05445d46 /src | |
parent | cea79554c2edceff30fe4815a3f784544f8557c3 (diff) | |
download | yuescript-444ba6e326a0100fc7265961a846159df92c9716.tar.gz yuescript-444ba6e326a0100fc7265961a846159df92c9716.tar.bz2 yuescript-444ba6e326a0100fc7265961a846159df92c9716.zip |
fix a crash issue in `yue.to_ast()`.
Diffstat (limited to 'src')
-rw-r--r-- | src/yuescript/yue_parser.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/yuescript/yue_parser.cpp b/src/yuescript/yue_parser.cpp index 0cf7f05..07c1120 100644 --- a/src/yuescript/yue_parser.cpp +++ b/src/yuescript/yue_parser.cpp | |||
@@ -1130,7 +1130,7 @@ ParseInfo YueParser::parse(std::string_view astName, std::string_view codes, boo | |||
1130 | if (it != _rules.end()) { | 1130 | if (it != _rules.end()) { |
1131 | return parse(codes, *it->second, lax); | 1131 | return parse(codes, *it->second, lax); |
1132 | } | 1132 | } |
1133 | return {}; | 1133 | return {.error = ParseInfo::Error{"invalid rule: "s + std::string{astName}, 1, 1}}; |
1134 | } | 1134 | } |
1135 | 1135 | ||
1136 | bool YueParser::match(std::string_view astName, std::string_view codes) { | 1136 | bool YueParser::match(std::string_view astName, std::string_view codes) { |