Mercurial > urweb
comparison src/elab.sml @ 182:d11754ffe252
Compiled pattern matching to C
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sun, 03 Aug 2008 12:43:20 -0400 |
parents | 33d4a8eea484 |
children | 8e9f97508f0d |
comparison
equal
deleted
inserted
replaced
181:31dfab1d4050 | 182:d11754ffe252 |
---|---|
75 PConVar of int | 75 PConVar of int |
76 | PConProj of int * string list * string | 76 | PConProj of int * string list * string |
77 | 77 |
78 datatype pat' = | 78 datatype pat' = |
79 PWild | 79 PWild |
80 | PVar of string | 80 | PVar of string * con |
81 | PPrim of Prim.t | 81 | PPrim of Prim.t |
82 | PCon of patCon * pat option | 82 | PCon of patCon * pat option |
83 | PRecord of (string * pat) list | 83 | PRecord of (string * pat * con) list |
84 | 84 |
85 withtype pat = pat' located | 85 withtype pat = pat' located |
86 | 86 |
87 datatype exp' = | 87 datatype exp' = |
88 EPrim of Prim.t | 88 EPrim of Prim.t |
97 | ERecord of (con * exp * con) list | 97 | ERecord of (con * exp * con) list |
98 | EField of exp * con * { field : con, rest : con } | 98 | EField of exp * con * { field : con, rest : con } |
99 | ECut of exp * con * { field : con, rest : con } | 99 | ECut of exp * con * { field : con, rest : con } |
100 | EFold of kind | 100 | EFold of kind |
101 | 101 |
102 | ECase of exp * (pat * exp) list * con | 102 | ECase of exp * (pat * exp) list * { disc : con, result : con } |
103 | 103 |
104 | EError | 104 | EError |
105 | 105 |
106 withtype exp = exp' located | 106 withtype exp = exp' located |
107 | 107 |