adamc@643: (* Copyright (c) 2009, Adam Chlipala adamc@643: * All rights reserved. adamc@643: * adamc@643: * Redistribution and use in source and binary forms, with or without adamc@643: * modification, are permitted provided that the following conditions are met: adamc@643: * adamc@643: * - Redistributions of source code must retain the above copyright notice, adamc@643: * this list of conditions and the following disclaimer. adamc@643: * - Redistributions in binary form must reproduce the above copyright notice, adamc@643: * this list of conditions and the following disclaimer in the documentation adamc@643: * and/or other materials provided with the distribution. adamc@643: * - The names of contributors may not be used to endorse or promote products adamc@643: * derived from this software without specific prior written permission. adamc@643: * adamc@643: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" adamc@643: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE adamc@643: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE adamc@643: * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE adamc@643: * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR adamc@643: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF adamc@643: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS adamc@643: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN adamc@643: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) adamc@643: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE adamc@643: * POSSIBILITY OF SUCH DAMAGE. adamc@643: *) adamc@643: adamc@643: structure ScriptCheck :> SCRIPT_CHECK = struct adamc@643: adamc@643: open Cjr adamc@643: adamc@643: structure SS = BinarySetFn(struct adamc@643: type ord_key = string adamc@643: val compare = String.compare adamc@643: end) adamc@643: structure IS = IntBinarySet adamc@643: adamc@693: val pullBasis = SS.addList (SS.empty, adamc@693: ["new_client_source", adamc@693: "get_client_source", adamc@693: "set_client_source"]) adamc@645: adamc@693: val pushBasis = SS.addList (SS.empty, adamc@693: ["new_channel", adamc@693: "self"]) adamc@693: adamc@645: val scriptWords = ["