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: Lack of indentation after line break in double quoted string causes parse fail #10

Open
1 of 2 tasks
PolyMeilex opened this issue Sep 1, 2024 · 0 comments
Open
1 of 2 tasks
Labels
bug Something isn't working

Comments

@PolyMeilex
Copy link

PolyMeilex commented Sep 1, 2024

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)

tree-sitter 0.22.5 (cdd46888603e06d6474a96c0024907f68242c45f)

Steps To Reproduce/Bad Parse Tree

As far as I can tell this is valid yaml file:

root: "a\
b\
c"

But it produces a bad tree:

(ERROR
  (block_mapping_pair
    key: (flow_node
      (plain_scalar
        (string_scalar))))
  (ERROR
    (escape_sequence)
    (flow_node
      (plain_scalar
        (string_scalar))))
  (flow_node
    (plain_scalar
      (string_scalar))))

Expected Behavior/Parse Tree

(stream
  (document
    (block_node
      (block_mapping
        (block_mapping_pair
          key: (flow_node
            (plain_scalar
              (string_scalar)))
          value: (flow_node
            (double_quote_scalar
              (escape_sequence)
              (escape_sequence))))))))

Adding additional space after a newline solves the problem somehow:

root: "a\
 b\
 c"

The same'ish problem occurs with arrays and maps: ikatyang#29

@PolyMeilex PolyMeilex added the bug Something isn't working label Sep 1, 2024
@PolyMeilex PolyMeilex changed the title bug: Lack of indentation after Double Quoted Line Breaks causes parse fail bug: Lack of indentation after line break in double quoted string causes parse fail Sep 1, 2024
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