mirror of
https://github.com/anoma/juvix.git
synced 2024-11-30 05:42:26 +03:00
ed15e57d8a
* Closes #2578 * Implements JuvixReg parser and pretty printer. * Adds the `juvix dev reg read file.jvr` command. * Adds the `reg` target to the `compile` commands. * Adds tests for the JuvixReg parser.
68 lines
1.3 KiB
Plaintext
68 lines
1.3 KiB
Plaintext
type list {
|
|
nil : list;
|
|
cons : (*, list) → list;
|
|
}
|
|
|
|
function main() : *;
|
|
|
|
function main() : * {
|
|
prealloc 40;
|
|
tmp[0] = 1;
|
|
tmp[1] = 1;
|
|
tmp[0] = eq tmp[1] tmp[0];
|
|
trace tmp[0];
|
|
nop;
|
|
tmp[0] = 1;
|
|
tmp[1] = 0;
|
|
tmp[0] = eq tmp[1] tmp[0];
|
|
trace tmp[0];
|
|
nop;
|
|
tmp[0] = alloc nil ();
|
|
tmp[1] = alloc nil ();
|
|
tmp[0] = eq tmp[1] tmp[0];
|
|
trace tmp[0];
|
|
nop;
|
|
tmp[0] = alloc nil ();
|
|
tmp[1] = alloc nil ();
|
|
tmp[2] = 1;
|
|
tmp[1] = alloc cons (tmp[2], tmp[1]);
|
|
tmp[0] = eq tmp[1] tmp[0];
|
|
trace tmp[0];
|
|
nop;
|
|
tmp[0] = alloc nil ();
|
|
tmp[1] = 2;
|
|
tmp[0] = alloc cons (tmp[1], tmp[0]);
|
|
tmp[1] = alloc nil ();
|
|
tmp[2] = 1;
|
|
tmp[1] = alloc cons (tmp[2], tmp[1]);
|
|
tmp[0] = eq tmp[1] tmp[0];
|
|
trace tmp[0];
|
|
nop;
|
|
tmp[0] = alloc nil ();
|
|
tmp[1] = 2;
|
|
tmp[0] = alloc cons (tmp[1], tmp[0]);
|
|
tmp[1] = 1;
|
|
tmp[0] = alloc cons (tmp[1], tmp[0]);
|
|
tmp[1] = alloc nil ();
|
|
tmp[2] = 1;
|
|
tmp[1] = alloc cons (tmp[2], tmp[1]);
|
|
tmp[0] = eq tmp[1] tmp[0];
|
|
trace tmp[0];
|
|
nop;
|
|
tmp[0] = alloc nil ();
|
|
tmp[1] = 2;
|
|
tmp[0] = alloc cons (tmp[1], tmp[0]);
|
|
tmp[1] = 1;
|
|
tmp[0] = alloc cons (tmp[1], tmp[0]);
|
|
tmp[1] = alloc nil ();
|
|
tmp[2] = 2;
|
|
tmp[1] = alloc cons (tmp[2], tmp[1]);
|
|
tmp[2] = 1;
|
|
tmp[1] = alloc cons (tmp[2], tmp[1]);
|
|
tmp[0] = eq tmp[1] tmp[0];
|
|
trace tmp[0];
|
|
nop;
|
|
tmp[0] = void;
|
|
ret tmp[0];
|
|
}
|