Mercurial > urweb
comparison src/settings.sml @ 2096:6b7749da1ddc
Broaden handling of wildcard rewrites
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Wed, 24 Dec 2014 12:35:20 -0500 |
parents | ced78ef1c82f |
children | 9272476e2a1c |
comparison
equal
deleted
inserted
replaced
2095:d9f918b79b5a | 2096:6b7749da1ddc |
---|---|
376 type rule = { action : action, kind : pattern_kind, pattern : string } | 376 type rule = { action : action, kind : pattern_kind, pattern : string } |
377 | 377 |
378 datatype path_kind = Any | Url | Table | Sequence | View | Relation | Cookie | Style | 378 datatype path_kind = Any | Url | Table | Sequence | View | Relation | Cookie | Style |
379 type rewrite = { pkind : path_kind, kind : pattern_kind, from : string, to : string, hyphenate : bool } | 379 type rewrite = { pkind : path_kind, kind : pattern_kind, from : string, to : string, hyphenate : bool } |
380 | 380 |
381 fun pak2s pak = | |
382 case pak of | |
383 Exact => "Exact" | |
384 | Prefix => "Prefix" | |
385 fun pk2s pk = | |
386 case pk of | |
387 Any => "Any" | |
388 | Url => "Url" | |
389 | Table => "Table" | |
390 | Sequence => "Sequence" | |
391 | View => "View" | |
392 | Relation => "Relation" | |
393 | Cookie => "Cookie" | |
394 | Style => "Style" | |
395 fun r2s (r : rewrite) = pak2s (#kind r) ^ " " ^ pk2s (#pkind r) ^ ", from<" ^ #from r ^ ">, to<" ^ #to r ^ ">" | |
396 | |
381 val rewrites = ref ([] : rewrite list) | 397 val rewrites = ref ([] : rewrite list) |
382 | 398 |
383 fun subsume (pk1, pk2) = | 399 fun subsume (pk1, pk2) = |
384 pk1 = pk2 | 400 pk1 = pk2 |
385 orelse pk2 = Any | 401 orelse pk2 = Any |