Handbook
Glossary
compile-bf-subexpr ( vec string-like -- vec string-like )
Vocabulary
brain-flak
.
private
Inputs
vec
an
object
string-like
an
object
Outputs
vec
an
object
string-like
an
object
Definition
USING:
accessors
brain-flak
combinators
kernel
sequences
sets
splitting
vectors
;
IN:
brain-flak.private
:
compile-bf-subexpr
( vec string-like -- vec string-like )
[
{
{
[
dup
empty?
]
[
f
]
}
{
[
dup
first
")]}>"
in?
]
[
f
]
}
{
[
"()"
?head-slice
]
[
[
\
(())
suffix!
]
dip
t
]
}
{
[
"[]"
?head-slice
]
[
[
\
([])
suffix!
]
dip
t
]
}
{
[
"{}"
?head-slice
]
[
[
\
({})
suffix!
]
dip
t
]
}
{
[
"<>"
?head-slice
]
[
[
\
(<>)
suffix!
]
dip
t
]
}
[
0
<vector>
swap
[
rest-slice
]
[
first
]
bi
[
compile-bf-subexpr
[
~quotation~
clone-like
suffix!
]
dip
[
dup
empty?
~quotation~ ~quotation~
if
]
[
?first
]
bi
]
dip
over
matches
[
over
seq>>
mismatched-brain-flak-brackets
]
unless
{
{
41 ~quotation~
}
{
93 ~quotation~
}
{
125 ~quotation~
}
{
62 ~quotation~
}
}
case
t
]
}
cond
]
loop
;