adam@1732: (* Copyright (c) 2012, Adam Chlipala adam@1732: * All rights reserved. adam@1732: * adam@1732: * Redistribution and use in source and binary forms, with or without adam@1732: * modification, are permitted provided that the following conditions are met: adam@1732: * adam@1732: * - Redistributions of source code must retain the above copyright notice, adam@1732: * this list of conditions and the following disclaimer. adam@1732: * - Redistributions in binary form must reproduce the above copyright notice, adam@1732: * this list of conditions and the following disclaimer in the documentation adam@1732: * and/or other materials provided with the distribution. adam@1732: * - The names of contributors may not be used to endorse or promote products adam@1732: * derived from this software without specific prior written permission. adam@1732: * adam@1732: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" adam@1732: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE adam@1732: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE adam@1732: * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE adam@1732: * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR adam@1732: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF adam@1732: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS adam@1732: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN adam@1732: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) adam@1732: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE adam@1732: * POSSIBILITY OF SUCH DAMAGE. adam@1732: *) adam@1732: adam@1732: (* Cache of module code, with dependency information *) adam@1732: adam@1732: signature MOD_DB = sig adam@1732: val reset : unit -> unit adam@1732: adam@1732: val insert : Elab.decl * Time.time -> unit adam@1732: (* Here's a declaration, including the modification timestamp of the file it came from. adam@1732: * We might invalidate other declarations that depend on this one, if the timestamp has changed. *) adam@1732: adam@1732: val lookup : Source.decl -> Elab.decl option adam@1737: adam@1737: (* Allow undoing to snapshots after failed compilations. *) adam@1737: val snapshot : unit -> unit adam@1737: val revert : unit -> unit adam@1732: end