Skip to content

Commit 444ba6e

Browse files
committed
fix a crash issue in yue.to_ast().
1 parent cea7955 commit 444ba6e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/yuescript/yue_parser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,7 @@ ParseInfo YueParser::parse(std::string_view astName, std::string_view codes, boo
11301130
if (it != _rules.end()) {
11311131
return parse(codes, *it->second, lax);
11321132
}
1133-
return {};
1133+
return {.error = ParseInfo::Error{"invalid rule: "s + std::string{astName}, 1, 1}};
11341134
}
11351135

11361136
bool YueParser::match(std::string_view astName, std::string_view codes) {

0 commit comments

Comments
 (0)