From e6edc109b72ec19e3581548b922d3add1d2c3ea5 Mon Sep 17 00:00:00 2001 From: Sasank Chilamkurthy Date: Mon, 17 Aug 2020 17:13:26 +0530 Subject: [PATCH] options part of lark.Lark's docs --- docs/classes.rst | 4 ---- lark/lark.py | 10 +++++----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/docs/classes.rst b/docs/classes.rst index 63f9aef..381c3b2 100644 --- a/docs/classes.rst +++ b/docs/classes.rst @@ -7,10 +7,6 @@ Lark .. autoclass:: lark.Lark :members: open, parse, save, load -LarkOptions ------------ - -.. autoclass:: lark.lark.LarkOptions Tree ---- diff --git a/lark/lark.py b/lark/lark.py index abc87d1..add0ae6 100644 --- a/lark/lark.py +++ b/lark/lark.py @@ -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'