kotlinx/ast

Object is always parsed empty

mbolotov opened this issue · 2 comments

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'

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.

it works for me, thanks!
closing this issue