annotate samples/recursive_closure.tp @ 225:262f5ae1bb1b

Added a new binaryOps:withHigherPrec macro to simplify specification of binary operator precedence level rules in the grammar
author Michael Pavone <pavone@retrodev.com>
date Sun, 29 Dec 2013 14:39:54 -0800
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 }