annotate samples/recursive_closure.tp @ 358:27477c8c2823

Add support for simple type annotations in parser and update llhello sample with a possible new low-level dialect syntax leveraging those annotations
author Michael Pavone <pavone@retrodev.com>
date Fri, 17 Apr 2015 17:50:47 -0700
parents 3a169ebb3224
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
55
93ddb4ad6fcb Fix some nested closure bugs
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1 #{
93ddb4ad6fcb Fix some nested closure bugs
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
2 main <- {
93ddb4ad6fcb Fix some nested closure bugs
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
3 foo <- :n {
93ddb4ad6fcb Fix some nested closure bugs
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
4 if: n < 10 {
93ddb4ad6fcb Fix some nested closure bugs
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
5 true
93ddb4ad6fcb Fix some nested closure bugs
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
6 } else: {
93ddb4ad6fcb Fix some nested closure bugs
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
7 foo <- :n { n }
93ddb4ad6fcb Fix some nested closure bugs
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
8 }
93ddb4ad6fcb Fix some nested closure bugs
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
9 foo: n + 1
93ddb4ad6fcb Fix some nested closure bugs
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
10 }
93ddb4ad6fcb Fix some nested closure bugs
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
11 print: (string: (foo: 0))
93ddb4ad6fcb Fix some nested closure bugs
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
12 }
93ddb4ad6fcb Fix some nested closure bugs
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
13 }