diff backendutils.rhope @ 37:640f541e9116

Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
author Mike Pavone <pavone@retrodev.com>
date Mon, 05 Oct 2009 23:12:43 -0400
parents 495dddadd058
children 7f05bbe82f24
line wrap: on
line diff
--- a/backendutils.rhope	Sat Oct 03 03:18:15 2009 -0400
+++ b/backendutils.rhope	Mon Oct 05 23:12:43 2009 -0400
@@ -123,7 +123,7 @@
 
 Make Op@OrCond[cond,func:out]
 {
-	out <- ["("]Append[[[[cond]Condition1 >>]Append[" || "]]Append[[[cond]Condition2 >>]Append[")"]]]
+	out <- ["("]Append[[[ [[cond]Condition1 >>]Make Op[func] ]Append[" || "]]Append[[ [[cond]Condition2 >>]Make Op[func] ]Append[")"]]]
 }
 
 Blueprint AndCond
@@ -139,7 +139,7 @@
 
 Make Op@AndCond[cond,func:out]
 {
-	out <- ["("]Append[[[[cond]Condition1 >>]Append[" && "]]Append[[[cond]Condition2 >>]Append[")"]]]
+	out <- ["("]Append[[[ [[cond]Condition1 >>]Make Op[func] ]Append[" && "]]Append[[ [[cond]Condition2 >>]Make Op[func] ]Append[")"]]]
 }
 
 Blueprint Field Ref
@@ -157,3 +157,31 @@
 {
 	out <- [func]Field Result[[ref]Variable >>,[ref]Field >>]
 }
+
+Blueprint Type Instance
+{
+	Name
+	Params
+	Variant
+}
+
+Type Instance[raw name:out]
+{
+	If[[raw name]=[""]]
+	{
+		name <- "Any Type"
+	}{
+		name <- raw name
+	}
+	out <- [[[Build["Type Instance"]]Name <<[name]]Params <<[()]]Variant <<["Boxed"]
+}
+
+Set Variant[type,variant:out,invalid]
+{
+	[("Boxed","Naked","Pointer","Raw Pointer")]Find[variant]
+	{
+		out <- [type]Variant <<[variant]
+	}{
+		invalid <- type
+	}
+}