Browse Source

Fixed docs

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.6.6
Erez Shinan 6 years ago
parent
commit
b2e88bf9b1
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      docs/grammar.md

+ 3
- 3
docs/grammar.md View File

@@ -133,10 +133,10 @@ When importing rules, all their dependencies will be imported into a namespace,
**Syntax:**
```html
%import <module>.<TERMINAL>
%import <module>.<TERMINAL> -> <NEWTERMINAL>
%import <module> (<TERM1> <TERM2>)
%import <module>.<rule>
%import <module>.<TERMINAL> -> <NEWTERMINAL>
%import <module>.<rule> -> <newrule>
%import <module> (<TERM1> <TERM2> <rule1> <rule2>)
```

If the module path is absolute, Lark will attempt to load it from the built-in directory (currently, only `common.lark` is available).
@@ -154,7 +154,7 @@ The rule or terminal can be imported under an other name with the `->` syntax.
%import .rules_file.rulea -> ruleb
```

Note that importing rules drops the `%ignore` directives, so this may change the grammar defined in the file.
Note that `%ignore` directives cannot be imported. Imported rules will abide by the `%ignore` directives declared in the main grammar.

### %declare



Loading…
Cancel
Save