mirror of
https://github.com/mappu/miqt.git
synced 2025-01-03 14:18: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)
|
log.Printf("-> Processing class %q...\n", nodename)
|
||||||
|
|
||||||
// Also skip over any custom exceptions
|
|
||||||
if !AllowClass(nodename) {
|
|
||||||
return CppClass{}, ErrNoContent
|
|
||||||
}
|
|
||||||
|
|
||||||
// Skip over forward class declarations
|
// Skip over forward class declarations
|
||||||
// This is determined in two ways:
|
// This is determined in two ways:
|
||||||
// 1. If the class has no inner nodes
|
// 1. If the class has no inner nodes
|
||||||
|
@ -4,6 +4,23 @@ package main
|
|||||||
// and entire classes that may be disallowed.
|
// and entire classes that may be disallowed.
|
||||||
func astTransformBlocklist(parsed *CppParsedHeader) {
|
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 {
|
for i, c := range parsed.Classes {
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
Loading…
Reference in New Issue
Block a user