From 82e400315d526eb6c96fd1ad21a8ce75529f7717 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Mon, 1 Apr 2013 10:13:49 -0400 Subject: Change Name_js to skip code snippets that depend on the CSRF-protection signature --- src/mono_util.sml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'src/mono_util.sml') diff --git a/src/mono_util.sml b/src/mono_util.sml index 61638858..116dfa64 100644 --- a/src/mono_util.sml +++ b/src/mono_util.sml @@ -1,4 +1,4 @@ -(* Copyright (c) 2008, Adam Chlipala +(* Copyright (c) 2008, 2013, Adam Chlipala * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -654,6 +654,25 @@ fun foldMapB {typ, exp, decl, bind} ctx s d = S.Continue v => v | S.Return _ => raise Fail "MonoUtil.Decl.foldMapB: Impossible" +fun exists {typ, exp, decl} k = + case mapfold {typ = fn c => fn () => + if typ c then + S.Return () + else + S.Continue (c, ()), + exp = fn e => fn () => + if exp e then + S.Return () + else + S.Continue (e, ()), + decl = fn d => fn () => + if decl d then + S.Return () + else + S.Continue (d, ())} k () of + S.Return _ => true + | S.Continue _ => false + end structure File = struct -- cgit v1.2.3