diff cbackend_c.rhope @ 136:fc3815b7462f

Javascript backend now produces working code for some simple examples, still more of the standard lib that needs to be ported.
author Mike Pavone <pavone@retrodev.com>
date Sun, 14 Nov 2010 23:07:55 -0500
parents 18a4403fe576
children a68e6828d896
line wrap: on
line diff
--- a/cbackend_c.rhope	Sun Nov 14 03:09:49 2010 -0500
+++ b/cbackend_c.rhope	Sun Nov 14 23:07:55 2010 -0500
@@ -476,6 +476,11 @@
 	out <- [func]Add Statement[[[[[dest]Append[" = "]]Append[source1]]Append[op]]Append[source2]]
 }
 
+Make AddRef Op@C Function[func,val:out]
+{
+	out <- [["add_ref((object *)"]Append[ [val]Make Op[func] ]]Append[")"]
+}
+
 Add@C Function[func,source1,source2,dest:out]
 {
 	out <- [func]Add Operator Statement[source1,source2,dest," + "]
@@ -1134,12 +1139,12 @@
 	out <- [[[[[[Build[C Program()]]Functions <<[Dictionary[]]]Method Registry <<[C Method Registry[]]]Type Registry <<[C Type Registry[p]]]Field Registry <<[C Field Registry[]]]Libraries <<[Dictionary[]]]Escape Pattern <<[p]
 }
 
-Supported Number Types@JS Program[program:out]
+Supported Number Types@C Program[program:out]
 {
 	out <- ("Int8","Int16","Int32","Int64","UInt8","UInt16","UInt32","UInt64")
 }
 
-Needed Specials@JS Program[program,typename,makespecial:out]
+Needed Specials@C Program[program,typename,makespecial:out]
 {
 	init name <- [" init "]Append[typename]
 	with init <- [()]Append[ [[()]Append[init name]]Append[[makespecial]Index["init"]] ]
@@ -1154,6 +1159,11 @@
 	}
 }
 
+Set Stdlib Imports@C Program[program,parser:out]
+{
+	out <- [parser]Imports <<[ [[parser]Imports >>]Set["kernel.rhope", Yes] ]
+}
+
 Link@C Program[program,language,library:out]
 {
 	If[[library] = ["runtime"]]