Skip to content

Commit c3893d8

Browse files
committed
Fix docstrings a bit more
1 parent 78ed55a commit c3893d8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lark/lark.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ def get_terminal(self, name: str) -> TerminalDef:
621621
return self._terminals_dict[name]
622622

623623
def parse_interactive(self, text: Optional[TextOrSlice]=None, start: Optional[str]=None) -> 'InteractiveParser':
624-
"""Start an interactive parsing session.
624+
"""Start an interactive parsing session. Only works when parser='lalr'.
625625
626626
Parameters:
627627
text (TextOrSlice, optional): Text to be parsed. Required for ``resume_parse()``.
@@ -638,9 +638,11 @@ def parse(self, text: TextOrSlice, start: Optional[str]=None, on_error: 'Optiona
638638
"""Parse the given text, according to the options provided.
639639
640640
Parameters:
641-
text (TextOrSlice): Text to be parsed.
641+
text (TextOrSlice): Text to be parsed, as `str` or `bytes`.
642+
TextSlice may also be used, but only when lexer='basic' or 'contextual'.
642643
start (str, optional): Required if Lark was given multiple possible start symbols (using the start option).
643-
on_error (function, optional): if provided, will be called on UnexpectedToken error. Return true to resume parsing.
644+
on_error (function, optional): if provided, will be called on UnexpectedInput error,
645+
with the exception as its argument. Return true to resume parsing, or false to raise the exception.
644646
LALR only. See examples/advanced/error_handling.py for an example of how to use on_error.
645647
646648
Returns:

0 commit comments

Comments
 (0)