Error messages less than helpful
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PyMeta |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
I tried this code:
grammar = pymeta.
symbol ::= <letterOrDigit>
symbol-list ::= <symbol> (',' <symbol>)*
""", globals())
I got this traceback:
Traceback (most recent call last):
File "<pyshell#13>", line 6, in <module>
""", globals())
File "C:\Python27\
tree = g.parseGrammar(
File "C:\Python27\
raise err
ParseError: (57, [('expected', None, '0'), ('expected', 'digit', None)])
This does not tell me what went wrong or on what line. After some guesswork, I found that it didn't like the hyphen in symbol-list and instead I should use symbolList or symbol_list. Not really a problem in a two-line grammar, but it could be really hair-pulling in a real grammar.
I've released the successor to PyMeta, Parsley. See http:// pypi.python. org/pypi/ Parsley and http:// launchpad. net/parsley for details. Among other things, it gives nicely formatted parse error messages.