Skip to content

Commit

Permalink
Minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
ShinWonho committed Feb 20, 2024
1 parent 0a05023 commit e32bdc7
Show file tree
Hide file tree
Showing 3 changed files with 168 additions and 187 deletions.
8 changes: 3 additions & 5 deletions spectec/src/backend-interpreter/ds.ml
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,14 @@ module AlContext = struct

type t = mode list

let tl = List.tl

let is_reducible = function
| [] | [ Return _ ] -> false
| _ -> true

let get_context = List.hd

let pop_context = List.tl

let get_name ctx =
match get_context ctx with
match List.hd ctx with
| Al (name, _, _) -> name
| Wasm _ -> "Wasm"
| Execute _ -> "Execute"
Expand Down
2 changes: 1 addition & 1 deletion spectec/src/backend-interpreter/ds.mli
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ module AlContext : sig
val execute : value -> mode
val return : value -> mode
type t = mode list
val tl : t -> t
val is_reducible : t -> bool
val pop_context : t -> t
val get_name : t -> string
val add_instrs : instr list -> t -> t
val set_env : env -> t -> t
Expand Down
Loading

0 comments on commit e32bdc7

Please sign in to comment.