Commit 33a8b54
committed
fix: accept option-name extensions, group options, and extension range options
Four places where the grammar was stricter than the language spec and than
what protoc and protocompile accept:
- optionName permits a parenthesized extension in every dot-separated part,
each optionally fully qualified, not just a bare identifier after the
first part. This is what edition feature options look like in practice:
option features.(pb.go).api_level = API_OPAQUE;
- group takes an optional field-option list, like any other field.
- oneof bodies may contain a group.
- extensions takes an optional extension-range-option list.
Parsing 7693 .proto files collected from module caches, these four account
for 347 of 686 files that failed to parse.1 parent 49ebc24 commit 33a8b54
8 files changed
Lines changed: 4806 additions & 3434 deletions
File tree
- src
- test/corpus
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
85 | | - | |
| 87 | + | |
86 | 88 | | |
87 | 89 | | |
88 | 90 | | |
89 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
90 | 95 | | |
91 | 96 | | |
92 | 97 | | |
| |||
171 | 176 | | |
172 | 177 | | |
173 | 178 | | |
174 | | - | |
| 179 | + | |
175 | 180 | | |
176 | 181 | | |
177 | 182 | | |
| |||
180 | 185 | | |
181 | 186 | | |
182 | 187 | | |
| 188 | + | |
183 | 189 | | |
184 | 190 | | |
185 | 191 | | |
| |||
220 | 226 | | |
221 | 227 | | |
222 | 228 | | |
| 229 | + | |
223 | 230 | | |
224 | 231 | | |
225 | 232 | | |
| |||
297 | 304 | | |
298 | 305 | | |
299 | 306 | | |
| 307 | + | |
300 | 308 | | |
301 | 309 | | |
302 | 310 | | |
| 311 | + | |
303 | 312 | | |
304 | 313 | | |
305 | 314 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments