comparison src/mono_util.sml @ 1847:8958b580d026

Change Name_js to skip code snippets that depend on the CSRF-protection signature
author Adam Chlipala <adam@chlipala.net>
date Mon, 01 Apr 2013 10:13:49 -0400
parents c1e3805e604e
children e15234fbb163
comparison
equal deleted inserted replaced
1846:bcae365efa85 1847:8958b580d026
1 (* Copyright (c) 2008, Adam Chlipala 1 (* Copyright (c) 2008, 2013, Adam Chlipala
2 * All rights reserved. 2 * All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met: 5 * modification, are permitted provided that the following conditions are met:
6 * 6 *
651 exp = fn ctx => fn e => fn s => S.Continue (exp (ctx, e, s)), 651 exp = fn ctx => fn e => fn s => S.Continue (exp (ctx, e, s)),
652 decl = fn ctx => fn d => fn s => S.Continue (decl (ctx, d, s)), 652 decl = fn ctx => fn d => fn s => S.Continue (decl (ctx, d, s)),
653 bind = bind} ctx d s of 653 bind = bind} ctx d s of
654 S.Continue v => v 654 S.Continue v => v
655 | S.Return _ => raise Fail "MonoUtil.Decl.foldMapB: Impossible" 655 | S.Return _ => raise Fail "MonoUtil.Decl.foldMapB: Impossible"
656
657 fun exists {typ, exp, decl} k =
658 case mapfold {typ = fn c => fn () =>
659 if typ c then
660 S.Return ()
661 else
662 S.Continue (c, ()),
663 exp = fn e => fn () =>
664 if exp e then
665 S.Return ()
666 else
667 S.Continue (e, ()),
668 decl = fn d => fn () =>
669 if decl d then
670 S.Return ()
671 else
672 S.Continue (d, ())} k () of
673 S.Return _ => true
674 | S.Continue _ => false
656 675
657 end 676 end
658 677
659 structure File = struct 678 structure File = struct
660 679