Browse Source

Updated docstrings for multiple start symbols

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.7.2
Erez Shinan 5 years ago
parent
commit
94e7e82a19
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      lark/lark.py

+ 7
- 2
lark/lark.py View File

@@ -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)

###}

Loading…
Cancel
Save