DiagnosticsΒΆ
Everything fpeg finds in a grammar has a stable code, and every code has a page here with a grammar that shows it and the grammar fixed. The message beside the code says what exactly is meant.
A code that starts with
Eis an error: the grammar cannot be used until it is fixed.A code that starts with
Wis a warning: the grammar works, and likely not as its author meant. A warning says what holds whatever the input is, so a grammar without warnings is not proven right. Where a check takes something for granted that a grammar can make untrue, its page says what, as the page of W301 does.
fpeg check prints each one with its place in the grammar file, line and column counted from 1:
grammar.fpeg:1:8: error[E201]: unknown rule item
The hundreds of a code tell its area.
Codes |
Area |
|---|---|
E101 to E104 |
reading the grammar text |
E201 to E208 |
names and references |
E301 to E310 |
forms that do not fit where they stand |
E401, E402 |
limits on the size of a grammar |
E501 |
what a later release brings |
E601 to E605 |
grammars that extend and import others |
E901 |
a bug of fpeg itself |
W101 to W103 |
alternatives that a choice never reaches |
W201, W202 |
repetition and recursion that do not do what they seem to |
W301, W302 |
transparent rules whose tree is not what it seems |
W401 to W403 |
flags, parameters and recoveries that nothing uses |
- E101 Syntax error
- E102 Invalid escape
- E103 Unknown Unicode property
- E104 Number too large
- E201 Unknown rule
- E202 Undeclared flag
- E203 Unknown attribute
- E204 Defined twice
- E205 Invalid name
- E206 Wrong number of arguments
- E207 Unknown field in a builder
- E208 Missing builder function
- E301 Syntactic rule in a terminal
- E302 Form that does not fit the rule
- E303 Precedence block of the wrong form
- E304 Field in a transparent rule
- E305 Field over several items
- E306 Empty literal
- E307 Character class
- E308 Count out of range
- E309 Builder without a place
- E310 Builder arguments that do not fit
- E401 Nesting too deep
- E402 Grammar too large
- E501 Not supported yet
- E601 Unknown grammar
- E602 A grammar takes itself in
- E603 Imported and defined
- E604 Not in the grammar imported
- E605 Misplaced inherited alternatives
- E901 Internal error
- W101 Alternative that is never tried
- W102 Literal that an earlier literal shadows
- W103 Alternative that an earlier one shadows
- W201 Repetition of an expression that can match nothing
- W202 Rule that calls itself at both ends
- W301 Transparent alternative whose shape depends on the input
- W302 Builder on a transparent alternative that never makes a node
- W401 Flag that is never set or never tested
- W402 Parameter that its rule never uses
- W403 Recovery for a label that nothing raises