|
|
| __init__ (self, str pstr, int loc=0, typing.Optional[str] msg=None, elem=None) |
| |
| str | line (self) |
| |
| int | lineno (self) |
| |
| int | col (self) |
| |
| int | column (self) |
| |
|
| parserElement (self) |
| |
|
| parserElement (self, elem) |
| |
|
str | __str__ (self) |
| |
|
| __repr__ (self) |
| |
| str | mark_input_line (self, typing.Optional[str] marker_string=None, *str markerString=">!<") |
| |
| str | explain (self, depth=16) |
| |
|
| markInputline (self) |
| |
| | explain_exception (exc, depth=16) |
| |
|
| loc |
| |
|
| msg |
| |
|
| pstr |
| |
|
| parser_element |
| |
|
| args |
| |
|
int | loc |
| |
|
str | msg |
| |
|
str | pstr |
| |
|
typing | parser_element .Any |
| |
|
typing | args .Tuple[str, int, typing.Optional[str]] |
| |
| | _from_exception (cls, pe) |
| |
Exception thrown when a parse expression doesn't match the input string
Example::
try:
Word(nums).set_name("integer").parse_string("ABC")
except ParseException as pe:
print(pe)
print("column: {}".format(pe.column))
prints::
Expected integer (at char 0), (line:1, col:1)
column: 1