Browse Source

Added documentation

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.11.2
Erez Sh 3 years ago
parent
commit
bcf9957575
1 changed files with 13 additions and 0 deletions
  1. +13
    -0
      docs/grammar.md

+ 13
- 0
docs/grammar.md View File

@@ -289,3 +289,16 @@ Note that `%ignore` directives cannot be imported. Imported rules will abide by

Declare a terminal without defining it. Useful for plugins.

### %override

Override a rule, affecting all the rules that refer to it.

Useful for implementing an inheritance pattern when importing grammars.

**Example:**
```perl
%import my_grammar (start, number, NUMBER)

// Add hex support to my_grammar
%override number: NUMBER | /0x\w+/
```

Loading…
Cancel
Save