Mercurial > repos > icfp2014
annotate code/test.lm @ 72:a2a5d80abaa0
Add and as a function to gqc to work around parser limitations
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 28 Jul 2014 00:42:21 -0700 |
parents | 494ef2e3a756 |
children |
rev | line source |
---|---|
1
68d1447bfdbe
Support for compiling lists, tuples and integer literals in lmc. Added small test lm program for exercising compiler.
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1 #{ |
7
afd55b32549b
Implement support for local variables and top level functions
Michael Pavone <pavone@retrodev.com>
parents:
3
diff
changeset
|
2 step <- :myState :world { |
afd55b32549b
Implement support for local variables and top level functions
Michael Pavone <pavone@retrodev.com>
parents:
3
diff
changeset
|
3 foo <- 1234 |
afd55b32549b
Implement support for local variables and top level functions
Michael Pavone <pavone@retrodev.com>
parents:
3
diff
changeset
|
4 if: (isInteger?: 1 | [(2 + 32 * 8) 3 4]) { |
afd55b32549b
Implement support for local variables and top level functions
Michael Pavone <pavone@retrodev.com>
parents:
3
diff
changeset
|
5 myState <- 42 |
afd55b32549b
Implement support for local variables and top level functions
Michael Pavone <pavone@retrodev.com>
parents:
3
diff
changeset
|
6 } else: { |
afd55b32549b
Implement support for local variables and top level functions
Michael Pavone <pavone@retrodev.com>
parents:
3
diff
changeset
|
7 myState <- 24 |
afd55b32549b
Implement support for local variables and top level functions
Michael Pavone <pavone@retrodev.com>
parents:
3
diff
changeset
|
8 } |
afd55b32549b
Implement support for local variables and top level functions
Michael Pavone <pavone@retrodev.com>
parents:
3
diff
changeset
|
9 #[myState 1] |
1
68d1447bfdbe
Support for compiling lists, tuples and integer literals in lmc. Added small test lm program for exercising compiler.
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
10 } |
68d1447bfdbe
Support for compiling lists, tuples and integer literals in lmc. Added small test lm program for exercising compiler.
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
11 |
8
494ef2e3a756
Properly pass initial arguments to main
Michael Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
12 main <- :initWorld mystery{ |
7
afd55b32549b
Implement support for local variables and top level functions
Michael Pavone <pavone@retrodev.com>
parents:
3
diff
changeset
|
13 #[0 step] |
1
68d1447bfdbe
Support for compiling lists, tuples and integer literals in lmc. Added small test lm program for exercising compiler.
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
14 } |
68d1447bfdbe
Support for compiling lists, tuples and integer literals in lmc. Added small test lm program for exercising compiler.
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
15 } |