From 933241835e0ffdc659292027411c869001cdc0e1 Mon Sep 17 00:00:00 2001 From: Chris Pressey Date: Mon, 28 Jun 2021 16:58:34 +0100 Subject: [PATCH] Add example file, note after observing the compiled code from it. --- TODO.md | 2 ++ eg/countdown.castile | 8 ++++++++ 2 files changed, 10 insertions(+) create mode 100644 eg/countdown.castile diff --git a/TODO.md b/TODO.md index 44ce7d8..b56e514 100644 --- a/TODO.md +++ b/TODO.md @@ -29,6 +29,8 @@ AST nodes should have source line numbers, it would be really nice. C backend. Other backends (Python? Java? CIL? Scheme?) +Runtime support for `str` in Ruby backend and JavaScript backend. + ### Design ### Convenience: diff --git a/eg/countdown.castile b/eg/countdown.castile new file mode 100644 index 0000000..3b2194c --- /dev/null +++ b/eg/countdown.castile @@ -0,0 +1,8 @@ +fun main() { + num = 10; + while (num > 0) { + print(str(num)); + num = num - 1 + } + print("Done.") +}