mirror of
https://github.com/mappu/miqt.git
synced 2025-01-21 22:20:38 +00:00
genbindings: rename CheckComplexity->AllowType
This commit is contained in:
parent
ba423f153a
commit
ee25750b35
@ -198,7 +198,7 @@ func AllowMethod(className string, mm CppMethod) error {
|
||||
return nil // OK, allow
|
||||
}
|
||||
|
||||
func CheckComplexity(p CppParameter, isReturnType bool) error {
|
||||
func AllowType(p CppParameter, isReturnType bool) error {
|
||||
|
||||
if p.QMapOf() {
|
||||
return ErrTooComplex // Example???
|
||||
@ -207,12 +207,12 @@ func CheckComplexity(p CppParameter, isReturnType bool) error {
|
||||
return ErrTooComplex // e.g. QGradientStop
|
||||
}
|
||||
if t, ok := p.QSetOf(); ok {
|
||||
if err := CheckComplexity(t, isReturnType); err != nil {
|
||||
if err := AllowType(t, isReturnType); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if t, ok := p.QListOf(); ok {
|
||||
if err := CheckComplexity(t, isReturnType); err != nil { // e.g. QGradientStops is a QVector<> (OK) of QGradientStop (not OK)
|
||||
if err := AllowType(t, isReturnType); err != nil { // e.g. QGradientStops is a QVector<> (OK) of QGradientStop (not OK)
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -11,12 +11,12 @@ func astTransformBlocklist(parsed *CppParsedHeader) {
|
||||
j := 0
|
||||
nextCtor:
|
||||
for _, m := range c.Ctors {
|
||||
if err := CheckComplexity(m.ReturnType, true); err != nil {
|
||||
if err := AllowType(m.ReturnType, true); err != nil {
|
||||
continue nextCtor
|
||||
}
|
||||
|
||||
for _, p := range m.Parameters {
|
||||
if err := CheckComplexity(p, false); err != nil {
|
||||
if err := AllowType(p, false); err != nil {
|
||||
continue nextCtor
|
||||
}
|
||||
}
|
||||
@ -32,12 +32,12 @@ func astTransformBlocklist(parsed *CppParsedHeader) {
|
||||
j = 0
|
||||
nextMethod:
|
||||
for _, m := range c.Methods {
|
||||
if err := CheckComplexity(m.ReturnType, true); err != nil {
|
||||
if err := AllowType(m.ReturnType, true); err != nil {
|
||||
continue nextMethod
|
||||
}
|
||||
|
||||
for _, p := range m.Parameters {
|
||||
if err := CheckComplexity(p, false); err != nil {
|
||||
if err := AllowType(p, false); err != nil {
|
||||
continue nextMethod
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user