Skip to content

Commit 9d9b5a3

Browse files
committed
grammars: nit
1 parent de0fd3f commit 9d9b5a3

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

common/grammar-parser.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ namespace grammar_parser {
9898
pos++;
9999
}
100100
if (pos == src) {
101-
throw std::runtime_error(std::string("expecting name at ") + src);
101+
throw std::runtime_error(std::string("expecting integer at ") + src);
102102
}
103103
return pos;
104104
}
@@ -159,6 +159,8 @@ namespace grammar_parser {
159159
throw std::runtime_error(std::string("expecting preceding item to */+/?/{ at ") + pos);
160160
}
161161

162+
// apply transformation to previous symbol (last_sym_start to end) according to
163+
// the following rewrite rules:
162164
// S* --> S{0,}
163165
// S+ --> S{1,}
164166
// S? --> S{0,1}

grammars/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Parentheses `()` can be used to group sequences, which allows for embedding alte
6464
- `?` makes the preceding symbol or sequence optional (equivalent to `{0,1}`).
6565
- `{m}` repeats the precedent symbol or sequence exactly `m` times
6666
- `{m,}` repeats the precedent symbol or sequence at least `m` times
67-
- `{m,n}` repeats the precedent symbol or sequence at betwen `m` and `n` (included) times (included)
67+
- `{m,n}` repeats the precedent symbol or sequence at betwen `m` and `n` times (included)
6868
- `{,n}` repeats the precedent symbol or sequence at most `n` times (included)
6969

7070
## Comments and newlines

0 commit comments

Comments
 (0)