diff options
Diffstat (limited to 'test.toc')
-rw-r--r-- | test.toc | 22 |
1 files changed, 18 insertions, 4 deletions
@@ -1,9 +1,16 @@ puti @= fn(x: int) { - #C("printf(\"%ld\\n\", (long)x)"); + #C("printf(\"%ld\\n\", (long)x); +"); +}; + +putch @= fn(x: char) { + #C("printf(\"%c\\n\", x); +"); }; putf @= fn(x: float) { - #C("printf(\"%f\\n\", (double)x)"); + #C("printf(\"%f\\n\", (double)x); +"); }; foo @= fn() int { @@ -22,5 +29,12 @@ main @= fn() { puti(N); x : [foo()]int; puti(foo()); - -}; + teststr := "Hello!"; + i := 0; + while i < 5 { + putch(teststr[i]); + i = i + 1; + } + y:int=5+#C("(1<<3)"); + puti(y); +}; |