Переглянути джерело

Small addition to docs about terminal operators

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.8.0
Erez Sh 4 роки тому
джерело
коміт
2f92c7b4a7
1 змінених файлів з 5 додано та 1 видалено
  1. +5
    -1
      docs/grammar.md

+ 5
- 1
docs/grammar.md Переглянути файл

@@ -54,6 +54,10 @@ Literals can be one of:
* `/re with flags/imulx`
* Literal range: `"a".."z"`, `"1".."9"`, etc.

Terminals also support grammar operators, such as `|`, `+`, `*` and `?`.

Terminals are a linear construct, and therefor may not contain themselves (recursion isn't allowed).

### Priority

Terminals can be assigned priority only when using a lexer (future versions may support Earley's dynamic lexing).
@@ -74,7 +78,7 @@ When using a lexer (standard or contextual), it is the grammar-author's responsi
IF: "if"
INTEGER : /[0-9]+/
INTEGER2 : ("0".."9")+ //# Same as INTEGER
DECIMAL.2: INTEGER "." INTEGER //# Will be matched before INTEGER
DECIMAL.2: INTEGER? "." INTEGER //# Will be matched before INTEGER
WHITESPACE: (" " | /\t/ )+
SQL_SELECT: "select"i
```


Завантаження…
Відмінити
Зберегти