Browse Source

Clarify handling of filtered terminals

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.7.2
David Kemp 5 years ago
committed by GitHub
parent
commit
9a64d2124b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 0 deletions
  1. +17
    -0
      docs/tree_construction.md

+ 17
- 0
docs/tree_construction.md View File

@@ -22,6 +22,23 @@ Lark filters out certain types of terminals by default, considering them punctua

- Unnamed regular expressions (like `/[0-9]/`)
- Named terminals whose name starts with a letter (like `DIGIT`)
- All terminals concatenated within a terminal

**Example:**
```
start: PNAME pname

PNAME: "(" NAME ")"
pname: "(" NAME ")"

NAME: /\w+/
%ignore /\s+/
```
Lark will parse "(Hello) (World)" as:

start
(Hello)
pname World

Rules prefixed with `!` will retain all their literals regardless.



Loading…
Cancel
Save