comparison src/demo.sml @ 774:412ccd97ab71

url demo
author Adam Chlipala <adamc@hcoop.net>
date Sun, 03 May 2009 12:24:39 -0400
parents 74a090ff296e
children 9f2555f06901
comparison
equal deleted inserted replaced
773:74a090ff296e 774:412ccd97ab71
102 clientToServer = [], 102 clientToServer = [],
103 effectful = [], 103 effectful = [],
104 clientOnly = [], 104 clientOnly = [],
105 serverOnly = [], 105 serverOnly = [],
106 jsFuncs = [], 106 jsFuncs = [],
107 rewrites = [], 107 rewrites = #rewrites combined @ #rewrites urp,
108 filterUrl = #filterUrl combined @ #filterUrl urp, 108 filterUrl = #filterUrl combined @ #filterUrl urp,
109 filterMime = #filterMime combined @ #filterMime urp 109 filterMime = #filterMime combined @ #filterMime urp
110 } 110 }
111 111
112 val parse = Compiler.run (Compiler.transform Compiler.parseUrp "Demo parseUrp") 112 val parse = Compiler.run (Compiler.transform Compiler.parseUrp "Demo parseUrp")
370 (#database combined); 370 (#database combined);
371 TextIO.output (outf, "sql demo.sql\n"); 371 TextIO.output (outf, "sql demo.sql\n");
372 TextIO.output (outf, "prefix "); 372 TextIO.output (outf, "prefix ");
373 TextIO.output (outf, prefix); 373 TextIO.output (outf, prefix);
374 TextIO.output (outf, "\n"); 374 TextIO.output (outf, "\n");
375 app (fn rule =>
376 (TextIO.output (outf, "rewrite ");
377 TextIO.output (outf, case #pkind rule of
378 Settings.Any => "any"
379 | Settings.Url => "url"
380 | Settings.Table => "table"
381 | Settings.Sequence => "sequence"
382 | Settings.View => "view"
383 | Settings.Relation => "relation"
384 | Settings.Cookie => "cookie"
385 | Settings.Style => "style");
386 TextIO.output (outf, " ");
387 TextIO.output (outf, #from rule);
388 case #kind rule of
389 Settings.Exact => ()
390 | Settings.Prefix => TextIO.output (outf, "*");
391 TextIO.output (outf, " ");
392 TextIO.output (outf, #to rule);
393 TextIO.output (outf, "\n"))) (#rewrites combined);
394 app (fn rule =>
395 (TextIO.output (outf, case #action rule of
396 Settings.Allow => "allow"
397 | Settings.Deny => "deny");
398 TextIO.output (outf, " url ");
399 TextIO.output (outf, #pattern rule);
400 case #kind rule of
401 Settings.Exact => ()
402 | Settings.Prefix => TextIO.output (outf, "*");
403 TextIO.output (outf, "\n"))) (#filterUrl combined);
375 TextIO.output (outf, "\n"); 404 TextIO.output (outf, "\n");
376 405
377 app (fn s => 406 app (fn s =>
378 let 407 let
379 val s = OS.Path.mkAbsolute {relativeTo = OS.FileSys.getDir (), 408 val s = OS.Path.mkAbsolute {relativeTo = OS.FileSys.getDir (),