Skip to content

Commit

Permalink
implemented functionBody
Browse files Browse the repository at this point in the history
  • Loading branch information
drieks committed Jan 1, 2022
1 parent fe52ba7 commit 7c79d0a
Show file tree
Hide file tree
Showing 27 changed files with 8 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -436,14 +436,15 @@ val kotlinTreeMapBuilder = TreeMapBuilder<KotlinTreeMapState>()
// ;
.convert(
filter = byDescription("functionBody")
) { _: Ast ->
astContinue(
KlassBlock(
listOf(
KlassComment("TODO", KlassCommentType.Doc)
)
) { node: AstNode ->
recursiveFlatten(
node = node,
filter = byDescription("block", "expression")
).map { bodyNodes: List<Ast> ->
listOf(
KlassBlock(bodyNodes.filterIsInstance<Klass>())
)
)
}
}

// variableDeclaration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ KlassDeclaration(class Name)
KlassDeclaration(parameter x Int)
literalConstant
IntegerLiteral >>>3<<< (DEFAULT_TOKEN_CHANNEL)
KlassComment(Doc)
KlassDeclaration(fun annotated2 Int)
KlassAnnotation(Annotated)
KlassModifier(private, visibilityModifier)
KlassDeclaration(parameter x Int)
KlassAnnotation(AnotherAnnotation)
KlassComment(Doc)
KlassDeclaration(fun generic X)
KlassAnnotation(Annotated)
KlassDeclaration(parameter x X)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,11 @@
[228..238] [12:20..12:30] KlassDeclaration(parameter x Int)
[237..238] [12:29..12:30] literalConstant
95 [237..238] [12:29..12:30] IntegerLiteral
KlassComment(Doc)
[252..351] [14:4..17:6] KlassDeclaration(fun annotated2 Int)
[252..264] [14:4..14:16] KlassAnnotation(Annotated)
[268..275] [15:5..15:12] KlassModifier(private, visibilityModifier)
[291..316] [15:28..15:53] KlassDeclaration(parameter x Int)
[291..309] [15:28..15:46] KlassAnnotation(AnotherAnnotation)
KlassComment(Doc)
[356..402] [19:4..20:35] KlassDeclaration(fun generic X)
[356..368] [19:4..19:16] KlassAnnotation(Annotated)
[394..398] [20:27..20:31] KlassDeclaration(parameter x X)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
PackageHeader()
importList
KlassDeclaration(fun test String)
KlassComment(Doc)
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
PackageHeader()
importList
[0..38] [1:1..3:2] KlassDeclaration(fun test String)
KlassComment(Doc)
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ KlassDeclaration(class TestClass)
classBody
KlassDeclaration(fun function)
KlassDeclaration(parameter record Map<String?, String>)
KlassComment(Doc)
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
[42..100] [3:17..6:2] classBody
[48..98] [4:5..5:6] KlassDeclaration(fun function)
[61..89] [4:18..4:46] KlassDeclaration(parameter record Map<String?, String>)
KlassComment(Doc)
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ KlassDeclaration(class Spam)
KlassDeclaration(parameter i Int)
KlassDeclaration(parameter s String?)
KlassDeclaration(parameter l List<String>)
KlassComment(Doc)
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@
[49..55] [3:21..3:27] KlassDeclaration(parameter i Int)
[57..67] [3:29..3:39] KlassDeclaration(parameter s String?)
[69..85] [3:41..3:57] KlassDeclaration(parameter l List<String>)
KlassComment(Doc)
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ KlassDeclaration(class Group)
classBody
KlassDeclaration(fun add Int)
KlassDeclaration(parameter member T)
KlassComment(Doc)
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@
[317..479] [15:34..24:2] classBody
[409..477] [20:3..23:4] KlassDeclaration(fun add Int)
[417..426] [20:11..20:20] KlassDeclaration(parameter member T)
KlassComment(Doc)
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ importList
KlassDeclaration(object MyObject)
classBody
KlassDeclaration(fun myFun)
KlassComment(Doc)
KlassDeclaration(class MyClass)
classBody
KlassDeclaration(fun myFun)
KlassComment(Doc)
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
[0..37] [1:1..3:2] KlassDeclaration(object MyObject)
[16..37] [1:17..3:2] classBody
[21..35] [2:4..2:18] KlassDeclaration(fun myFun)
KlassComment(Doc)
[39..75] [5:1..7:2] KlassDeclaration(class MyClass)
[53..75] [5:15..7:2] classBody
[59..73] [6:5..6:19] KlassDeclaration(fun myFun)
KlassComment(Doc)
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,14 @@ KlassDeclaration(object UrlUtils)
KlassDeclaration(fun appendPath String)
KlassDeclaration(parameter baseUrl String)
KlassDeclaration(parameter path String)
KlassComment(Doc)
KlassDeclaration(fun appendQueryParameter String)
KlassDeclaration(parameter baseUrl String)
KlassDeclaration(parameter key String)
KlassDeclaration(parameter value String)
KlassComment(Doc)
KlassDeclaration(fun appendRefTag String)
KlassDeclaration(parameter baseUrl String)
KlassDeclaration(parameter tag String)
KlassComment(Doc)
KlassDeclaration(fun baseCustomTabsIntent CustomTabsIntent)
KlassDeclaration(parameter context Context)
KlassComment(Doc)
KlassDeclaration(fun refTag String?)
KlassDeclaration(parameter url String)
KlassComment(Doc)
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,14 @@
[273..479] [13:5..18:6] KlassDeclaration(fun appendPath String)
[288..303] [13:20..13:35] KlassDeclaration(parameter baseUrl String)
[305..317] [13:37..13:49] KlassDeclaration(parameter path String)
KlassComment(Doc)
[485..724] [20:5..25:6] KlassDeclaration(fun appendQueryParameter String)
[510..525] [20:30..20:45] KlassDeclaration(parameter baseUrl String)
[527..538] [20:47..20:58] KlassDeclaration(parameter key String)
[540..553] [20:60..20:73] KlassDeclaration(parameter value String)
KlassComment(Doc)
[730..851] [27:5..29:6] KlassDeclaration(fun appendRefTag String)
[747..762] [27:22..27:37] KlassDeclaration(parameter baseUrl String)
[764..775] [27:39..27:50] KlassDeclaration(parameter tag String)
KlassComment(Doc)
[857..1124] [31:5..38:6] KlassDeclaration(fun baseCustomTabsIntent CustomTabsIntent)
[882..898] [31:30..31:46] KlassDeclaration(parameter context Context)
KlassComment(Doc)
[1130..1227] [40:5..42:6] KlassDeclaration(fun refTag String?)
[1141..1152] [40:16..40:27] KlassDeclaration(parameter url String)
KlassComment(Doc)
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ KlassDeclaration(class FeatureFragment)
KlassDeclaration(fun handleViewStateChanges Unit)
KlassModifier(private, visibilityModifier)
KlassDeclaration(parameter viewState FeatureViewModel.ViewState)
KlassComment(Doc)
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@
[129..498] [6:5..14:10] KlassDeclaration(fun handleViewStateChanges Unit)
[129..136] [6:5..6:12] KlassModifier(private, visibilityModifier)
[164..201] [6:40..6:77] KlassDeclaration(parameter viewState FeatureViewModel.ViewState)
KlassComment(Doc)
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,3 @@ KlassDeclaration(class MyClass)
KlassDeclaration(parameter entityCommand EntityCommand<JsonNode>)
KlassAnnotation(Payload)
KlassDeclaration(parameter record ConsumerRecord<String, Array<Byte>>)
KlassComment(Doc)
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,3 @@
[387..434] [8:39..8:86] KlassDeclaration(parameter entityCommand EntityCommand<JsonNode>)
[387..395] [8:39..8:47] KlassAnnotation(Payload)
[436..479] [8:88..8:131] KlassDeclaration(parameter record ConsumerRecord<String, Array<Byte>>)
KlassComment(Doc)
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
PackageHeader()
importList
KlassDeclaration(fun String extension1 String)
KlassComment(Doc)
KlassDeclaration(val String extension2 String)
KlassDeclaration(val Some.Class extension3 String)
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
PackageHeader()
importList
[0..56] [1:1..3:2] KlassDeclaration(fun String extension1 String)
KlassComment(Doc)
[58..130] [5:1..8:6] KlassDeclaration(val String extension2 String)
[132..208] [10:1..13:6] KlassDeclaration(val Some.Class extension3 String)
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ importList
KlassDeclaration(fun A.B<C>.D function I<J>)
KlassDeclaration(parameter e E)
KlassDeclaration(parameter fg F.G<H>)
KlassComment(Doc)
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
[0..60] [1:1..5:2] KlassDeclaration(fun A.B<C>.D function I<J>)
[27..31] [2:5..2:9] KlassDeclaration(parameter e E)
[37..47] [3:5..3:15] KlassDeclaration(parameter fg F.G<H>)
KlassComment(Doc)
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ KlassDeclaration(class FeatureFragment)
classBody
KlassDeclaration(fun provideViewIntents List<Observable<out Feature.Intent>>)
KlassModifier(override, memberModifier)
KlassComment(Doc)
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@
[122..217] [4:62..8:2] classBody
[129..214] [6:5..6:90] KlassDeclaration(fun provideViewIntents List<Observable<out Feature.Intent>>)
[129..137] [6:5..6:13] KlassModifier(override, memberModifier)
KlassComment(Doc)
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ KlassDeclaration(fun parse)
KlassString
Escape("\$")
"{123}"
KlassComment(Doc)
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@
[84..93] [3:14..3:23] KlassString
13 [85..87] [3:15..3:17] Escape("\$")
14 [87..92] [3:17..3:22] "{123}"
KlassComment(Doc)

0 comments on commit 7c79d0a

Please sign in to comment.