-
Notifications
You must be signed in to change notification settings - Fork 3
/
scratchpad.ppp
75 lines (56 loc) · 1003 Bytes
/
scratchpad.ppp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#include "ppp.ppp"
exec(open("ppp.ppp").read())
class Foo:
members(""" ",
a,
xyz,
b,
foo,
" """)
def m0(args):
self.a = self.a + 1;
end
def m1(args):
print(0);
end
end_class
def another(args, a, b):
print(a);
print(b);
end
def run(args):
#define CHECK_IF_THING(a) CHECK_IF_THING_INTERNAL(IS_##a##_A_THING, A_THING)
#define IS__A_THING dummy, NOTHING
#define CHECK_IF_THING_INTERNAL_2(a, b, ...) b
#define CHECK_IF_THING_INTERNAL(...) CHECK_IF_THING_INTERNAL_2(__VA_ARGS__)
#define abc_A_THING print("a thing!");
#define abc_NOTHING print("not a thing!");
CAT(abc, CHECK_IF_THING(fasjdsad))
CAT(abc, CHECK_IF_THING())
var
a = Array(0);
a.append(9);
a.append(12);
a.append(3);
for i in (a):
print(i);
end
if (1):
print(1);
elif (2):
print(2);
elif always:
print(3);
end
for i in (range(0, 10)):
print(i);
end
var
foo = make(Foo, 8, 1, 0, 7);
foo.m1();
foo.m0();
foo.m0();
foo.m1();
another(8, 6);
end
end_program()