Mercurial > urweb
comparison src/expl_rename.sml @ 2010:403f0cc65b9c
New lessSafeFfi
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Fri, 02 May 2014 19:19:09 -0400 |
parents | 7db8356caef5 |
children |
comparison
equal
deleted
inserted
replaced
2009:799be3911ce3 | 2010:403f0cc65b9c |
---|---|
217 | DPolicy e => (DPolicy (renameExp st e), loc) | 217 | DPolicy e => (DPolicy (renameExp st e), loc) |
218 | DOnError (n, xs, x) => | 218 | DOnError (n, xs, x) => |
219 (case St.lookup (st, n) of | 219 (case St.lookup (st, n) of |
220 NONE => all | 220 NONE => all |
221 | SOME n' => (DOnError (n', xs, x), loc)) | 221 | SOME n' => (DOnError (n', xs, x), loc)) |
222 | DFfi (x, n, modes, t) => (DFfi (x, n, modes, renameCon st t), loc) | |
222 | 223 |
223 and renameStr st (all as (str, loc)) = | 224 and renameStr st (all as (str, loc)) = |
224 case str of | 225 case str of |
225 StrConst ds => (StrConst (map (renameDecl st) ds), loc) | 226 StrConst ds => (StrConst (map (renameDecl st) ds), loc) |
226 | StrVar n => | 227 | StrVar n => |
411 | DPolicy e => ([(DPolicy (renameExp st e), loc)], st) | 412 | DPolicy e => ([(DPolicy (renameExp st e), loc)], st) |
412 | DOnError (n, xs, x) => | 413 | DOnError (n, xs, x) => |
413 (case St.lookup (st, n) of | 414 (case St.lookup (st, n) of |
414 NONE => ([all], st) | 415 NONE => ([all], st) |
415 | SOME n' => ([(DOnError (n', xs, x), loc)], st)) | 416 | SOME n' => ([(DOnError (n', xs, x), loc)], st)) |
417 | DFfi (x, n, modes, t) => | |
418 let | |
419 val (st, n') = St.bind (st, n) | |
420 val t' = renameCon st t | |
421 in | |
422 ([(DFfi (x, n, modes, t'), loc), | |
423 (DVal (x, n', t', (ENamed n, loc)), loc)], | |
424 st) | |
425 end | |
416 | 426 |
417 fun rename {NextId, FormalName, FormalId, Body = all as (str, loc)} = | 427 fun rename {NextId, FormalName, FormalId, Body = all as (str, loc)} = |
418 case str of | 428 case str of |
419 StrConst ds => | 429 StrConst ds => |
420 let | 430 let |