made the parser work
This commit is contained in:
parent
7aa98bdd04
commit
dac8ac1e9c
9 changed files with 588 additions and 112 deletions
36
examples/hello-world.pr
Normal file
36
examples/hello-world.pr
Normal file
|
@ -0,0 +1,36 @@
|
|||
|
||||
hello: "hello";
|
||||
prout: "prout";
|
||||
|
||||
line: hello;
|
||||
line <- add(line, " ");
|
||||
line <- add(line, prout);
|
||||
|
||||
say-it: () => {
|
||||
out(line)
|
||||
};
|
||||
|
||||
say-it();
|
||||
|
||||
|
||||
for: (from, to, incr, fn) => {
|
||||
index: from;
|
||||
loop {
|
||||
if not(inf(index, to)) break true;
|
||||
result: fn(index);
|
||||
index <- add(index, incr)
|
||||
}
|
||||
};
|
||||
|
||||
for(0, 3, 0.5, (index) => {
|
||||
out(add("index: ", index))
|
||||
});
|
||||
|
||||
|
||||
a: 1;
|
||||
b: 2;
|
||||
c: 3;
|
||||
a <- b <- c;
|
||||
out(add("a :", a));
|
||||
out(add("b :", b));
|
||||
out(add("c :", c));
|
Loading…
Add table
Add a link
Reference in a new issue