mirror of
https://github.com/mappu/miqt.git
synced 2024-12-22 08:58:37 +00:00
genbindings: move AllowClass from parse-time to transformation AST pass
This exposes some more valid types.
This commit is contained in:
parent
2fa853d836
commit
c1b31e787b
@ -212,11 +212,6 @@ func processClassType(node map[string]interface{}, addNamePrefix string) (CppCla
|
||||
|
||||
log.Printf("-> Processing class %q...\n", nodename)
|
||||
|
||||
// Also skip over any custom exceptions
|
||||
if !AllowClass(nodename) {
|
||||
return CppClass{}, ErrNoContent
|
||||
}
|
||||
|
||||
// Skip over forward class declarations
|
||||
// This is determined in two ways:
|
||||
// 1. If the class has no inner nodes
|
||||
|
@ -4,6 +4,23 @@ package main
|
||||
// and entire classes that may be disallowed.
|
||||
func astTransformBlocklist(parsed *CppParsedHeader) {
|
||||
|
||||
// Whole-classes
|
||||
|
||||
j := 0
|
||||
for _, c := range parsed.Classes {
|
||||
if !AllowClass(c.ClassName) {
|
||||
continue
|
||||
}
|
||||
|
||||
// Keep
|
||||
parsed.Classes[j] = c
|
||||
j++
|
||||
}
|
||||
parsed.Classes = parsed.Classes[:j] // reslice
|
||||
|
||||
// For the kept classes, filter ctors and methods within the class, based
|
||||
// on the parameter types and return types
|
||||
|
||||
for i, c := range parsed.Classes {
|
||||
|
||||
// Constructors
|
||||
|
Loading…
Reference in New Issue
Block a user