Nimpretty reformat. Two-space indentation.
This commit is contained in:
parent
6b07d7d30b
commit
6eb71b3c6e
|
|
@ -242,7 +242,8 @@ proc print_stack*(stack: JoyListType): string =
|
||||||
# ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═════╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝
|
# ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═════╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝
|
||||||
|
|
||||||
|
|
||||||
proc branch(stack: JoyListType, expression: JoyType, dictionary: JoyMapType): (JoyListType, JoyType, JoyMapType) =
|
proc branch(stack: JoyListType, expression: JoyType, dictionary: JoyMapType): (
|
||||||
|
JoyListType, JoyType, JoyMapType) =
|
||||||
let (true_body, s0) = pop_list(stack)
|
let (true_body, s0) = pop_list(stack)
|
||||||
let (false_body, s1) = pop_list(s0)
|
let (false_body, s1) = pop_list(s0)
|
||||||
let (flag, s2) = pop_bool(s1)
|
let (flag, s2) = pop_bool(s1)
|
||||||
|
|
@ -253,11 +254,13 @@ proc branch(stack: JoyListType, expression: JoyType, dictionary: JoyMapType): (J
|
||||||
# re-wrap one of them in a joytype wrapper.
|
# re-wrap one of them in a joytype wrapper.
|
||||||
|
|
||||||
|
|
||||||
proc clear(stack: JoyListType, expression: JoyType, dictionary: JoyMapType): (JoyListType, JoyType, JoyMapType) =
|
proc clear(stack: JoyListType, expression: JoyType, dictionary: JoyMapType): (
|
||||||
|
JoyListType, JoyType, JoyMapType) =
|
||||||
return (empty_list.listVal, expression, dictionary)
|
return (empty_list.listVal, expression, dictionary)
|
||||||
|
|
||||||
|
|
||||||
proc concat(stack: JoyListType, expression: JoyType, dictionary: JoyMapType): (JoyListType, JoyType, JoyMapType) =
|
proc concat(stack: JoyListType, expression: JoyType, dictionary: JoyMapType): (
|
||||||
|
JoyListType, JoyType, JoyMapType) =
|
||||||
let (tos, s0) = pop_list(stack)
|
let (tos, s0) = pop_list(stack)
|
||||||
let (second, s1) = pop_list(s0)
|
let (second, s1) = pop_list(s0)
|
||||||
return (push_list((second ++ tos), s1), expression, dictionary)
|
return (push_list((second ++ tos), s1), expression, dictionary)
|
||||||
|
|
@ -276,7 +279,8 @@ proc concat(stack: JoyListType, expression: JoyType, dictionary: JoyMapType): (J
|
||||||
# it looks up in the dictionary.
|
# it looks up in the dictionary.
|
||||||
|
|
||||||
|
|
||||||
proc joy_eval(sym: string, stack: JoyListType, expression: JoyType, dictionary: JoyMapType): (JoyListType, JoyType, JoyMapType) =
|
proc joy_eval(sym: string, stack: JoyListType, expression: JoyType,
|
||||||
|
dictionary: JoyMapType): (JoyListType, JoyType, JoyMapType) =
|
||||||
case sym
|
case sym
|
||||||
|
|
||||||
of "add":
|
of "add":
|
||||||
|
|
@ -348,7 +352,8 @@ proc joy_eval(sym: string, stack: JoyListType, expression: JoyType, dictionary:
|
||||||
# <> ≡ ne
|
# <> ≡ ne
|
||||||
|
|
||||||
|
|
||||||
proc joy(stack: JoyListType, expression: JoyType, dictionary: JoyMapType): (JoyListType, JoyMapType) =
|
proc joy(stack: JoyListType, expression: JoyType, dictionary: JoyMapType): (
|
||||||
|
JoyListType, JoyMapType) =
|
||||||
var s = stack
|
var s = stack
|
||||||
var d = dictionary
|
var d = dictionary
|
||||||
var e = push_quote(expression, empty_list)
|
var e = push_quote(expression, empty_list)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue