tree-sitter-python icon indicating copy to clipboard operation
tree-sitter-python copied to clipboard

bug: Fail to parse from here but the online playground is fine

Open mingodad opened this issue 1 year ago • 1 comments

Did you check existing issues?

  • [X] I have read all the tree-sitter docs if it relates to using the parser
  • [X] I have searched the existing issues of tree-sitter-python

Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)

No response

Describe the bug

Testing this a fresh build of this repo the sample shown bellow parses fine on the online playground but fail here.

Steps To Reproduce/Bad Parse Tree

tree-sitter parse test.py

Expected Behavior/Parse Tree

module [0, 0] - [2, 0] for_statement [0, 0] - [1, 44] left: identifier [0, 4] - [0, 8] right: attribute [0, 12] - [0, 21] object: identifier [0, 12] - [0, 15] attribute: identifier [0, 16] - [0, 21] body: block [1, 2] - [1, 44] expression_statement [1, 2] - [1, 44] call [1, 2] - [1, 44] function: identifier [1, 2] - [1, 7] arguments: argument_list [1, 7] - [1, 44] identifier [1, 8] - [1, 12] identifier [1, 14] - [1, 27] identifier [1, 29] - [1, 43]

Repro

for line in sys.stdin:
    match(line, liftoff_regex, liftoff_values)

mingodad avatar Feb 07 '24 19:02 mingodad

The playground is outdated. This happens because the parser considers match a statement.

ObserverOfTime avatar May 30 '24 07:05 ObserverOfTime