Fix issue with recursively getting children instead of immediate children

This commit is contained in:
2024-09-15 11:44:10 +02:00
parent a766f09f87
commit ae19630819

View File

@@ -11,7 +11,6 @@ import (
"text/template"
"github.com/PuerkitoBio/goquery"
"github.com/davecgh/go-spew/spew"
)
//go:embed class.tmpl
@@ -215,7 +214,7 @@ func getConstructor(dataContainer *goquery.Selection) (Constructor, error) {
// 1 parameters
// 2 returns
state := 0
children := descriptor.Children()
children := descriptor.Eq(0).Children()
childrenLength := children.Length()
children.Each(func(i int, s *goquery.Selection) {
if i == childrenLength-1 {
@@ -251,11 +250,13 @@ func getConstructor(dataContainer *goquery.Selection) (Constructor, error) {
cparam.Comment = CleanUp(cleanText)
}
}
case 2:
log.Printf("%#v", s.Text())
}
}
})
spew.Dump(resConstructor)
// spew.Dump(resConstructor)
return resConstructor, nil
}