Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Non-local error on single "-" in value #12

Open
2 tasks done
qvalentin opened this issue Oct 12, 2024 · 0 comments
Open
2 tasks done

bug: Non-local error on single "-" in value #12

qvalentin opened this issue Oct 12, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@qvalentin
Copy link

Did you check existing issues?

  • I have read all the tree-sitter docs if it relates to using the parser
  • I have searched the existing issues

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

No response

Describe the bug

A value consisting of just a single dash, will cause the syntax to raise a non-local error, causing syntax highlighting for the rest of the file to break.

Image

Steps To Reproduce/Bad Parse Tree

hi: test
hi2: -
hi3: test

This is probably not valid yaml.

(ERROR ; [0, 0] - [1, 4]
  (block_mapping_pair ; [0, 0] - [0, 8]
    key: (flow_node ; [0, 0] - [0, 2]
      (plain_scalar ; [0, 0] - [0, 2]
        (string_scalar))) ; [0, 0] - [0, 2]
    value: (flow_node ; [0, 4] - [0, 8]
      (plain_scalar ; [0, 4] - [0, 8]
        (string_scalar)))) ; [0, 4] - [0, 8]
  (block_mapping_pair ; [1, 0] - [1, 4]
    key: (flow_node ; [1, 0] - [1, 3]
      (plain_scalar ; [1, 0] - [1, 3]
        (string_scalar))))) ; [1, 0] - [1, 3]

Expected Behavior/Parse Tree

A local error in the block_mapping_pair node.

Repro

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant