Mercurial > urweb
comparison src/compiler.sml @ 1171:7a2a7a8f9cab
benignEffectful
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sat, 27 Feb 2010 16:49:11 -0500 |
parents | 52c6ac6a59f1 |
children | 983d9b38abc7 |
comparison
equal
deleted
inserted
replaced
1170:52c6ac6a59f1 | 1171:7a2a7a8f9cab |
---|---|
46 link : string list, | 46 link : string list, |
47 headers : string list, | 47 headers : string list, |
48 scripts : string list, | 48 scripts : string list, |
49 clientToServer : Settings.ffi list, | 49 clientToServer : Settings.ffi list, |
50 effectful : Settings.ffi list, | 50 effectful : Settings.ffi list, |
51 benignEffectful : Settings.ffi list, | |
51 clientOnly : Settings.ffi list, | 52 clientOnly : Settings.ffi list, |
52 serverOnly : Settings.ffi list, | 53 serverOnly : Settings.ffi list, |
53 jsFuncs : (Settings.ffi * string) list, | 54 jsFuncs : (Settings.ffi * string) list, |
54 rewrites : Settings.rewrite list, | 55 rewrites : Settings.rewrite list, |
55 filterUrl : Settings.rule list, | 56 filterUrl : Settings.rule list, |
210 handle LrParser.ParseError => [], | 211 handle LrParser.ParseError => [], |
211 print = SourcePrint.p_file} | 212 print = SourcePrint.p_file} |
212 | 213 |
213 fun p_job ({prefix, database, exe, sql, sources, debug, profile, | 214 fun p_job ({prefix, database, exe, sql, sources, debug, profile, |
214 timeout, ffi, link, headers, scripts, | 215 timeout, ffi, link, headers, scripts, |
215 clientToServer, effectful, clientOnly, serverOnly, jsFuncs, ...} : job) = | 216 clientToServer, effectful, benignEffectful, clientOnly, serverOnly, jsFuncs, ...} : job) = |
216 let | 217 let |
217 open Print.PD | 218 open Print.PD |
218 open Print | 219 open Print |
219 | 220 |
220 fun p_ffi name = p_list_sep (box []) (fn (m, s) => | 221 fun p_ffi name = p_list_sep (box []) (fn (m, s) => |
246 p_list_sep (box []) (fn s => box [string "Header", space, string s, newline]) headers, | 247 p_list_sep (box []) (fn s => box [string "Header", space, string s, newline]) headers, |
247 p_list_sep (box []) (fn s => box [string "Script", space, string s, newline]) scripts, | 248 p_list_sep (box []) (fn s => box [string "Script", space, string s, newline]) scripts, |
248 p_list_sep (box []) (fn s => box [string "Link", space, string s, newline]) link, | 249 p_list_sep (box []) (fn s => box [string "Link", space, string s, newline]) link, |
249 p_ffi "ClientToServer" clientToServer, | 250 p_ffi "ClientToServer" clientToServer, |
250 p_ffi "Effectful" effectful, | 251 p_ffi "Effectful" effectful, |
252 p_ffi "BenignEffectful" benignEffectful, | |
251 p_ffi "ClientOnly" clientOnly, | 253 p_ffi "ClientOnly" clientOnly, |
252 p_ffi "ServerOnly" serverOnly, | 254 p_ffi "ServerOnly" serverOnly, |
253 p_list_sep (box []) (fn ((m, s), s') => | 255 p_list_sep (box []) (fn ((m, s), s') => |
254 box [string "JsFunc", space, string m, string ".", string s, | 256 box [string "JsFunc", space, string m, string ".", string s, |
255 space, string "=", space, string s', newline]) jsFuncs, | 257 space, string "=", space, string s', newline]) jsFuncs, |
369 val link = ref [] | 371 val link = ref [] |
370 val headers = ref [] | 372 val headers = ref [] |
371 val scripts = ref [] | 373 val scripts = ref [] |
372 val clientToServer = ref [] | 374 val clientToServer = ref [] |
373 val effectful = ref [] | 375 val effectful = ref [] |
376 val benignEffectful = ref [] | |
374 val clientOnly = ref [] | 377 val clientOnly = ref [] |
375 val serverOnly = ref [] | 378 val serverOnly = ref [] |
376 val jsFuncs = ref [] | 379 val jsFuncs = ref [] |
377 val rewrites = ref [] | 380 val rewrites = ref [] |
378 val url = ref [] | 381 val url = ref [] |
397 link = rev (!link), | 400 link = rev (!link), |
398 headers = rev (!headers), | 401 headers = rev (!headers), |
399 scripts = rev (!scripts), | 402 scripts = rev (!scripts), |
400 clientToServer = rev (!clientToServer), | 403 clientToServer = rev (!clientToServer), |
401 effectful = rev (!effectful), | 404 effectful = rev (!effectful), |
405 benignEffectful = rev (!benignEffectful), | |
402 clientOnly = rev (!clientOnly), | 406 clientOnly = rev (!clientOnly), |
403 serverOnly = rev (!serverOnly), | 407 serverOnly = rev (!serverOnly), |
404 jsFuncs = rev (!jsFuncs), | 408 jsFuncs = rev (!jsFuncs), |
405 rewrites = rev (!rewrites), | 409 rewrites = rev (!rewrites), |
406 filterUrl = rev (!url), | 410 filterUrl = rev (!url), |
437 link = #link old @ #link new, | 441 link = #link old @ #link new, |
438 headers = #headers old @ #headers new, | 442 headers = #headers old @ #headers new, |
439 scripts = #scripts old @ #scripts new, | 443 scripts = #scripts old @ #scripts new, |
440 clientToServer = #clientToServer old @ #clientToServer new, | 444 clientToServer = #clientToServer old @ #clientToServer new, |
441 effectful = #effectful old @ #effectful new, | 445 effectful = #effectful old @ #effectful new, |
446 benignEffectful = #benignEffectful old @ #benignEffectful new, | |
442 clientOnly = #clientOnly old @ #clientOnly new, | 447 clientOnly = #clientOnly old @ #clientOnly new, |
443 serverOnly = #serverOnly old @ #serverOnly new, | 448 serverOnly = #serverOnly old @ #serverOnly new, |
444 jsFuncs = #jsFuncs old @ #jsFuncs new, | 449 jsFuncs = #jsFuncs old @ #jsFuncs new, |
445 rewrites = #rewrites old @ #rewrites new, | 450 rewrites = #rewrites old @ #rewrites new, |
446 filterUrl = #filterUrl old @ #filterUrl new, | 451 filterUrl = #filterUrl old @ #filterUrl new, |
562 end | 567 end |
563 | "include" => headers := relifyA arg :: !headers | 568 | "include" => headers := relifyA arg :: !headers |
564 | "script" => scripts := arg :: !scripts | 569 | "script" => scripts := arg :: !scripts |
565 | "clientToServer" => clientToServer := ffiS () :: !clientToServer | 570 | "clientToServer" => clientToServer := ffiS () :: !clientToServer |
566 | "effectful" => effectful := ffiS () :: !effectful | 571 | "effectful" => effectful := ffiS () :: !effectful |
572 | "benignEffectful" => benignEffectful := ffiS () :: !benignEffectful | |
567 | "clientOnly" => clientOnly := ffiS () :: !clientOnly | 573 | "clientOnly" => clientOnly := ffiS () :: !clientOnly |
568 | "serverOnly" => serverOnly := ffiS () :: !serverOnly | 574 | "serverOnly" => serverOnly := ffiS () :: !serverOnly |
569 | "jsFunc" => jsFuncs := ffiM () :: !jsFuncs | 575 | "jsFunc" => jsFuncs := ffiM () :: !jsFuncs |
570 | "rewrite" => | 576 | "rewrite" => |
571 let | 577 let |
624 Settings.setTimeout (#timeout job); | 630 Settings.setTimeout (#timeout job); |
625 Settings.setHeaders (#headers job); | 631 Settings.setHeaders (#headers job); |
626 Settings.setScripts (#scripts job); | 632 Settings.setScripts (#scripts job); |
627 Settings.setClientToServer (#clientToServer job); | 633 Settings.setClientToServer (#clientToServer job); |
628 Settings.setEffectful (#effectful job); | 634 Settings.setEffectful (#effectful job); |
635 Settings.setBenignEffectful (#benignEffectful job); | |
629 Settings.setClientOnly (#clientOnly job); | 636 Settings.setClientOnly (#clientOnly job); |
630 Settings.setServerOnly (#serverOnly job); | 637 Settings.setServerOnly (#serverOnly job); |
631 Settings.setJsFuncs (#jsFuncs job); | 638 Settings.setJsFuncs (#jsFuncs job); |
632 Settings.setRewriteRules (#rewrites job); | 639 Settings.setRewriteRules (#rewrites job); |
633 Settings.setUrlRules (#filterUrl job); | 640 Settings.setUrlRules (#filterUrl job); |