소스 검색

Added info to the docs about maybe_placeholders (Issue #451)

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.8.0
Erez Shinan 4 년 전
부모
커밋
9727eb0226
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. +4
    -0
      docs/tree_construction.md

+ 4
- 0
docs/tree_construction.md 파일 보기

@@ -7,6 +7,10 @@ For example, the rule `node: child1 child2` will create a tree node with two chi

Using `item+` or `item*` will result in a list of items, equivalent to writing `item item item ..`.

Using `item?` will return the item if it matched, or nothing.

Using `[item]` will return the item if it matched, or the value `None`, if it didn't. It's possible to force `[]` to behave like `()?`, by using the `maybe_placeholders=False` option when initializing Lark.

### Terminals

Terminals are always values in the tree, never branches.


불러오는 중...
취소
저장