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

Object is always parsed empty #28

Closed
mbolotov opened this issue Jan 19, 2021 · 2 comments
Closed

Object is always parsed empty #28

mbolotov opened this issue Jan 19, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@mbolotov
Copy link

object node is always parsed empty.
Parsing this piece of code

object MyObject {
   fun myFun() {}
}
class MyClass {
    fun myFun() {}
}

produces the following AST:

PackageHeader(identifier=[])
DefaultAstNode(description=importList, children=[])
KlassDeclaration(keyword=object, identifier=KlassIdentifier(identifier=MyObject, parameter=[], nullable=false, raw=null), type=null, annotations=[], modifiers=[], parameter=[], typeParameters=[], inheritance=[], expressions=[], raw=null)
KlassDeclaration(keyword=class, identifier=KlassIdentifier(identifier=MyClass, parameter=[], nullable=false, raw=null), type=null, annotations=[], modifiers=[], parameter=[], typeParameters=[], inheritance=[], expressions=[DefaultAstNode(description=classBody, children=[KlassDeclaration(keyword=fun, identifier=KlassIdentifier(identifier=myFun, parameter=[], nullable=false, raw=null), type=null, annotations=[], modifiers=[], parameter=[], typeParameters=[], inheritance=[], expressions=[], raw=null)])], raw=null)

MyClass shows myFun node while MyObject does not.

Lib version is 'com.github.kotlinx.ast:grammar-kotlin-parser-antlr-kotlin:c7dd6bbd54'

drieks added a commit to drieks/ast that referenced this issue Jan 19, 2021
drieks added a commit to drieks/ast that referenced this issue Jan 19, 2021
drieks added a commit to drieks/ast that referenced this issue Jan 19, 2021
@drieks drieks added the bug Something isn't working label Jan 19, 2021
@drieks
Copy link
Collaborator

drieks commented Jan 19, 2021

Hi @mbolotov,

thank you for reporting! It is fixed now, see 5a03ad3

Please try com.github.kotlinx.ast:grammar-kotlin-parser-antlr-kotlin:5a03ad31d5 and let me know, if it is also working for you.

@drieks drieks self-assigned this Jan 19, 2021
@mbolotov
Copy link
Author

it works for me, thanks!
closing this issue

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

2 participants