Browse Source

Fix for slices getting reduce to single getitem

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.11.2
MegaIng1 3 years ago
committed by Erez Sh
parent
commit
d98925525f
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      examples/advanced/python3.lark
  2. +1
    -1
      lark/tree_matcher.py

+ 1
- 1
examples/advanced/python3.lark View File

@@ -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 View File

@@ -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):


Loading…
Cancel
Save