| @@ -43,7 +43,7 @@ Lark provides syntax highlighting for its grammar files (\*.lark): | |||||
| ### Clones | ### Clones | ||||
| - [Lerche (Julia)](https://github.com/jamesrhester/Lerche.jl) - an unofficial clone, written entirely in Julia. | |||||
| - [Lerche (Julia)](https://github.com/jamesrhester/Lerche.jl) - an unofficial clone, written entirely in Julia. | |||||
| ### Hello World | ### Hello World | ||||
| @@ -141,10 +141,10 @@ Check out the [JSON tutorial](/docs/json_tutorial.md#conclusion) for more detail | |||||
| - [mappyfile](https://github.com/geographika/mappyfile) - a MapFile parser for working with MapServer configuration | - [mappyfile](https://github.com/geographika/mappyfile) - a MapFile parser for working with MapServer configuration | ||||
| - [synapse](https://github.com/vertexproject/synapse) - an intelligence analysis platform | - [synapse](https://github.com/vertexproject/synapse) - an intelligence analysis platform | ||||
| - [Command-Block-Assembly](https://github.com/simon816/Command-Block-Assembly) - An assembly language, and C compiler, for Minecraft commands | - [Command-Block-Assembly](https://github.com/simon816/Command-Block-Assembly) - An assembly language, and C compiler, for Minecraft commands | ||||
| - [SPFlow](https://github.com/SPFlow/SPFlow) - Library for Sum-Product Networks | |||||
| - [SPFlow](https://github.com/SPFlow/SPFlow) - Library for Sum-Product Networks | |||||
| - [Torchani](https://github.com/aiqm/torchani) - Accurate Neural Network Potential on PyTorch | - [Torchani](https://github.com/aiqm/torchani) - Accurate Neural Network Potential on PyTorch | ||||
| - [required](https://github.com/shezadkhan137/required) - multi-field validation using docstrings | - [required](https://github.com/shezadkhan137/required) - multi-field validation using docstrings | ||||
| - [miniwdl](https://github.com/chanzuckerberg/miniwdl) - A static analysis toolkit for the Workflow Description Language | |||||
| - [miniwdl](https://github.com/chanzuckerberg/miniwdl) - A static analysis toolkit for the Workflow Description Language | |||||
| - [pytreeview](https://gitlab.com/parmenti/pytreeview) - a lightweight tree-based grammar explorer | - [pytreeview](https://gitlab.com/parmenti/pytreeview) - a lightweight tree-based grammar explorer | ||||
| @@ -32,7 +32,7 @@ The Lark class accepts a grammar string or file object, and keyword options: | |||||
| * **keep_all_tokens** - Don't throw away any terminals from the tree (Default=`False`) | * **keep_all_tokens** - Don't throw away any terminals from the tree (Default=`False`) | ||||
| * **propagate_positions** - Propagate line/column count to tree nodes, at the cost of performance (default=`True`) | |||||
| * **propagate_positions** - Propagate line/column count to tree nodes, at the cost of performance (default=`False`) | |||||
| * **maybe_placeholders** - The `[]` operator returns `None` when not matched. Setting this to `False` makes it behave like the `?` operator, and return no value at all, which may be a little faster (default=`True`) | * **maybe_placeholders** - The `[]` operator returns `None` when not matched. Setting this to `False` makes it behave like the `?` operator, and return no value at all, which may be a little faster (default=`True`) | ||||
| @@ -52,7 +52,7 @@ The main tree class | |||||
| * `data` - The name of the rule or alias | * `data` - The name of the rule or alias | ||||
| * `children` - List of matched sub-rules and terminals | * `children` - List of matched sub-rules and terminals | ||||
| * `meta` - Line & Column numbers (unless `propagate_positions` is disabled) | |||||
| * `meta` - Line & Column numbers (if `propagate_positions` is enabled) | |||||
| * meta attributes: `line`, `column`, `start_pos`, `end_line`, `end_column`, `end_pos` | * meta attributes: `line`, `column`, `start_pos`, `end_line`, `end_column`, `end_pos` | ||||
| #### \_\_init\_\_(self, data, children) | #### \_\_init\_\_(self, data, children) | ||||
| @@ -62,7 +62,7 @@ class LarkOptions(Serialize): | |||||
| 'start': 'start', | 'start': 'start', | ||||
| 'priority': 'auto', | 'priority': 'auto', | ||||
| 'ambiguity': 'auto', | 'ambiguity': 'auto', | ||||
| 'propagate_positions': True, | |||||
| 'propagate_positions': False, | |||||
| 'lexer_callbacks': {}, | 'lexer_callbacks': {}, | ||||
| 'maybe_placeholders': True, | 'maybe_placeholders': True, | ||||
| 'edit_terminals': None, | 'edit_terminals': None, | ||||
| @@ -151,7 +151,7 @@ class TestParsers(unittest.TestCase): | |||||
| g = Lark(r"""start: a+ | g = Lark(r"""start: a+ | ||||
| a : "x" _NL? | a : "x" _NL? | ||||
| _NL: /\n/+ | _NL: /\n/+ | ||||
| """, parser='lalr', transformer=T() if internal else None) | |||||
| """, parser='lalr', transformer=T() if internal else None, propagate_positions=True) | |||||
| except NotImplementedError: | except NotImplementedError: | ||||
| assert internal | assert internal | ||||
| continue | continue | ||||