Skip to content

Commit

Permalink
fixed parsing of companion object refs #38
Browse files Browse the repository at this point in the history
  • Loading branch information
drieks committed May 11, 2021
1 parent bdfd629 commit 763bb49
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ private val klassDeclarationKeywords: Map<String, String> = mapOf(
"VAL" to "val",
"CLASS" to "class",
"INTERFACE" to "interface",
"COMPANION" to "companion object",
"OBJECT" to "object",
"primaryConstructor" to "constructor",
"valueArgument" to "argument",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,19 @@ val kotlinTreeMapBuilder = TreeMapBuilder<KotlinTreeMapState>()
// (NL* COLON NL* delegationSpecifiers)?
// (NL* classBody)?
// ;
.convert(
filter = byDescription("companionObject")
) { node: AstNode ->
toKlassDeclaration(node) { ast ->
astContinue(
ast.filter(
setOf(
"classBody",
)
)
)
}.toAstList()
}

// functionValueParameters
// : LPAREN NL* (functionValueParameter (NL* COMMA NL* functionValueParameter)* (NL* COMMA)?)? NL* RPAREN
Expand Down

0 comments on commit 763bb49

Please sign in to comment.