mirror of
https://github.com/mappu/miqt.git
synced 2025-02-08 14:10:22 +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
|
return nil // OK, allow
|
||||||
}
|
}
|
||||||
|
|
||||||
func CheckComplexity(p CppParameter, isReturnType bool) error {
|
func AllowType(p CppParameter, isReturnType bool) error {
|
||||||
|
|
||||||
if p.QMapOf() {
|
if p.QMapOf() {
|
||||||
return ErrTooComplex // Example???
|
return ErrTooComplex // Example???
|
||||||
@ -207,12 +207,12 @@ func CheckComplexity(p CppParameter, isReturnType bool) error {
|
|||||||
return ErrTooComplex // e.g. QGradientStop
|
return ErrTooComplex // e.g. QGradientStop
|
||||||
}
|
}
|
||||||
if t, ok := p.QSetOf(); ok {
|
if t, ok := p.QSetOf(); ok {
|
||||||
if err := CheckComplexity(t, isReturnType); err != nil {
|
if err := AllowType(t, isReturnType); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if t, ok := p.QListOf(); ok {
|
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
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,12 +11,12 @@ func astTransformBlocklist(parsed *CppParsedHeader) {
|
|||||||
j := 0
|
j := 0
|
||||||
nextCtor:
|
nextCtor:
|
||||||
for _, m := range c.Ctors {
|
for _, m := range c.Ctors {
|
||||||
if err := CheckComplexity(m.ReturnType, true); err != nil {
|
if err := AllowType(m.ReturnType, true); err != nil {
|
||||||
continue nextCtor
|
continue nextCtor
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, p := range m.Parameters {
|
for _, p := range m.Parameters {
|
||||||
if err := CheckComplexity(p, false); err != nil {
|
if err := AllowType(p, false); err != nil {
|
||||||
continue nextCtor
|
continue nextCtor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -32,12 +32,12 @@ func astTransformBlocklist(parsed *CppParsedHeader) {
|
|||||||
j = 0
|
j = 0
|
||||||
nextMethod:
|
nextMethod:
|
||||||
for _, m := range c.Methods {
|
for _, m := range c.Methods {
|
||||||
if err := CheckComplexity(m.ReturnType, true); err != nil {
|
if err := AllowType(m.ReturnType, true); err != nil {
|
||||||
continue nextMethod
|
continue nextMethod
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, p := range m.Parameters {
|
for _, p := range m.Parameters {
|
||||||
if err := CheckComplexity(p, false); err != nil {
|
if err := AllowType(p, false); err != nil {
|
||||||
continue nextMethod
|
continue nextMethod
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user