diff options
| author | Li Jin <dragon-fly@qq.com> | 2025-06-03 01:29:18 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2025-06-03 01:29:18 +0800 |
| commit | 98be64dd52df92f7fdd40bae225c279db1676cab (patch) | |
| tree | f6de96c404ce10ec528fa70ee665f35e528acd6b | |
| parent | 444ba6e326a0100fc7265961a846159df92c9716 (diff) | |
| download | yuescript-98be64dd52df92f7fdd40bae225c279db1676cab.tar.gz yuescript-98be64dd52df92f7fdd40bae225c279db1676cab.tar.bz2 yuescript-98be64dd52df92f7fdd40bae225c279db1676cab.zip | |
Kept backward compatibility for YueScript with C++17.
| -rw-r--r-- | src/yuescript/yue_parser.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/yuescript/yue_parser.cpp b/src/yuescript/yue_parser.cpp index 07c1120..e860d55 100644 --- a/src/yuescript/yue_parser.cpp +++ b/src/yuescript/yue_parser.cpp | |||
| @@ -1130,7 +1130,9 @@ 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 {.error = ParseInfo::Error{"invalid rule: "s + std::string{astName}, 1, 1}}; | 1133 | ParseInfo info{}; |
| 1134 | info.error = ParseInfo::Error{"invalid rule: "s + std::string{astName}, 1, 1}; | ||
| 1135 | return info; | ||
| 1134 | } | 1136 | } |
| 1135 | 1137 | ||
| 1136 | bool YueParser::match(std::string_view astName, std::string_view codes) { | 1138 | bool YueParser::match(std::string_view astName, std::string_view codes) { |
