mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-06 14:58:50 +00:00
New ppx
This commit is contained in:
parent
15a827104e
commit
090398c6f8
1 changed files with 2 additions and 2 deletions
|
|
@ -11,7 +11,7 @@ open Combinators
|
||||||
module Value =
|
module Value =
|
||||||
struct
|
struct
|
||||||
|
|
||||||
@type t = Int of int | String of bytes | Array of t array | Sexp of string * t list (*with show*)
|
@type t = Int of int | String of bytes | Array of t array | Sexp of string * t list with show
|
||||||
|
|
||||||
let to_int = function
|
let to_int = function
|
||||||
| Int n -> n
|
| Int n -> n
|
||||||
|
|
@ -377,7 +377,7 @@ module Stmt =
|
||||||
| Case (e, bs) ->
|
| Case (e, bs) ->
|
||||||
let (_, _, _, Some v) as conf' = Expr.eval env conf e in
|
let (_, _, _, Some v) as conf' = Expr.eval env conf e in
|
||||||
let rec branch ((st, i, o, _) as conf) = function
|
let rec branch ((st, i, o, _) as conf) = function
|
||||||
| [] -> failwith (Printf.sprintf "Pattern matching failed: no branch is selected while matching %s\n" "" (*show(Value.t) v*))
|
| [] -> failwith (Printf.sprintf "Pattern matching failed: no branch is selected while matching %s\n" (show(Value.t) v))
|
||||||
| (patt, body)::tl ->
|
| (patt, body)::tl ->
|
||||||
let rec match_patt patt v st =
|
let rec match_patt patt v st =
|
||||||
let update x v = function
|
let update x v = function
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue