Skip to content

bug: The AttValue is somewhat broken because att_value is broken and does not have a content field. #29

@justinMBullard

Description

@justinMBullard

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

I parsed simple xml with an attribute set.

<root>
   <field id="id"/>
</root>

If parse this file the AttValue will show the correct value of "id". However if I try to get the id value by looking at the content field it will break and have no content. I am working on

Steps To Reproduce/Bad Parse Tree

  1. Parse and xml file with an attribute value set.
  2. Try to get the attribute value by getting the content field from AttValue
  3. This will not find the field even though the file parses correctly.

Expected Behavior/Parse Tree

It should be possible to get the content field. This can be fixed by using optional and adding an alias to the rule.

Repro

I have a rust project that I was using to parse the xml code. I don't really have a minimal program shareable. But I have a fix that can PR shortly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions