From 444ba6e326a0100fc7265961a846159df92c9716 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Fri, 30 May 2025 17:48:14 +0800 Subject: fix a crash issue in `yue.to_ast()`. --- src/yuescript/yue_parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 if (it != _rules.end()) { return parse(codes, *it->second, lax); } - return {}; + return {.error = ParseInfo::Error{"invalid rule: "s + std::string{astName}, 1, 1}}; } bool YueParser::match(std::string_view astName, std::string_view codes) { -- cgit v1.2.3-55-g6feb