comparison src/elab.sml @ 171:c7a6e6dbc318

Elaborating some basic pattern matching
author Adam Chlipala <adamc@hcoop.net>
date Thu, 31 Jul 2008 10:06:27 -0400
parents 06a98129b23f
children 8221b95cc24c
comparison
equal deleted inserted replaced
170:a158f8c5aa55 171:c7a6e6dbc318
69 | CError 69 | CError
70 | CUnif of ErrorMsg.span * kind * string * con option ref 70 | CUnif of ErrorMsg.span * kind * string * con option ref
71 71
72 withtype con = con' located 72 withtype con = con' located
73 73
74 datatype patCon =
75 PConVar of int
76 | PConProj of int * string list * string
77
78 datatype pat' =
79 PWild
80 | PVar of string
81 | PCon of patCon * pat option
82
83 withtype pat = pat' located
84
74 datatype exp' = 85 datatype exp' =
75 EPrim of Prim.t 86 EPrim of Prim.t
76 | ERel of int 87 | ERel of int
77 | ENamed of int 88 | ENamed of int
78 | EModProj of int * string list * string 89 | EModProj of int * string list * string
83 94
84 | ERecord of (con * exp * con) list 95 | ERecord of (con * exp * con) list
85 | EField of exp * con * { field : con, rest : con } 96 | EField of exp * con * { field : con, rest : con }
86 | ECut of exp * con * { field : con, rest : con } 97 | ECut of exp * con * { field : con, rest : con }
87 | EFold of kind 98 | EFold of kind
99
100 | ECase of exp * (pat * exp) list * con
88 101
89 | EError 102 | EError
90 103
91 withtype exp = exp' located 104 withtype exp = exp' located
92 105