summaryrefslogtreecommitdiff
path: root/src/settings.sml
diff options
context:
space:
mode:
Diffstat (limited to 'src/settings.sml')
-rw-r--r--src/settings.sml65
1 files changed, 57 insertions, 8 deletions
diff --git a/src/settings.sml b/src/settings.sml
index 81c33c08..bd958e22 100644
--- a/src/settings.sml
+++ b/src/settings.sml
@@ -297,6 +297,8 @@ val jsFuncsBase = basisM [("alert", "alert"),
("mouseEvent", "uw_mouseEvent"),
("keyEvent", "uw_keyEvent"),
("minTime", "0"),
+ ("stringToBool_error", "s2be"),
+ ("stringToBool", "s2b"),
("islower", "isLower"),
("isupper", "isUpper"),
@@ -378,6 +380,22 @@ type rule = { action : action, kind : pattern_kind, pattern : string }
datatype path_kind = Any | Url | Table | Sequence | View | Relation | Cookie | Style
type rewrite = { pkind : path_kind, kind : pattern_kind, from : string, to : string, hyphenate : bool }
+fun pak2s pak =
+ case pak of
+ Exact => "Exact"
+ | Prefix => "Prefix"
+fun pk2s pk =
+ case pk of
+ Any => "Any"
+ | Url => "Url"
+ | Table => "Table"
+ | Sequence => "Sequence"
+ | View => "View"
+ | Relation => "Relation"
+ | Cookie => "Cookie"
+ | Style => "Style"
+fun r2s (r : rewrite) = pak2s (#kind r) ^ " " ^ pk2s (#pkind r) ^ ", from<" ^ #from r ^ ">, to<" ^ #to r ^ ">"
+
val rewrites = ref ([] : rewrite list)
fun subsume (pk1, pk2) =
@@ -726,15 +744,46 @@ fun capitalize s =
"" => ""
| _ => str (Char.toUpper (String.sub (s, 0))) ^ String.extract (s, 1, NONE)
+val allLower = CharVector.map Char.toLower
+
val mangle = ref true
fun setMangleSql x = mangle := x
-fun mangleSqlTable s = if !mangle then "uw_" ^ capitalize s
- else if #name (currentDbms ()) = "mysql" then capitalize s
- else lowercase s
-fun mangleSql s = if !mangle then "uw_" ^ s
- else if #name (currentDbms ()) = "mysql" then lowercase s
- else lowercase s
-fun mangleSqlCatalog s = if !mangle then "uw_" ^ s else lowercase s
+
+fun mangleSqlTable s =
+ if #name (currentDbms ()) = "mysql" then
+ if !mangle then
+ "uw_" ^ allLower s
+ else
+ allLower s
+ else
+ if !mangle then
+ "uw_" ^ capitalize s
+ else
+ lowercase s
+
+fun mangleSql s =
+ if #name (currentDbms ()) = "mysql" then
+ if !mangle then
+ "uw_" ^ allLower s
+ else
+ allLower s
+ else
+ if !mangle then
+ "uw_" ^ s
+ else
+ lowercase s
+
+fun mangleSqlCatalog s =
+ if #name (currentDbms ()) = "mysql" then
+ if !mangle then
+ "uw_" ^ allLower s
+ else
+ allLower s
+ else
+ if !mangle then
+ "uw_" ^ s
+ else
+ lowercase s
val html5 = ref false
fun setIsHtml5 b = html5 := b
@@ -822,7 +871,7 @@ fun setFilePath path = filePath := path
fun addFile {Uri, LoadFromFilename} =
let
- val path = OS.Path.joinDirFile {dir = !filePath, file = LoadFromFilename}
+ val path = OS.Path.mkAbsolute {relativeTo = !filePath, path = LoadFromFilename}
in
case SM.find (!files, Uri) of
SOME (path', _) =>