From 64169805c117326ccd9af8198cd16d581cc25c2d Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Fri, 6 Dec 2013 08:44:26 -0500 Subject: Add 'xhead' case to Monoize --- src/monoize.sml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/monoize.sml b/src/monoize.sml index 3df6ec92..228d22cd 100644 --- a/src/monoize.sml +++ b/src/monoize.sml @@ -215,6 +215,7 @@ fun monoType env = | L.CFfi ("Basis", "unit") => (L'.TRecord [], loc) | L.CFfi ("Basis", "page") => (L'.TFfi ("Basis", "string"), loc) + | L.CFfi ("Basis", "xhead") => (L'.TFfi ("Basis", "string"), loc) | L.CFfi ("Basis", "xbody") => (L'.TFfi ("Basis", "string"), loc) | L.CFfi ("Basis", "xtable") => (L'.TFfi ("Basis", "string"), loc) | L.CFfi ("Basis", "xtr") => (L'.TFfi ("Basis", "string"), loc) -- cgit v1.2.3 From 4800d8054ee97979a4706daa178127985957b016 Mon Sep 17 00:00:00 2001 From: Sergey Mironov Date: Wed, 6 Nov 2013 13:54:07 +0400 Subject: Add -print-cinlude command line option --- src/main.mlton.sml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.mlton.sml b/src/main.mlton.sml index d176efcc..e68ecdd8 100644 --- a/src/main.mlton.sml +++ b/src/main.mlton.sml @@ -58,6 +58,8 @@ fun oneRun args = raise Code OS.Process.success) fun printCCompiler () = (print ((Settings.getCCompiler ()) ^ "\n"); raise Code OS.Process.success) + fun printCInclude () = (print ((Config.includ) ^ "\n"); + raise Code OS.Process.success) fun doArgs args = case args of @@ -71,6 +73,8 @@ fun oneRun args = doArgs rest) | "-print-ccompiler" :: rest => printCCompiler () + | "-print-cinclude" :: rest => + printCInclude () | "-ccompiler" :: ccomp :: rest => (Settings.setCCompiler ccomp; doArgs rest) -- cgit v1.2.3 From eb64746b388cd3a3864e70039a0c04929b6bbd61 Mon Sep 17 00:00:00 2001 From: Sergey Mironov Date: Fri, 6 Dec 2013 13:59:39 +0400 Subject: Add activeHead tag. activeHead is similar to active but produces xhead instead of xbody --- lib/ur/basis.urs | 3 +++ src/monoize.sml | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/ur/basis.urs b/lib/ur/basis.urs index 4931c97a..7637f8fa 100644 --- a/lib/ur/basis.urs +++ b/lib/ur/basis.urs @@ -782,6 +782,9 @@ val dyn : ctx ::: {Unit} -> use ::: {Type} -> bind ::: {Type} -> [ctx ~ [Dyn]] = val active : unit -> tag [Code = transaction xbody] body [] [] [] +val activeHead : unit + -> tag [Code = transaction xhead] head [] [] [] + val head : unit -> tag [] html head [] [] val title : unit -> tag [] head [] [] [] val link : unit -> tag [Id = id, Rel = string, Typ = string, Href = url, Media = string] head [] [] [] diff --git a/src/monoize.sml b/src/monoize.sml index 3df6ec92..8889937e 100644 --- a/src/monoize.sml +++ b/src/monoize.sml @@ -3264,7 +3264,7 @@ fun monoExp (env, st, fm) (all as (e, loc)) = val (style, fm) = monoExp (env, st, fm) style val (dynStyle, fm) = monoExp (env, st, fm) dynStyle - val dynamics = ["dyn", "ctextbox", "ccheckbox", "cselect", "coption", "ctextarea", "active"] + val dynamics = ["dyn", "ctextbox", "ccheckbox", "cselect", "coption", "ctextarea", "active", "activeHead"] fun isSome (e, _) = case e of @@ -3600,6 +3600,16 @@ fun monoExp (env, st, fm) (all as (e, loc)) = fm) | _ => raise Fail "Monoize: Bad attributes") + | "activeHead" => + (case attrs of + [("Code", e, _)] => + ((L'.EStrcat + ((L'.EPrim (Prim.String ("")), loc)), loc)), loc), + fm) + | _ => raise Fail "Monoize: Bad attributes") + | "submit" => normal ("input type=\"submit\"", NONE) | "image" => normal ("input type=\"image\"", NONE) | "button" => normal ("input type=\"submit\"", NONE) -- cgit v1.2.3 From 0eee402a615c957f006c01d0424dae45713a9376 Mon Sep 17 00:00:00 2001 From: Sergey Mironov Date: Fri, 6 Dec 2013 14:52:47 +0400 Subject: activeHead: don't modify the head. just execute the code provided --- lib/ur/basis.urs | 2 +- src/monoize.sml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ur/basis.urs b/lib/ur/basis.urs index 7637f8fa..66e65804 100644 --- a/lib/ur/basis.urs +++ b/lib/ur/basis.urs @@ -783,7 +783,7 @@ val active : unit -> tag [Code = transaction xbody] body [] [] [] val activeHead : unit - -> tag [Code = transaction xhead] head [] [] [] + -> tag [Code = transaction unit] head [] [] [] val head : unit -> tag [] html head [] [] val title : unit -> tag [] head [] [] [] diff --git a/src/monoize.sml b/src/monoize.sml index 8889937e..d382194f 100644 --- a/src/monoize.sml +++ b/src/monoize.sml @@ -3604,9 +3604,9 @@ fun monoExp (env, st, fm) (all as (e, loc)) = (case attrs of [("Code", e, _)] => ((L'.EStrcat - ((L'.EPrim (Prim.String ("")), loc)), loc)), loc), + (L'.EPrim (Prim.String (")")), loc)), loc)), loc), fm) | _ => raise Fail "Monoize: Bad attributes") -- cgit v1.2.3 From 377d1b9ccdf923b6803dc63a66babd90f08ba3f7 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Fri, 6 Dec 2013 08:54:03 -0500 Subject: Small reformatting and documentation for '-print-cinclude' --- doc/manual.tex | 2 ++ src/main.mlton.sml | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/manual.tex b/doc/manual.tex index ac12c3b7..84af835f 100644 --- a/doc/manual.tex +++ b/doc/manual.tex @@ -275,6 +275,8 @@ sqlite3 path/to/database/file Date: Mon, 9 Dec 2013 15:47:14 -0500 Subject: Rename to }. + \subsubsection{Node IDs} There is an abstract type of node IDs that may be assigned to \cd{id} attributes of most HTML tags. diff --git a/lib/ur/basis.urs b/lib/ur/basis.urs index 66e65804..73cef3d2 100644 --- a/lib/ur/basis.urs +++ b/lib/ur/basis.urs @@ -782,7 +782,7 @@ val dyn : ctx ::: {Unit} -> use ::: {Type} -> bind ::: {Type} -> [ctx ~ [Dyn]] = val active : unit -> tag [Code = transaction xbody] body [] [] [] -val activeHead : unit +val script : unit -> tag [Code = transaction unit] head [] [] [] val head : unit -> tag [] html head [] [] diff --git a/src/monoize.sml b/src/monoize.sml index d382194f..291c0fa3 100644 --- a/src/monoize.sml +++ b/src/monoize.sml @@ -3264,7 +3264,7 @@ fun monoExp (env, st, fm) (all as (e, loc)) = val (style, fm) = monoExp (env, st, fm) style val (dynStyle, fm) = monoExp (env, st, fm) dynStyle - val dynamics = ["dyn", "ctextbox", "ccheckbox", "cselect", "coption", "ctextarea", "active", "activeHead"] + val dynamics = ["dyn", "ctextbox", "ccheckbox", "cselect", "coption", "ctextarea", "active", "script"] fun isSome (e, _) = case e of @@ -3600,15 +3600,15 @@ fun monoExp (env, st, fm) (all as (e, loc)) = fm) | _ => raise Fail "Monoize: Bad attributes") - | "activeHead" => + | "script" => (case attrs of [("Code", e, _)] => ((L'.EStrcat - ((L'.EPrim (Prim.String ("")), loc)), loc)), loc), + (L'.EPrim (Prim.String ("))")), loc)), loc)), loc), fm) - | _ => raise Fail "Monoize: Bad attributes") + | _ => raise Fail "Monoize: Bad