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

parser-adapter-yaml-1-2: parser greediness #4481

Open
char0n opened this issue Nov 12, 2024 · 0 comments
Open

parser-adapter-yaml-1-2: parser greediness #4481

char0n opened this issue Nov 12, 2024 · 0 comments
Labels
ApiDOM enhancement New feature or request YAML

Comments

@char0n
Copy link
Member

char0n commented Nov 12, 2024

asyncapi: 2.4.0
info: 
  version: '1.0.0'
   title: Something # Badly indented

On following fixture, in tree-sitter-playground, we can see that the error is ported from the end of previous line:

Image

Steps To Reproduce/Bad Parse Tree

https://tree-sitter.github.io/tree-sitter/playground

Expected Behavior/Parse Tree

I would expect the error be generated only for line 4. The parser is kind of greedy and includes the new line from line 3 into the error as well.

ERROR [3, 0] - [3, 36]

Refs tree-sitter-grammars/tree-sitter-yaml#16

@char0n char0n added enhancement New feature or request ApiDOM YAML labels Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ApiDOM enhancement New feature or request YAML
Projects
None yet
Development

No branches or pull requests

1 participant