aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/demo.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-05-03 12:49:47 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-05-03 12:49:47 -0400
commitddac92a3d792b7e7342e4003862cd5ff5c1f0ab8 (patch)
tree2e285d15430f628b73456a233c5f3d79ea740307 /src/demo.sml
parent4be41963bba445bb3bb26d5e05883f7eb72a9a22 (diff)
upload demo
Diffstat (limited to 'src/demo.sml')
-rw-r--r--src/demo.sml26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/demo.sml b/src/demo.sml
index fb4158a4..a2312d98 100644
--- a/src/demo.sml
+++ b/src/demo.sml
@@ -363,6 +363,20 @@ fun make {prefix, dirname, guided} =
val fname = OS.Path.joinDirFile {dir = dirname,
file = "demo.urp"}
val outf = TextIO.openOut fname
+
+ fun filters kind =
+ app (fn rule : Settings.rule =>
+ (TextIO.output (outf, case #action rule of
+ Settings.Allow => "allow"
+ | Settings.Deny => "deny");
+ TextIO.output (outf, " ");
+ TextIO.output (outf, kind);
+ TextIO.output (outf, " ");
+ TextIO.output (outf, #pattern rule);
+ case #kind rule of
+ Settings.Exact => ()
+ | Settings.Prefix => TextIO.output (outf, "*");
+ TextIO.output (outf, "\n")))
in
Option.app (fn db => (TextIO.output (outf, "database ");
TextIO.output (outf, db);
@@ -391,16 +405,8 @@ fun make {prefix, dirname, guided} =
TextIO.output (outf, " ");
TextIO.output (outf, #to rule);
TextIO.output (outf, "\n"))) (#rewrites combined);
- app (fn rule =>
- (TextIO.output (outf, case #action rule of
- Settings.Allow => "allow"
- | Settings.Deny => "deny");
- TextIO.output (outf, " url ");
- TextIO.output (outf, #pattern rule);
- case #kind rule of
- Settings.Exact => ()
- | Settings.Prefix => TextIO.output (outf, "*");
- TextIO.output (outf, "\n"))) (#filterUrl combined);
+ filters "url" (#filterUrl combined);
+ filters "mime" (#filterMime combined);
TextIO.output (outf, "\n");
app (fn s =>