Bindgen::Processor::SanityCheck
Inherits Bindgen::Processor::Base < Bindgen::Graph::Visitor < Reference < Object
Does sanity-checks on the graph. If any check fails, a message written to
STDERR and the process is exited.
Checks are as follows:
- Name of enums, libs, structures, classes, modules and aliases are valid
- Name of methods are valid
- Enumerations have at least one constant
- Enumeration constants are correctly named
- Flag-enumerations don't have
AllnorNoneconstants - Crystal method overloads are unambiguous
- Method arguments and result types are reachable
- Variadic methods are directly bound
- Alias targets are reachable
- Class base-classes are reachable
- Structure fields are of a supported and reachable type
Constants
Binding types of C arrays, defined in glue.cr.
Regular expression for the Crystal type of a C array of other than
built-in types, capturing the element type: Slice(Color)
Regular expression for a camel-cased symbol
Regular expression for a CONSTANT
The all-flags constant in a flag-enum
The no-flags constant in a flag-enum
Regular expression for a Crystal Enumerable typename, which may be of
tuples: Enumerable({K, V})
TODO: support other Crystal stdlib types (which might not correspond to
any C++ type at all)
Does sanity-checks on the graph. If any check fails, a message written to
STDERR and the process is exited.
Checks are as follows:
- Name of enums, libs, structures, classes, modules and aliases are valid
- Name of methods are valid
- Enumerations have at least one constant
- Enumeration constants are correctly named
- Flag-enumerations don't have
AllnorNoneconstants - Crystal method overloads are unambiguous
- Method arguments and result types are reachable
- Variadic methods are directly bound
- Alias targets are reachable
- Class base-classes are reachable
- Structure fields are of a supported and reachable type
Regular expression describing a method name
Regular expression describing a operator method name
Regular expression for a type declaration, possibly generic