Spaces:
Running
Running
whisper : update grammar-parser.cpp (#2058)
Browse files
examples/grammar-parser.cpp
CHANGED
|
@@ -190,7 +190,7 @@ namespace grammar_parser {
|
|
| 190 |
pos = parse_space(pos + 1, is_nested);
|
| 191 |
} else if (*pos == '*' || *pos == '+' || *pos == '?') { // repetition operator
|
| 192 |
if (last_sym_start == out_elements.size()) {
|
| 193 |
-
throw std::runtime_error(std::string("expecting
|
| 194 |
}
|
| 195 |
|
| 196 |
// apply transformation to previous symbol (last_sym_start to end) according to
|
|
|
|
| 190 |
pos = parse_space(pos + 1, is_nested);
|
| 191 |
} else if (*pos == '*' || *pos == '+' || *pos == '?') { // repetition operator
|
| 192 |
if (last_sym_start == out_elements.size()) {
|
| 193 |
+
throw std::runtime_error(std::string("expecting preceding item to */+/? at ") + pos);
|
| 194 |
}
|
| 195 |
|
| 196 |
// apply transformation to previous symbol (last_sym_start to end) according to
|