Skip to content

bug: Lack of indentation after line break in double quoted string causes parse fail #10

@PolyMeilex

Description

@PolyMeilex

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions