-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.bbvm
48 lines (48 loc) · 945 Bytes
/
main.bbvm
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
BEGIN _bb2
BUILTIN value I0
BUILTIN _bb4 I8080
server routes _bb4
BEGIN _bb6
BEGIN _bb7
BUILTIN _bb8 "The number of hi must be an integer."
return # _bb8
END
int _bb9 number
AS number _bb9
exists _bb10 number
not _bb11 _bb10
if # _bb11 _bb7
BEGIN _bb12
BUILTIN _bb13 "Need a positive number of hi. Why must you take them away? :-("
return # _bb13
END
BUILTIN _bb15 I0
le _bb14 number _bb15
if # _bb14 _bb12
BUILTIN _bb17 I1
get _bb18 this value
add _bb16 _bb18 _bb17
set # this value _bb16
BUILTIN _bb20 " hi"
str _bb22 number
BUILTIN _bb24 " hello your "
get _bb26 this value
add _bb25 _bb26 number
str _bb27 _bb25
add _bb23 _bb27 _bb24
add _bb21 _bb23 _bb22
add _bb19 _bb21 _bb20
return # _bb19
END
BUILTIN _bb28 "/hi/<number>"
put # routes _bb28 _bb6
return # this
END
new _bb0 _bb2
BUILTIN _bb29 "Give me some greetings at localhost:8000/hi/<number>"
print # _bb29
BUILTIN _bb30 Btrue
BEGIN _bb31
BUILTIN _bb30 Btrue
END
while # _bb30 _bb31