Skip to content

bug: Use contextual keyword as identifier is allowed in typescript but not allowed by tree-sitter-arkts #4

Description

@HaskellZhangSong

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 of tree-sitter-typescript

Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)

No response

Describe the bug

The following is legal typescript source code with abstract as the field name of a class

class Foo {
    foo : number = 0;
    abstract : string = "";
    bar : boolean = true;
}
Image

Steps To Reproduce/Bad Parse Tree

  1. Put the code into a file abstract.ets
  2. Use this parser to parse it
  3. Use a debugger to see the parse tree

Expected Behavior/Parse Tree

There should be 3 fields in the class body node and none of them is ERROR node.

Repro

class Foo {
    foo : number = 0;
    abstract : string = "";
    bar : boolean = true;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions