grammars: nit
This commit is contained in:
parent
de0fd3f7f0
commit
9d9b5a34f6
2 changed files with 4 additions and 2 deletions
|
@ -98,7 +98,7 @@ namespace grammar_parser {
|
|||
pos++;
|
||||
}
|
||||
if (pos == src) {
|
||||
throw std::runtime_error(std::string("expecting name at ") + src);
|
||||
throw std::runtime_error(std::string("expecting integer at ") + src);
|
||||
}
|
||||
return pos;
|
||||
}
|
||||
|
@ -159,6 +159,8 @@ namespace grammar_parser {
|
|||
throw std::runtime_error(std::string("expecting preceding item to */+/?/{ at ") + pos);
|
||||
}
|
||||
|
||||
// apply transformation to previous symbol (last_sym_start to end) according to
|
||||
// the following rewrite rules:
|
||||
// S* --> S{0,}
|
||||
// S+ --> S{1,}
|
||||
// S? --> S{0,1}
|
||||
|
|
|
@ -64,7 +64,7 @@ Parentheses `()` can be used to group sequences, which allows for embedding alte
|
|||
- `?` makes the preceding symbol or sequence optional (equivalent to `{0,1}`).
|
||||
- `{m}` repeats the precedent symbol or sequence exactly `m` times
|
||||
- `{m,}` repeats the precedent symbol or sequence at least `m` times
|
||||
- `{m,n}` repeats the precedent symbol or sequence at betwen `m` and `n` (included) times (included)
|
||||
- `{m,n}` repeats the precedent symbol or sequence at betwen `m` and `n` times (included)
|
||||
- `{,n}` repeats the precedent symbol or sequence at most `n` times (included)
|
||||
|
||||
## Comments and newlines
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue