Mercurial > repos > rhope
diff testc.rhope @ 16:e1c9f2cd99c8
Merged changes
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 26 May 2009 23:37:38 -0400 |
parents | 69dfca29565f |
children | ea991f95ae1f |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/testc.rhope Tue May 26 23:37:38 2009 -0400 @@ -0,0 +1,40 @@ +Import cbackend.rhope + +Main[] +{ + base <- [[[[[[C Function["Fib",("n"),("out"),""] + ]Allocate Var["work1", "Any Type"] + ]Allocate Var["work2", "Any Type"] + ]Null["out"] + ]Method Call["<", [[()]Append[AddRef["n"]]]Append[AddRef[Constant["const_2"]]]] + ]Move[Result[0], "work1"] + ]Method Call["If", [()]Append["work1"]] + {Print["base done"] } + + stream1 <- [[[base]Instruction Stream + ]Release[Result[0]] + ]Move[AddRef[Constant["const_1"]], "out"] + {Print["stream1 done"]} + + stream2 <- [[[[[[base]Instruction Stream + ]Release[Result[0]] + ]Method Call["-", [[()]Append[AddRef["n"]]]Append[AddRef[Constant["const_1"]]]] + ]Move[Result[0], "work1"] + ]Method Call["-", [[()]Append[AddRef["n"]]]Append[AddRef[Constant["const_2"]]]] + ]Move[Result[0], "work2"] + {Print["stream2 done"]} + + func <- [[base + ]Do If[Result[0], stream1] + ]Do If[Result[1], stream2] + {Print["func done"] } + + Print[[func]Definitions] + { + Print[[func]Text] } +} + +Foo[] +{ +} +