diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-05-03 12:49:47 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-05-03 12:49:47 -0400 |
commit | b6f2b2e7ae6d76ee5c88f2c4bb2cd4d74ee577ca (patch) | |
tree | 2e285d15430f628b73456a233c5f3d79ea740307 /src | |
parent | efb57925196e6a6384086497ad9966d6159ff09a (diff) |
upload demo
Diffstat (limited to 'src')
-rw-r--r-- | src/demo.sml | 26 |
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 => |