comparison src/scriptcheck.sml @ 2251:25874084bf1f

Make Mono.file a record for readability upon extension.
author Ziv Scully <ziv@mit.edu>
date Sun, 13 Sep 2015 17:02:17 -0400
parents 3dd041b00087
children e843a04499d4
comparison
equal deleted inserted replaced
2250:c275bbc41194 2251:25874084bf1f
14 * 14 *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 18 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
89 | Module m => (print "<Module>\n"; 89 | Module m => (print "<Module>\n";
90 SM.appi (fn (k, r') => (print (k ^ ":\n"); 90 SM.appi (fn (k, r') => (print (k ^ ":\n");
91 dump r')) m; 91 dump r')) m;
92 print "</Module>\n") 92 print "</Module>\n")
93 93
94 fun classify (ds, ps) = 94 fun classify {decls = ds, sideInfo = ps} =
95 let 95 let
96 val proto = Settings.currentProtocol () 96 val proto = Settings.currentProtocol ()
97 97
98 fun inString {needle, haystack} = String.isSubstring needle haystack 98 fun inString {needle, haystack} = String.isSubstring needle haystack
99 99
100 fun hasClient {basis, rpcs, funcs, push} = 100 fun hasClient {basis, rpcs, funcs, push} =
101 MonoUtil.Exp.exists {typ = fn _ => false, 101 MonoUtil.Exp.exists {typ = fn _ => false,
102 exp = fn ERecv _ => push 102 exp = fn ERecv _ => push
103 | EFfiApp ("Basis", x, _) => SS.member (basis, x) 103 | EFfiApp ("Basis", x, _) => SS.member (basis, x)
104 | EJavaScript _ => not push 104 | EJavaScript _ => not push
105 | ENamed n => IS.member (funcs, n) 105 | ENamed n => IS.member (funcs, n)
106 | EServerCall (e, _, _, _) => 106 | EServerCall (e, _, _, _) =>
107 let 107 let
108 fun head (e : exp) = 108 fun head (e : exp) =
173 else if IS.member (pull_ids, n) then 173 else if IS.member (pull_ids, n) then
174 ServerAndPull 174 ServerAndPull
175 else 175 else
176 ServerOnly, AnyDb)) (IS.listItems all_ids) 176 ServerOnly, AnyDb)) (IS.listItems all_ids)
177 in 177 in
178 (ds, ps) 178 {decls = ds, sideInfo = ps}
179 end 179 end
180 180
181 end 181 end
182