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

Named childs doesn't have names. #20

Open
Padavan opened this issue Oct 9, 2024 · 0 comments
Open

Named childs doesn't have names. #20

Padavan opened this issue Oct 9, 2024 · 0 comments

Comments

@Padavan
Copy link

Padavan commented Oct 9, 2024

I'm not sure about this. I recently started working with tree-sitter.

    "tag": {
      "type": "CHOICE",
      "members": [
        {
          "type": "SEQ",
          "members": [
            {
              "type": "ALIAS",
              "content": {
                "type": "SYMBOL",
                "name": "tag_name_with_argument"
              },
              "named": true,
              "value": "tag_name"

name property is nested inside content but should also present along with value and type properties.

Example: some child node from javascript grammar

     {
                "type": "FIELD",
                "name": "right",
                "content": {
                  "type": "SYMBOL",
                  "name": "expression"
}

It would be great if project added this so developers could use node.ChildByFieldName("tag_name_with_argument") methods to traverse the tree

I think name should be present on tag_name_with_type, tag_name_with_argument and tag_name. Maybe somewhere else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant