Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Gets past rock compilation, stuck at C compilation

  • Loading branch information...
commit 157321a4083966b8430a7dcb0ce6c5311a7578a6 1 parent 97b284d
@shamanas authored
View
2  source/Codegen.ooc
@@ -117,7 +117,7 @@ Codegen: class {
case InfoType flags => EnumVisitor new(info as EnumInfo) as Visitor
case InfoType object => ObjectVisitor new(info as ObjectInfo) as Visitor
case InfoType constant => ConstantVisitor new(info as ConstantInfo) as Visitor
- case InfoType struct => (!info as StructInfo isGTypeStruct?()) ? StructVisitor new(info as StructInfo) as Visitor : null
+ case InfoType struct => StructVisitor new(info as StructInfo) as Visitor
case InfoType _interface => InterfaceVisitor new(info as InterfaceInfo) as Visitor
case InfoType union => UnionVisitor new(info as UnionInfo) as Visitor
case => null as Visitor // We want to ignore generating symbols for some types of info, so we yield no error here
View
6 source/FunctionVisitor.ooc
@@ -2,7 +2,7 @@ use gi
import gi/[BaseInfo, FunctionInfo, RegisteredTypeInfo, ArgInfo, CallbackInfo]
import OocWriter, Visitor, Utils, CallbackVisitor
-// Handle arguments of callback types (make them pointer, generate a second function that takes a closure and passes the context as a userData pointer if the function has one and the callback type has a last argument of pointer type)
+// TODO: Fix bug where for some reason an ooc func prototype is written for an interface but no function declaration is written for objects that implement it
FunctionVisitor: class extends Visitor {
info: FunctionInfo
@@ -11,14 +11,17 @@ FunctionVisitor: class extends Visitor {
byValue? := false
prototype? := false
forcedSuffix: String = null
+ forcedNamespace: String = null
init: func(=info)
init: func~withParent(=info, =parent)
init: func~withByValue(=info, =parent, =byValue?)
init: func~withSuffix(=info, =parent, =forcedSuffix, =prototype?)
+ init: func~withNamespace(=info, =parent, =forcedSuffix, =forcedNamespace)
write: func(writer: OocWriter) {
namespace := info getNamespace() toString()
+ if(forcedNamespace) namespace = forcedNamespace
name := info getName()
inValueStruct? := (parent != null && byValue?)
isStatic? := false
@@ -188,6 +191,7 @@ FunctionVisitor: class extends Visitor {
arg unref()
}
}
+ if(info getFlags() & FunctionInfoFlags throws?) writer uw(", error")
writer uw(")\n") . dedent() . w("}\n")
} else {
writer uw("\n")
View
2  source/InterfaceVisitor.ooc
@@ -32,7 +32,7 @@ InterfaceContentsVisitor: class extends Visitor {
// Write our methods
for(i in 0 .. info getNMethods()) {
method := info getMethod(i)
- FunctionVisitor new(method, info, info getName() toString(), false) write(writer) . free()
+ FunctionVisitor new(method, info, info getName() toString(), namespace) write(writer) . free()
method unref()
}
// Write our constants
Please sign in to comment.
Something went wrong with that request. Please try again.