diff --git a/lark/lark.py b/lark/lark.py index 82cf76a..5c43fa8 100644 --- a/lark/lark.py +++ b/lark/lark.py @@ -43,7 +43,7 @@ class LarkOptions(Serialize): keep_all_tokens - Don't automagically remove "punctuation" tokens (default: False) cache_grammar - Cache the Lark grammar (Default: False) postlex - Lexer post-processing (Default: None) Only works with the standard and contextual lexers. - start - The start symbol (Default: start) + start - The start symbol, either a string, or a list of strings for multiple possible starts (Default: "start") profile - Measure run-time usage in Lark. Read results from the profiler proprety (Default: False) priority - How priorities should be evaluated - auto, none, normal, invert (Default: auto) propagate_positions - Propagates [line, column, end_line, end_column] attributes into all tree branches. @@ -291,7 +291,12 @@ class Lark(Serialize): return stream def parse(self, text, start=None): - "Parse the given text, according to the options provided. Returns a tree, unless specified otherwise." + """Parse the given text, according to the options provided. + + The 'start' parameter is required if Lark was given multiple possible start symbols (using the start option). + + Returns a tree, unless specified otherwise. + """ return self.parser.parse(text, start=start) ###}