Mercurial > repos > rhope
diff cbackend.rhope @ 52:079200bc3e75
String literals almost working. Print moved out of C runtime.
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 28 Apr 2010 01:23:30 -0400 |
parents | 689fb73e7612 |
children | 243d013a49cb |
line wrap: on
line diff
--- a/cbackend.rhope Thu Apr 22 02:18:26 2010 -0400 +++ b/cbackend.rhope Wed Apr 28 01:23:30 2010 -0400 @@ -1084,6 +1084,11 @@ make <- [[[" = make_"]Append[s]]Append["nt"]]Append[[value]Size >>] out <- [text]Append[ [[[[["\t_const_"]Append[Escape Rhope Name[name]]]Append[make]]Append["("]]Append[[value]Value >>]]Append[");\n"] ] + }{ + If[[valtype] = ["String"]] + { + out <- [text]Append[ [[[["\t_const_"]Append[Escape Rhope Name[name]]]Append[" = make_String(\""]]Append[ [[value]Replace["\n", "\\n"]]Replace["\\", "\\\\"]]]Append["\");\n"] ] + } } } }