Browse Source

Revert propagate_positions to be False by default, still not ready for prime-time

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.8.0
Erez Sh 5 years ago
parent
commit
ae691bf35e
4 changed files with 7 additions and 7 deletions
  1. +3
    -3
      README.md
  2. +2
    -2
      docs/classes.md
  3. +1
    -1
      lark/lark.py
  4. +1
    -1
      tests/test_parser.py

+ 3
- 3
README.md View File

@@ -43,7 +43,7 @@ Lark provides syntax highlighting for its grammar files (\*.lark):

### 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

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




+ 2
- 2
docs/classes.md View File

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

* **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`)

@@ -52,7 +52,7 @@ The main tree class

* `data` - The name of the rule or alias
* `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`

#### \_\_init\_\_(self, data, children)


+ 1
- 1
lark/lark.py View File

@@ -62,7 +62,7 @@ class LarkOptions(Serialize):
'start': 'start',
'priority': 'auto',
'ambiguity': 'auto',
'propagate_positions': True,
'propagate_positions': False,
'lexer_callbacks': {},
'maybe_placeholders': True,
'edit_terminals': None,


+ 1
- 1
tests/test_parser.py View File

@@ -151,7 +151,7 @@ class TestParsers(unittest.TestCase):
g = Lark(r"""start: a+
a : "x" _NL?
_NL: /\n/+
""", parser='lalr', transformer=T() if internal else None)
""", parser='lalr', transformer=T() if internal else None, propagate_positions=True)
except NotImplementedError:
assert internal
continue


Loading…
Cancel
Save