Browse Source

options part of lark.Lark's docs

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.10.0
Sasank Chilamkurthy 4 years ago
parent
commit
e6edc109b7
2 changed files with 5 additions and 9 deletions
  1. +0
    -4
      docs/classes.rst
  2. +5
    -5
      lark/lark.py

+ 0
- 4
docs/classes.rst View File

@@ -7,10 +7,6 @@ Lark
.. autoclass:: lark.Lark
:members: open, parse, save, load

LarkOptions
-----------

.. autoclass:: lark.lark.LarkOptions

Tree
----


+ 5
- 5
lark/lark.py View File

@@ -27,7 +27,7 @@ class LarkOptions(Serialize):

"""
OPTIONS_DOC = """
**General**
**General Options**
start
The start symbol. Either a string, or a list of strings for
@@ -60,7 +60,7 @@ class LarkOptions(Serialize):
keep_all_tokens
Prevent the tree builder from automagically removing "punctuation" tokens (default: False)

**Algorithm**
**Algorithm Options**

parser
Decides which parser engine to use. Accepts "earley" or "lalr".
@@ -83,7 +83,7 @@ class LarkOptions(Serialize):
- "explicit": The parser will return all derivations wrapped in
"_ambig" tree nodes (i.e. a forest).

**Domain Specific**
**Domain Specific Options**

postlex
Lexer post-processing (Default: None) Only works with the
@@ -317,8 +317,8 @@ class Lark(Serialize):
self.save(f)

# TODO: merge with above
if __init__.__doc__:
__init__.__doc__ += "\nOptions:\n" + LarkOptions.OPTIONS_DOC
if __doc__:
__doc__ += "\n\n" + LarkOptions.OPTIONS_DOC

__serialize_fields__ = 'parser', 'rules', 'options'



Loading…
Cancel
Save