autoformat
This commit is contained in:
parent
0905cdc0da
commit
07f47a3b7a
|
|
@ -13,7 +13,6 @@ let j_loop = JoySymbol "loop"
|
||||||
let zero = JoyInt 0
|
let zero = JoyInt 0
|
||||||
let dummy = JoyList [ joy_true; joy_false; j_loop; zero ]
|
let dummy = JoyList [ joy_true; joy_false; j_loop; zero ]
|
||||||
|
|
||||||
|
|
||||||
(*
|
(*
|
||||||
let joy_nil = JoyList []
|
let joy_nil = JoyList []
|
||||||
██████╗ ██╗ ██████╗████████╗██╗ ██████╗ ███╗ ██╗ █████╗ ██████╗ ██╗ ██╗
|
██████╗ ██╗ ██████╗████████╗██╗ ██████╗ ███╗ ██╗ █████╗ ██████╗ ██╗ ██╗
|
||||||
|
|
@ -36,7 +35,6 @@ type joy_dict = string -> joy_list
|
||||||
|
|
||||||
let d = dict_add empty_dict "foo" []
|
let d = dict_add empty_dict "foo" []
|
||||||
|
|
||||||
|
|
||||||
(*
|
(*
|
||||||
██╗ ██╗████████╗██╗██╗ ███████╗
|
██╗ ██╗████████╗██╗██╗ ███████╗
|
||||||
██║ ██║╚══██╔══╝██║██║ ██╔════╝
|
██║ ██║╚══██╔══╝██║██║ ██╔════╝
|
||||||
|
|
@ -58,7 +56,6 @@ let pop_int : joy_list -> int * joy_list =
|
||||||
| JoyInt i -> (i, tail)
|
| JoyInt i -> (i, tail)
|
||||||
| _ -> raise (ValueError "Not an integer."))
|
| _ -> raise (ValueError "Not an integer."))
|
||||||
|
|
||||||
|
|
||||||
(*
|
(*
|
||||||
██████╗ ██████╗ ██╗███╗ ██╗████████╗███████╗██████╗
|
██████╗ ██████╗ ██╗███╗ ██╗████████╗███████╗██████╗
|
||||||
██╔══██╗██╔══██╗██║████╗ ██║╚══██╔══╝██╔════╝██╔══██╗
|
██╔══██╗██╔══██╗██║████╗ ██║╚══██╔══╝██╔════╝██╔══██╗
|
||||||
|
|
@ -92,8 +89,7 @@ type token = Left_bracket | Right_bracket | Token of string
|
||||||
let delimiter str i =
|
let delimiter str i =
|
||||||
i >= String.length str || String.contains "[] " (String.get str i)
|
i >= String.length str || String.contains "[] " (String.get str i)
|
||||||
|
|
||||||
let make_token str index i =
|
let make_token str index i = (Token (String.sub str index (i - index)), i)
|
||||||
(Token (String.sub str index (i - index)), i)
|
|
||||||
|
|
||||||
(* string -> int -> int -> token * int *)
|
(* string -> int -> int -> token * int *)
|
||||||
let rec tokenize1 str index i =
|
let rec tokenize1 str index i =
|
||||||
|
|
@ -200,7 +196,6 @@ let clear s e d = (Joy_nil, e, d)
|
||||||
|
|
||||||
*)
|
*)
|
||||||
|
|
||||||
|
|
||||||
(*
|
(*
|
||||||
██╗███╗ ██╗████████╗███████╗██████╗ ██████╗ ██████╗ ███████╗████████╗███████╗██████╗
|
██╗███╗ ██╗████████╗███████╗██████╗ ██████╗ ██████╗ ███████╗████████╗███████╗██████╗
|
||||||
██║████╗ ██║╚══██╔══╝██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝╚══██╔══╝██╔════╝██╔══██╗
|
██║████╗ ██║╚══██╔══╝██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝╚══██╔══╝██╔════╝██╔══██╗
|
||||||
|
|
@ -220,8 +215,7 @@ let joy_eval sym stack expression dictionary =
|
||||||
let a, s0 = pop_int stack in
|
let a, s0 = pop_int stack in
|
||||||
let b, s1 = pop_int s0 in
|
let b, s1 = pop_int s0 in
|
||||||
(JoyInt (b - a) :: s1, expression, dictionary)
|
(JoyInt (b - a) :: s1, expression, dictionary)
|
||||||
| "clear" ->
|
| "clear" -> ([], expression, dictionary)
|
||||||
([], expression, dictionary)
|
|
||||||
| _ ->
|
| _ ->
|
||||||
let func = dictionary sym in
|
let func = dictionary sym in
|
||||||
(stack, func @ expression, dictionary)
|
(stack, func @ expression, dictionary)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue