-
Notifications
You must be signed in to change notification settings - Fork 5
/
boot.flpc
60 lines (53 loc) · 1.87 KB
/
boot.flpc
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
"Unnamed"
drop1()
lookup_error <- fun[]:
error("lookup_error")
functions.append <- fun[value]:
memory.set(functions.end() s21()) # pos value
functions.end.increase()
# Need to make this hyperstatic again later on
# Slightly less ugly hack. Still depend on a memory reset for functions.append.
functions.add <- inline[]:
F' push: pick1 functions.append
push: push: functions.append functions.append
push: string_equal functions.append
push: push: functions.append functions.append
push: return_if functions.append
push: lookup_error functions.append
push: ] functions.append
functions.end.decrease functions.end.decrease 'F
# right_bracket <- 93
write_loop <- fun[]:
pointer = Pointer(memory.len())
repeat:
token = input.next_token()
mempos_append(names.get(token))
if string_equal(token "push:"):
memory.append(string_unescape(input.next_token()))
if string_equal(token "attr:"):
memory.append(input.next_token())
if string_equal(token "attr_call:"):
memory.append(input.next_token())
if string_equal(token "pushi:"):
memory.append(input.next_token())
if string_equal(token "pushf:"):
mempos_append(names.get(input.next_token()))
if string_equal(token "check:"):
memory.append(input.next_token())
if string_equal(token "assign:"):
memory.append(input.next_token())
if string_equal(token "pick:"):
memory.append(input.next_token())
if string_equal(token "bind:"):
memory.append(input.next_token())
if string_equal(token "'''"):
memory.append(input.next_triple_quote())
if string_equal(`token "]"):
return(`pointer)
# Doesn't work well with any semantic...removed
run <- inline[name]:
call(names.get(`name))
input_loop2 <- inline[]:
repeat:
# Too many issues when calling run instead...
call_from_input(names.get(input.next_token()))