ソースを参照

Fix for slices getting reduce to single getitem

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.11.2
MegaIng1 3年前
committed by Erez Sh
コミット
d98925525f
2個のファイルの変更2行の追加2行の削除
  1. +1
    -1
      examples/advanced/python3.lark
  2. +1
    -1
      lark/tree_matcher.py

+ 1
- 1
examples/advanced/python3.lark ファイルの表示

@@ -134,7 +134,7 @@ AWAIT: "await"
tuplelist_comp: (test|star_expr) (comp_for | ("," (test|star_expr))+ [","] | ",")
?subscriptlist: subscript
| subscript (("," subscript)+ [","] | ",") -> subscript_tuple
subscript: test | [test] ":" [test] [sliceop]
subscript: test | ([test] ":" [test] [sliceop]) -> slice
sliceop: ":" [test]
exprlist: (expr|star_expr)
| (expr|star_expr) (("," (expr|star_expr))+ [","]|",") -> exprlist_tuple


+ 1
- 1
lark/tree_matcher.py ファイルの表示

@@ -51,7 +51,7 @@ def _match(term, token):
return token.data == name
elif isinstance(token, Token):
return term == Terminal(token.type)
assert False
assert False, (term, token)


def make_recons_rule(origin, expansion, old_expansion):


読み込み中…
キャンセル
保存