Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: rsimoes/ATS-Lang
base: 37f53ca5be
...
head fork: rsimoes/ATS-Lang
compare: 377393f1d9
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 17 files changed
  • 0 commit comments
  • 1 contributor
View
110 libatsdoc/DATS/atsdoc_text.dats
@@ -80,6 +80,43 @@ macdef neof (i) = (,(i) != EOF)
(* ****** ****** *)
+datatype atext =
+//
+ | ATEXTnil of () // empty text
+//
+ | ATEXTstrcst of string // string constants
+ | ATEXTstrsub of string // strings containing marked tokens
+//
+ | ATEXTapptxt2 of (atext, atext) // text concatenation
+ | ATEXTappstr2 of (string, string) // string concatenation
+//
+ | ATEXTapptxt3 of (atext, atext, atext) // text concatenation
+ | ATEXTappstr3 of (string, string, string) // string concatenation
+//
+ | ATEXTconcatxt of atextlst // text concatenation
+ | ATEXTconcatxtsep of (atextlst, atext(*sep*)) // text concatenation with separator
+// end of [atext]
+
+where stringlst = List (string)
+
+(* ****** ****** *)
+
+assume atext_type = atext
+
+(* ****** ****** *)
+
+implement atext_nil () = ATEXTnil ()
+implement atext_strcst (x) = ATEXTstrcst (x)
+implement atext_strsub (x) = ATEXTstrsub (x)
+implement atext_apptxt2 (x1, x2) = ATEXTapptxt2 (x1, x2)
+implement atext_appstr2 (x1, x2) = ATEXTappstr2 (x1, x2)
+implement atext_apptxt3 (x1, x2, x3) = ATEXTapptxt3 (x1, x2, x3)
+implement atext_appstr3 (x1, x2, x3) = ATEXTappstr3 (x1, x2, x3)
+implement atext_concatxt (xs) = ATEXTconcatxt (xs)
+implement atext_concatxtsep (xs, sep) = ATEXTconcatxtsep (xs, sep)
+
+(* ****** ****** *)
+
local
staload
@@ -233,12 +270,12 @@ in
val _err = fclose_err (filr)
in
if strptr_isnot_null (res) then
- TEXTstrcst ((string_of_strptr)res)
+ ATEXTstrcst ((string_of_strptr)res)
else let
- val () = strptr_free (res) in TEXTnil ()
+ val () = strptr_free (res) in ATEXTnil ()
end (* end of [if] *)
end else let
- prval None_v () = pfopt in TEXTnil ()
+ prval None_v () = pfopt in ATEXTnil ()
end (* end of [if] *)
end // end of [filename2text]
@@ -259,7 +296,7 @@ if strptr_isnot_null (path) then let
in
text
end else let
- val _null = strptr_free_null (path) in TEXTnil ()
+ val _null = strptr_free_null (path) in ATEXTnil ()
end // end of [if]
//
end // end of [atscode2xml_strcode]
@@ -341,12 +378,12 @@ if fd >= 0 then let
val () = strptr_free (tmp)
in
if strptr_isnot_null (res) then let
- val res = string_of_strptr (res) in TEXTstrcst (res)
+ val res = string_of_strptr (res) in ATEXTstrcst (res)
end else let
- val () = strptr_free (res) in TEXTnil ()
+ val () = strptr_free (res) in ATEXTnil ()
end // end of [if]
end else let
- prval $F.open_v_fail () = pfopt; val () = strptr_free (tmp) in TEXTnil ()
+ prval $F.open_v_fail () = pfopt; val () = strptr_free (tmp) in ATEXTnil ()
end // end of [if]
//
end // end of [atscode2xml_filcode]
@@ -381,10 +418,10 @@ atscc_posmark_html_body_exec (
local
viewtypedef
-textmap = symmap (text)
+atextmap = symmap (atext)
val map0 = symmap_make_nil ()
-val theTextMap = ref<textmap> (map0)
+val theTextMap = ref<atextmap> (map0)
in // in of [local]
@@ -412,51 +449,54 @@ end // end of [local]
(* ****** ****** *)
implement
-fprint_text (out, x) =
+fprint_atext (out, x) =
case+ x of
//
- | TEXTnil () => ()
+ | ATEXTnil () => ()
//
- | TEXTstrcst (str) => fprint_string (out, str)
- | TEXTstrsub (sub) => fprint_strsub (out, sub)
+ | ATEXTstrcst (str) => fprint_string (out, str)
+ | ATEXTstrsub (sub) => fprint_strsub (out, sub)
//
- | TEXTapptxt2 (x1, x2) => {
- val () = fprint_text (out, x1)
- val () = fprint_text (out, x2)
+ | ATEXTapptxt2 (x1, x2) => {
+ val () = fprint_atext (out, x1)
+ val () = fprint_atext (out, x2)
}
- | TEXTappstr2 (x1, x2) => {
+ | ATEXTappstr2 (x1, x2) => {
val () = fprint_string (out, x1)
val () = fprint_string (out, x2)
}
//
- | TEXTapptxt3 (x1, x2, x3) => {
- val () = fprint_text (out, x1)
- val () = fprint_text (out, x2)
- val () = fprint_text (out, x3)
+ | ATEXTapptxt3 (x1, x2, x3) => {
+ val () = fprint_atext (out, x1)
+ val () = fprint_atext (out, x2)
+ val () = fprint_atext (out, x3)
}
- | TEXTappstr3 (x1, x2, x3) => {
+ | ATEXTappstr3 (x1, x2, x3) => {
val () = fprint_string (out, x1)
val () = fprint_string (out, x2)
val () = fprint_string (out, x3)
}
//
- | TEXTcontxt (xs) => fprint_textlst (out, xs)
- | TEXTcontxtsep (xs, sep) => fprint_textlst_sep (out, xs, sep)
+ | ATEXTconcatxt (xs) => fprint_atextlst (out, xs)
+ | ATEXTconcatxtsep (xs, sep) => fprint_atextlst_sep (out, xs, sep)
//
-(* end of [fprint_text] *)
+(* end of [fprint_atext] *)
implement
-fprint_textlst (out, xs) =
- list_app_cloptr<text> (xs, lam (x) =<1> fprint_text (out, x))
-// end of [fprint_textlst]
+fprint_atextlst (out, xs) =
+ list_app_cloptr<atext> (xs, lam (x) =<1> fprint_atext (out, x))
+// end of [fprint_atextlst]
implement
-fprint_textlst_sep (out, xs, sep) = let
- fun loop (xs: textlst, i: int):<cloref1> void =
+fprint_atextlst_sep
+ (out, xs, sep) = let
+ fun loop (
+ xs: atextlst, i: int
+ ) :<cloref1> void =
case+ xs of
| list_cons (x, xs) => let
- val () = if i > 0 then fprint_text (out, sep)
- val () = fprint_text (out, x)
+ val () = if i > 0 then fprint_atext (out, sep)
+ val () = fprint_atext (out, x)
in
loop (xs, i+1)
end // end of [list_cons]
@@ -464,7 +504,7 @@ fprint_textlst_sep (out, xs, sep) = let
// end of [loop]
in
loop (xs, 0)
-end // end of [fprint_textlst]
+end // end of [fprint_atextlst]
(* ****** ****** *)
@@ -536,7 +576,7 @@ in
val sym = symbol_make_string (id)
val ans = theTextMap_search (sym)
val () = (case+ ans of
- | ~Some_vt xt => fprint_text (out, xt)
+ | ~Some_vt xt => fprint_atext (out, xt)
| ~None_vt () => fprintf (out, "#%s$", @(id))
) // end of [val]
//
@@ -666,7 +706,7 @@ in
// nothing
end // end of [if]
//
-end // end of [
+end // end of [fprint_filsub]
(* ****** ****** *)
View
54 libatsdoc/SATS/atsdoc_text.sats
@@ -40,48 +40,42 @@ typedef symbol = $SYM.symbol
(* ****** ****** *)
-datatype text =
-//
- | TEXTnil of () // empty text
-//
- | TEXTstrcst of string // string constants
- | TEXTstrsub of string // strings containing marked tokens
-//
- | TEXTapptxt2 of (text, text) // text concatenation
- | TEXTappstr2 of (string, string) // string concatenation
-//
- | TEXTapptxt3 of (text, text, text) // text concatenation
- | TEXTappstr3 of (string, string, string) // string concatenation
-//
- | TEXTcontxt of textlst // text concatenation
- | TEXTcontxtsep of (textlst, text(*sep*)) // text concatenation with separator
-// end of [text]
+abstype atext_type
+typedef atext = atext_type
+typedef atextlst = List (atext)
+
+(* ****** ****** *)
-where
-textlst = List (text)
-and
-stringlst = List (string)
+fun atext_nil (): atext
+fun atext_strcst (x: string): atext
+fun atext_strsub (x: string): atext
+fun atext_apptxt2 (x1: atext, x2: atext): atext
+fun atext_appstr2 (x1: string, x2: string): atext
+fun atext_apptxt3 (x1: atext, x2: atext, x3: atext): atext
+fun atext_appstr3 (x1: string, x2: string, x3: string): atext
+fun atext_concatxt (xs: atextlst): atext
+fun atext_concatxtsep (xs: atextlst, sep: atext): atext
(* ****** ****** *)
-fun filename2text (path: string): text
+fun filename2text (path: string): atext
(* ****** ****** *)
-fun atscode2xml_strcode (stadyn: int, code: string): text
-fun atscode2xml_filcode (stadyn: int, path: string): text
+fun atscode2xml_strcode (stadyn: int, code: string): atext
+fun atscode2xml_filcode (stadyn: int, path: string): atext
(* ****** ****** *)
-fun theTextMap_search (s: symbol): Option_vt (text)
-fun theTextMap_insert (s: symbol, txt: text): void
-fun theTextMap_insert_str (s: string, txt: text): void
+fun theTextMap_search (s: symbol): Option_vt (atext)
+fun theTextMap_insert (s: symbol, txt: atext): void
+fun theTextMap_insert_str (s: string, txt: atext): void
(* ****** ****** *)
-fun fprint_text (out: FILEref, x: text): void
-fun fprint_textlst (out: FILEref, xs: textlst): void
-fun fprint_textlst_sep (out: FILEref, xs: textlst, sep: text): void
+fun fprint_atext (out: FILEref, x: atext): void
+fun fprint_atextlst (out: FILEref, xs: atextlst): void
+fun fprint_atextlst_sep (out: FILEref, xs: atextlst, sep: atext): void
(* ****** ****** *)
@@ -101,4 +95,4 @@ fun tostring_strsub (sub: string): strptr0 // HX: nullptr means error
(* ****** ****** *)
-(* end of [atsdoc_text.sats] *)
+(* end of [atsdoc_atext.sats] *)
View
34 utils/atsdoc/DOCUMENT/TUTORIALATS/tutorialatxt.dats
@@ -27,11 +27,11 @@ macdef filename(x) =
macdef LI (x) = xmltagging ("listitem", ,(x))
//
fun itemizedlist
- (xs: textlst): text = let
- val opn = TEXTstrcst "<itemizedlist>\n"
- val cls = TEXTstrcst "\n</itemizedlist>"
+ (xs: atextlst): atext = let
+ val opn = atext_strcst "<itemizedlist>\n"
+ val cls = atext_strcst "\n</itemizedlist>"
in
- TEXTapptxt3 (opn, TEXTcontxtsep (xs, TEXTnewline), cls)
+ atext_apptxt3 (opn, atext_concatxtsep (xs, atext_newline), cls)
end
//
(* ****** ****** *)
@@ -45,59 +45,59 @@ end
fun mydoclink (
path: string, linkname: string
-) : text = let
+) : atext = let
val res = sprintf (
"<ulink url=\"%s/TUTORIALATS/%s\">%s</ulink>", @(MYDOCROOT, path, linkname)
) // end of [val]
val res = string_of_strptr (res)
in
- TEXTstrcst (res)
+ atext_strcst (res)
end // end of [mydoclink]
fun mycodelink (
path: string, linkname: string
-) : text = let
+) : atext = let
val res = sprintf (
"<ulink url=\"%s/TUTORIALATS/CODE/%s\">%s</ulink>", @(MYDOCROOT, path, linkname)
) // end of [val]
val res = string_of_strptr (res)
in
- TEXTstrcst (res)
+ atext_strcst (res)
end // end of [mydoclink]
fun myatsdoclink (
path: string, linkname: string
-) : text = let
+) : atext = let
val res = sprintf (
"<ulink url=\"%s/ANAIRIATS/%s\">%s</ulink>", @(MYDOCROOT, path, linkname)
) // end of [val]
val res = string_of_strptr (res)
in
- TEXTstrcst (res)
+ atext_strcst (res)
end // end of [myatsdoclink]
(* ****** ****** *)
local
-val theCodeLst = ref<textlst> (list_nil)
+val theCodeLst = ref<atextlst> (list_nil)
in // in of [local]
-fun theCodeLst_add (x: text) =
+fun theCodeLst_add (x: atext) =
!theCodeLst := list_cons (x, !theCodeLst)
-fun theCodeLst_get (): textlst = let
+fun theCodeLst_get (): atextlst = let
val xs = list_reverse (!theCodeLst) in list_of_list_vt (xs)
end // end of [theCodeLst_get]
fun fprint_theCodeLst
(out: FILEref): void = let
- fun loop (xs: textlst, i: int):<cloref1> void =
+ fun loop (xs: atextlst, i: int):<cloref1> void =
case+ xs of
| list_cons (x, xs) => let
val () = if i > 0 then fprint_newline (out)
- val () = fprint_text (out, x)
+ val () = fprint_atext (out, x)
in
loop (xs, i+1)
end // end of [list_cons]
@@ -111,8 +111,8 @@ end // end of [local]
(* ****** ****** *)
fn atscode_extract
- (x: string): text = let
- val () = theCodeLst_add (TEXTstrcst (x)) in atscode (x)
+ (x: string): atext = let
+ val () = theCodeLst_add (atext_strcst (x)) in atscode (x)
end // end of [atscode_extract]
(* ****** ****** *)
View
90 utils/atsdoc/DOCUMENT/atsdocman/atsdocman.atxt
@@ -19,16 +19,16 @@ val LT = "<"
val LTSLASH = "</"
val GT = ">"
-val COMMENTopn = TEXTstrcst"<!--"
-and COMMENTcls = TEXTstrcst("-->")
+val COMMENTopn = atext_strcst"<!--"
+and COMMENTcls = atext_strcst("-->")
fun xmltagging (
tag: string, x: string
-) : text = let
- val _opn = TEXTappstr3 (LT, tag, GT)
- val _cls = TEXTappstr3 (LTSLASH, tag, GT)
+) : atext = let
+ val _opn = atext_appstr3 (LT, tag, GT)
+ val _cls = atext_appstr3 (LTSLASH, tag, GT)
in
- TEXTapptxt3 (_opn, TEXTstrsub(x), _cls)
+ atext_apptxt3 (_opn, atext_strsub(x), _cls)
end // end of [xmltagging]
macdef para (x) = xmltagging ("P", ,(x)) // paragraph
@@ -40,14 +40,14 @@ macdef emph (x) = xmltagging ("I", ,(x)) // italic
local
val _opn =
- TEXTstrcst"<PRE class=\"textpre\">"
-val _cls = TEXTstrcst"</PRE>"
+ atext_strcst"<PRE class=\"textpre\">"
+val _cls = atext_strcst"</PRE>"
in // in of [local]
fn textpre
- (x: string): text =
- TEXTapptxt3 (_opn, TEXTstrsub(x), _cls)
+ (x: string): atext =
+ atext_apptxt3 (_opn, atext_strsub(x), _cls)
// end of [textpre]
end // end of [local]
@@ -57,23 +57,23 @@ end // end of [local]
local
val _opn =
- TEXTstrcst"<span class=\"code\">"
-val _cls = TEXTstrcst"</span>"
+ atext_strcst"<span class=\"code\">"
+val _cls = atext_strcst"</span>"
in // in of [local]
-fn code (x: string): text =
- TEXTapptxt3 (_opn, TEXTstrsub(x), _cls)
+fn code (x: string): atext =
+ atext_apptxt3 (_opn, atext_strsub(x), _cls)
// end of [code]
end // end of [local]
(* ****** ****** *)
-fun ignore (x: string): text = TEXTnil ()
+fun ignore (x: string): atext = atext_nil ()
-fun comment (x: string): text =
- TEXTapptxt3 (COMMENTopn, TEXTstrsub(x), COMMENTcls)
+fun comment (x: string): atext =
+ atext_apptxt3 (COMMENTopn, atext_strsub(x), COMMENTcls)
// end of [comment]
fun sub2str
@@ -86,42 +86,42 @@ in
end (* end of [if] *)
end // end of [sub2str]
-fun atscode2xmls (x: string): text = atscode2xml_strcode (0, x)
-fun atscode2xmld (x: string): text = atscode2xml_strcode (1, x)
+fun atscode2xmls (x: string): atext = atscode2xml_strcode (0, x)
+fun atscode2xmld (x: string): atext = atscode2xml_strcode (1, x)
-fun atscode2xmlss (x: string): text = atscode2xml_strcode (0, sub2str x)
-fun atscode2xmldd (x: string): text = atscode2xml_strcode (1, sub2str x)
+fun atscode2xmlss (x: string): atext = atscode2xml_strcode (0, sub2str x)
+fun atscode2xmldd (x: string): atext = atscode2xml_strcode (1, sub2str x)
-fun DQ () = TEXTstrcst ("\"")
+fun DQ () = atext_strcst ("\"")
-fun copy (x: string): text = TEXTstrcst (x)
+fun copy (x: string): atext = atext_strcst (x)
-fun atslink (): text =
- TEXTstrcst "<a href=\"http://www.ats-lang.org/\">ATS</a>"
+fun atslink (): atext =
+ atext_strcst "<a href=\"http://www.ats-lang.org/\">ATS</a>"
// end of [atslink]
#define MYDOCROOT "http://www.ats-lang.org/DOCUMENT"
fun mydoclink (
codepath: string, linkname: string
-) : text = let
+) : atext = let
val res = sprintf (
"<a href=\"%s/atsdocman/%s\">%s</a>", @(MYDOCROOT, codepath, linkname)
) // end of [val]
val res = string_of_strptr (res)
in
- TEXTstrcst (res)
+ atext_strcst (res)
end // end of [mydoclink]
fun myatsdoclink (
codepath: string, linkname: string
-) : text = let
+) : atext = let
val res = sprintf (
"<a href=\"%s/ANAIRIATS/%s\">%s</a>", @(MYDOCROOT, codepath, linkname)
) // end of [val]
val res = string_of_strptr (res)
in
- TEXTstrcst (res)
+ atext_strcst (res)
end // end of [myatsdoclink]
macdef filename(x) = xmltagging ("I", ,(x)) // italic
@@ -157,10 +157,10 @@ macdef filename(x) = xmltagging ("I", ,(x)) // italic
<body>
%{
-fun HR (sz: int): text = let
+fun HR (sz: int): atext = let
val res = sprintf ("<HR SIZE=%i ALIGN=LEFT></HR>", @(sz))
in
- TEXTstrcst (string_of_strptr (res))
+ atext_strcst (string_of_strptr (res))
end // end of [HR]
%}
@@ -299,7 +299,7 @@ staload "libatsdoc/SATS/atsdoc_text.sats"
%}
%{
-fn author () = TEXTstrcst"John Doe"
+fn author () = atext_strcst"John Doe"
%}
%{
@@ -308,14 +308,14 @@ UN = "prelude/SATS/unsafe.sats"
staload TIME = "libc/SATS/time.sats"
fn timestamp
- (): text = let
+ (): atext = let
var time = $TIME.time_get ()
val (fpf | x) = $TIME.ctime (time)
val x1 = sprintf ("%s", @($UN.castvwtp1(x)))
prval () = fpf (x)
val x1 = string_of_strptr (x1)
in
- TEXTstrcst (x1)
+ atext_strcst (x1)
end // end of [val]
%}
@@ -368,19 +368,19 @@ follows:
#atscode2xmls("\
datatype text =
//
- | TEXTstrcst of string // string constants
- | TEXTstrsub of string // strings containing marked tokens
+ | ATEXTnil of () // empty text
//
- | TEXTapptxt2 of (text, text) // text concatenation
- | TEXTappstr2 of (string, string) // string concatenation
+ | ATEXTstrcst of string // string constants
+ | ATEXTstrsub of string // strings containing marked tokens
//
- | TEXTapptxt3 of (text, text, text) // text concatenation
- | TEXTappstr3 of (string, string, string) // string concatenation
+ | ATEXTapptxt2 of (text, text) // text concatenation
+ | ATEXTappstr2 of (string, string) // string concatenation
//
- | TEXTnil of () // empty text
+ | ATEXTapptxt3 of (text, text, text) // text concatenation
+ | ATEXTappstr3 of (string, string, string) // string concatenation
//
- | TEXTcontxt of textlst // text concatenation
- | TEXTcontxtsep of (textlst, text(*sep*)) // text concat with separator
+ | ATEXTconcatxt of textlst // text concatenation
+ | ATEXTconcatxtsep of (textlst, text(*sep*)) // text concatenation with separator
// end of [text]
where
@@ -390,10 +390,10 @@ stringlst = List (string)
")#comment("atscode2xmls")
The meaning of all the data constructors associated with the datatype
-#code("text") should be easily understood except #code("TEXTstrsub"), which
+#code("text") should be easily understood except #code("ATEXTstrsub"), which
indicates that its (string) argument may contain marked tokens, that is,
symbols formed by placing identifiers between the two characters '\\\#' and
-'$'. When stringizing a value of the form #code("TEXTstrsub")(str) for some
+'$'. When stringizing a value of the form #code("ATEXTstrsub")(str) for some
string str, we must replace each marked token in str with the string it
represents. For further details, please see the implementation of
#code("fprint_strsub") in
View
6 utils/atsdoc/DOCUMENT/atslangweb/atslangweb_community.atxt
@@ -8,7 +8,7 @@ staload STDIO = "libc/SATS/stdio.sats"
//
#include "atslangwebatxt.dats"
//
-val _ATSLANGWEBCOMMUNITY: text =
+val _ATSLANGWEBCOMMUNITY: atext =
strcst"<strong>Community</strong>"
val () = theTextMap_insert_str ("ATSLANGWEBCOMMUNITY", _ATSLANGWEBCOMMUNITY)
//
@@ -25,8 +25,8 @@ val () = fprintf (theCSSfilr,
) // end of [val]
fun addcssrule
- (rule: string): text = let
- val () = fprint_string (theCSSfilr, rule) in TEXTnil ()
+ (rule: string): atext = let
+ val () = fprint_string (theCSSfilr, rule) in atext_nil ()
end // end of [addcssrule]
(* ****** ****** *)
View
6 utils/atsdoc/DOCUMENT/atslangweb/atslangweb_document.atxt
@@ -8,7 +8,7 @@ staload STDIO = "libc/SATS/stdio.sats"
//
#include "atslangwebatxt.dats"
//
-val _ATSLANGWEBDOCUMENT: text =
+val _ATSLANGWEBDOCUMENT: atext =
strcst"<strong>Documentation</strong>"
val () = theTextMap_insert_str ("ATSLANGWEBDOCUMENT", _ATSLANGWEBDOCUMENT)
//
@@ -25,8 +25,8 @@ val () = fprintf (theCSSfilr,
) // end of [val]
fun addcssrule
- (rule: string): text = let
- val () = fprint_string (theCSSfilr, rule) in TEXTnil ()
+ (rule: string): atext = let
+ val () = fprint_string (theCSSfilr, rule) in atext_nil ()
end // end of [addcssrule]
(* ****** ****** *)
View
6 utils/atsdoc/DOCUMENT/atslangweb/atslangweb_download.atxt
@@ -8,7 +8,7 @@ staload STDIO = "libc/SATS/stdio.sats"
//
#include "atslangwebatxt.dats"
//
-val _ATSLANGWEBDOWNLOAD: text =
+val _ATSLANGWEBDOWNLOAD: atext =
strcst"<strong>Download</strong>"
val () = theTextMap_insert_str ("ATSLANGWEBDOWNLOAD", _ATSLANGWEBDOWNLOAD)
//
@@ -25,8 +25,8 @@ val () = fprintf (theCSSfilr,
) // end of [val]
fun addcssrule
- (rule: string): text = let
- val () = fprint_string (theCSSfilr, rule) in TEXTnil ()
+ (rule: string): atext = let
+ val () = fprint_string (theCSSfilr, rule) in atext_nil ()
end // end of [addcssrule]
(* ****** ****** *)
View
6 utils/atsdoc/DOCUMENT/atslangweb/atslangweb_example.atxt
@@ -8,7 +8,7 @@ staload STDIO = "libc/SATS/stdio.sats"
//
#include "atslangwebatxt.dats"
//
-val _ATSLANGWEBEXAMPLE: text =
+val _ATSLANGWEBEXAMPLE: atext =
strcst"<strong>Examples</strong>"
val () = theTextMap_insert_str ("ATSLANGWEBEXAMPLE", _ATSLANGWEBEXAMPLE)
//
@@ -25,8 +25,8 @@ val () = fprintf (theCSSfilr,
) // end of [val]
fun addcssrule
- (rule: string): text = let
- val () = fprint_string (theCSSfilr, rule) in TEXTnil ()
+ (rule: string): atext = let
+ val () = fprint_string (theCSSfilr, rule) in atext_nil ()
end // end of [addcssrule]
(* ****** ****** *)
View
6 utils/atsdoc/DOCUMENT/atslangweb/atslangweb_home.atxt
@@ -8,7 +8,7 @@ staload STDIO = "libc/SATS/stdio.sats"
//
#include "atslangwebatxt.dats"
//
-val _ATSLANGWEBHOME: text =
+val _ATSLANGWEBHOME: atext =
strcst"<strong>Home</strong>"
val () = theTextMap_insert_str ("ATSLANGWEBHOME", _ATSLANGWEBHOME)
//
@@ -25,8 +25,8 @@ val () = fprintf (theCSSfilr,
) // end of [val]
fun addcssrule
- (rule: string): text = let
- val () = fprint_string (theCSSfilr, rule) in TEXTnil ()
+ (rule: string): atext = let
+ val () = fprint_string (theCSSfilr, rule) in atext_nil ()
end // end of [addcssrule]
(* ****** ****** *)
View
8 utils/atsdoc/DOCUMENT/atslangweb/atslangweb_implement.atxt
@@ -8,7 +8,7 @@ staload STDIO = "libc/SATS/stdio.sats"
//
#include "atslangwebatxt.dats"
//
-val _ATSLANGWEBIMPLEMENT: text =
+val _ATSLANGWEBIMPLEMENT: atext =
strcst"<strong>Implementations</strong>"
val () = theTextMap_insert_str ("ATSLANGWEBIMPLEMENT", _ATSLANGWEBIMPLEMENT)
//
@@ -25,13 +25,13 @@ val () = fprintf (theCSSfilr,
) // end of [val]
fun addcssrule
- (rule: string): text = let
- val () = fprint_string (theCSSfilr, rule) in TEXTnil ()
+ (rule: string): atext = let
+ val () = fprint_string (theCSSfilr, rule) in atext_nil ()
end // end of [addcssrule]
(* ****** ****** *)
-fn OCaml (): text = ulink("http://caml.inria.fr/ocaml", "OCaml")
+fn OCaml (): atext = ulink("http://caml.inria.fr/ocaml", "OCaml")
(* ****** ****** *)
//
View
6 utils/atsdoc/DOCUMENT/atslangweb/atslangweb_library.atxt
@@ -8,7 +8,7 @@ staload STDIO = "libc/SATS/stdio.sats"
//
#include "atslangwebatxt.dats"
//
-val _ATSLANGWEBLIBRARY: text =
+val _ATSLANGWEBLIBRARY: atext =
strcst"<strong>Libraries</strong>"
val () = theTextMap_insert_str ("ATSLANGWEBLIBRARY", _ATSLANGWEBLIBRARY)
//
@@ -25,8 +25,8 @@ val () = fprintf (theCSSfilr,
) // end of [val]
fun addcssrule
- (rule: string): text = let
- val () = fprint_string (theCSSfilr, rule) in TEXTnil ()
+ (rule: string): atext = let
+ val () = fprint_string (theCSSfilr, rule) in atext_nil ()
end // end of [addcssrule]
(* ****** ****** *)
View
6 utils/atsdoc/DOCUMENT/atslangweb/atslangweb_paper.atxt
@@ -8,7 +8,7 @@ staload STDIO = "libc/SATS/stdio.sats"
//
#include "atslangwebatxt.dats"
//
-val _ATSLANGWEBPAPER: text =
+val _ATSLANGWEBPAPER: atext =
strcst"<strong>Papers</strong>"
val () = theTextMap_insert_str ("ATSLANGWEBPAPER", _ATSLANGWEBPAPER)
//
@@ -25,8 +25,8 @@ val () = fprintf (theCSSfilr,
) // end of [val]
fun addcssrule
- (rule: string): text = let
- val () = fprint_string (theCSSfilr, rule) in TEXTnil ()
+ (rule: string): atext = let
+ val () = fprint_string (theCSSfilr, rule) in atext_nil ()
end // end of [addcssrule]
(* ****** ****** *)
View
6 utils/atsdoc/DOCUMENT/atslangweb/atslangweb_resource.atxt
@@ -8,7 +8,7 @@ staload STDIO = "libc/SATS/stdio.sats"
//
#include "atslangwebatxt.dats"
//
-val _ATSLANGWEBRESOURCE: text =
+val _ATSLANGWEBRESOURCE: atext =
strcst"<strong>Resources</strong>"
val () = theTextMap_insert_str ("ATSLANGWEBRESOURCE", _ATSLANGWEBRESOURCE)
//
@@ -25,8 +25,8 @@ val () = fprintf (theCSSfilr,
) // end of [val]
fun addcssrule
- (rule: string): text = let
- val () = fprint_string (theCSSfilr, rule) in TEXTnil ()
+ (rule: string): atext = let
+ val () = fprint_string (theCSSfilr, rule) in atext_nil ()
end // end of [addcssrule]
(* ****** ****** *)
View
12 utils/atsdoc/DOCUMENT/atslangweb/atslangweb_temp.atxt
@@ -21,12 +21,12 @@ val theCSSfilr = $STDIO.fopen_ref_exn
val () = fprint_webox_css_all (theCSSfilr, theBodyProp)
//
fun addcssrule
- (rule: string): text = let
- val () = fprint_string (theCSSfilr, rule) in TEXTnil ()
+ (rule: string): atext = let
+ val () = fprint_string (theCSSfilr, rule) in atext_nil ()
end // end of [addcssrule]
fun addcssrule_strsub
- (rule: string): text = let
- val () = fprint_strsub (theCSSfilr, rule) in TEXTnil ()
+ (rule: string): atext = let
+ val () = fprint_strsub (theCSSfilr, rule) in atext_nil ()
end // end of [addcssrule_strsub]
//
(* ****** ****** *)
@@ -245,13 +245,13 @@ local
*)
in
//
-fun theBodyText (): text = let
+fun theBodyText (): atext = let
val res = tostring_fprint<webox>
("atslangweb_theBodyText", fprint_webox_html, theBodyProp)
val () = assert (strptr_isnot_null res)
val res = string_of_strptr (res)
in
- TEXTstrsub (res)
+ atext_strsub (res)
end (* theBodyText *)
//
end // end of [local]
View
63 utils/atsdoc/DOCUMENT/atslangweb/atslangwebatxt.dats
@@ -28,35 +28,36 @@ staload _(*anon*) = "libatsdoc/DATS/atsdoc_text.dats"
(* ****** ****** *)
//
-macdef strcst (x) = TEXTstrcst ,(x)
-macdef strsub (x) = TEXTstrsub ,(x)
+macdef strcst (x) = atext_strcst ,(x)
+macdef strsub (x) = atext_strsub ,(x)
//
-fun strcst_of_strptr (x: strptr1): text = TEXTstrcst ((s2s)x)
-fun strsub_of_strptr (x: strptr1): text = TEXTstrsub ((s2s)x)
+fun strcst_of_strptr (x: strptr1): atext = atext_strcst ((s2s)x)
+fun strsub_of_strptr (x: strptr1): atext = atext_strsub ((s2s)x)
//
(* ****** ****** *)
macdef command(x) = xmltagging ("pre", ,(x)) // <pre> ... </pre>
-fn filename (x: string): text = let
+fn filename
+ (x: string): atext = let
val opn = strcst"<span style=\"text-decoration: underline;\">"
val cls = strcst"</span>"
in
- TEXTapptxt3 (opn, strsub(x), cls)
-end
+ atext_apptxt3 (opn, strsub(x), cls)
+end // end of [filename]
(* ****** ****** *)
fn menu
- (itmlst: string): text = xmltagging ("ul", itmlst)
+ (itmlst: string): atext = xmltagging ("ul", itmlst)
// end of [menu]
fn lisub
- (x: string): text = xmltagging ("li", x)
+ (x: string): atext = xmltagging ("li", x)
// end of [lisub]
-fn litxt (x: text): text =
- TEXTapptxt3 (strcst"<li>", x, strcst"</li>")
+fn litxt (x: atext): atext =
+ atext_apptxt3 (strcst"<li>", x, strcst"</li>")
// end of [litxt]
(* ****** ****** *)
@@ -67,15 +68,15 @@ fn HR (sz: int) =
(* ****** ****** *)
-fun uid (id: string, name: string): text =
+fun uid (id: string, name: string): atext =
strcst_of_strptr (sprintf ("<a id=\"%s\">%s</a>", @(id, name)))
// end of [uid]
-fun ulink (link: string, name: string): text =
+fun ulink (link: string, name: string): atext =
strcst_of_strptr (sprintf ("<a href=\"%s\">%s</a>", @(link, name)))
// end of [ulink]
-fun ulink1 (link: string, name: string): text =
+fun ulink1 (link: string, name: string): atext =
strsub_of_strptr (sprintf ("<a href=\"%s\">%s</a>", @(link, name)))
// end of [ulink1]
@@ -85,37 +86,37 @@ fun ulink1 (link: string, name: string): text =
"http://ats-lang.svn.sourceforge.net/svnroot/ats-lang/trunk"
// end of [#define]
-fun ATSLANGSVNROOTget (): text = TEXTstrcst (ATSLANGSVNROOT)
+fun ATSLANGSVNROOTget (): atext = atext_strcst (ATSLANGSVNROOT)
(* ****** ****** *)
-fun ATSLANGWEBROOTget (): text = TEXTstrcst (ATSLANGWEBROOT)
+fun ATSLANGWEBROOTget (): atext = atext_strcst (ATSLANGWEBROOT)
-val ATSLANGWEBHOME: text = strcst ((s2s)res) where {
+val ATSLANGWEBHOME: atext = strcst ((s2s)res) where {
val res = sprintf ("<a href=\"%s/\">Home</a>", @(ATSLANGWEBROOT))
}
-val ATSLANGWEBDOWNLOAD: text = strcst ((s2s)res) where {
+val ATSLANGWEBDOWNLOAD: atext = strcst ((s2s)res) where {
val res = sprintf ("<a href=\"%s/DOWNLOAD/\">Download</a>", @(ATSLANGWEBROOT))
}
-val ATSLANGWEBDOCUMENT: text = strcst ((s2s)res) where {
+val ATSLANGWEBDOCUMENT: atext = strcst ((s2s)res) where {
val res = sprintf ("<a href=\"%s/DOCUMENT/\">Documentation</a>", @(ATSLANGWEBROOT))
}
-val ATSLANGWEBLIBRARY: text = strcst ((s2s)res) where {
+val ATSLANGWEBLIBRARY: atext = strcst ((s2s)res) where {
val res = sprintf ("<a href=\"%s/LIBRARY/\">Libraries</a>", @(ATSLANGWEBROOT))
}
-val ATSLANGWEBRESOURCE: text = strcst ((s2s)res) where {
+val ATSLANGWEBRESOURCE: atext = strcst ((s2s)res) where {
val res = sprintf ("<a href=\"%s/RESOURCE/\">Resources</a>", @(ATSLANGWEBROOT))
}
-val ATSLANGWEBCOMMUNITY: text = strcst ((s2s)res) where {
+val ATSLANGWEBCOMMUNITY: atext = strcst ((s2s)res) where {
val res = sprintf ("<a href=\"%s/COMMUNITY/\">Community</a>", @(ATSLANGWEBROOT))
}
-val ATSLANGWEBEXAMPLE: text = strcst ((s2s)res) where {
+val ATSLANGWEBEXAMPLE: atext = strcst ((s2s)res) where {
val res = sprintf ("<a href=\"%s/EXAMPLE/\">Examples</a>", @(ATSLANGWEBROOT))
}
-val ATSLANGWEBIMPLEMENT: text = strcst ((s2s)res) where {
+val ATSLANGWEBIMPLEMENT: atext = strcst ((s2s)res) where {
val res = sprintf ("<a href=\"%s/IMPLEMENT/\">Implementations</a>", @(ATSLANGWEBROOT))
}
-val ATSLANGWEBPAPER: text = strcst ((s2s)res) where {
+val ATSLANGWEBPAPER: atext = strcst ((s2s)res) where {
val res = sprintf ("<a href=\"%s/PAPER/\">Papers</a>", @(ATSLANGWEBROOT))
}
@@ -234,14 +235,14 @@ fn mysitelinks (current: string) = let
val flag = (if (current = "COMMUNITY") then 1 else 0): int
val COMMUNITY = strcst (COMMUNITY_ahref (flag))
//
- val xs = $lst {text} (
+ val xs = $lst {atext} (
HOME, DOWNLOAD, DOCUMENT, LIBRARY, RESOURCE, COMMUNITY
) // end of [val]
//
val sep = strcst ("<span class=\"separator\"> | </span>")
//
in
- TEXTcontxtsep (xs, sep)
+ atext_concatxtsep (xs, sep)
end // end of [mysitelinks]
(* ****** ****** *)
@@ -250,14 +251,14 @@ fun staexp (x: string) = let
val opn = "<span class=atsyntax_staexp>"
val cls = "</span>"
in
- TEXTappstr3 (opn, x, cls)
+ atext_appstr3 (opn, x, cls)
end // end of [staexp]
fun dynexp (x: string) = let
val opn = "<span class=atsyntax_dynexp>"
val cls = "</span>"
in
- TEXTappstr3 (opn, x, cls)
+ atext_appstr3 (opn, x, cls)
end // end of [dynexp]
(* ****** ****** *)
@@ -268,8 +269,8 @@ local
*)
in
//
-fun atscode2xmls (x: string): text = atscode2xml_strcode (0, x)
-fun atscode2xmld (x: string): text = atscode2xml_strcode (1, x)
+fun atscode2xmls (x: string): atext = atscode2xml_strcode (0, x)
+fun atscode2xmld (x: string): atext = atscode2xml_strcode (1, x)
//
end // end of [local]
//
View
10 utils/atsdoc/HATS/docbookatxt.hats
@@ -121,15 +121,15 @@ val ATSCODEcls = "]]></programlisting></informalexample>"
in
//
fun atscode
- (x: string): text = TEXTappstr3 (ATSCODEopn, x, ATSCODEcls)
+ (x: string): atext = atext_appstr3 (ATSCODEopn, x, ATSCODEcls)
fun atscodefil
- (path: string): text = let
+ (path: string): atext = let
val code = filename2text (path) in
- TEXTapptxt3 (TEXTstrcst(ATSCODEopn), code, TEXTstrcst(ATSCODEcls))
+ atext_apptxt3 (atext_strcst(ATSCODEopn), code, atext_strcst(ATSCODEcls))
end // end of [atscode1]
(*
-fun atscode2xmls (x: string): text = atscode2xml_strcode (0, x)
-fun atscode2xmld (x: string): text = atscode2xml_strcode (1, x)
+fun atscode2xmls (x: string): atext = atscode2xml_strcode (0, x)
+fun atscode2xmld (x: string): atext = atscode2xml_strcode (1, x)
*)
//
end // end of [local]
View
34 utils/atsdoc/HATS/xhtmlatxt.hats
@@ -57,7 +57,7 @@ staload "libatsdoc/SATS/atsdoc_text.sats"
//
(* ****** ****** *)
-val TEXTnewline = TEXTstrcst"\n"
+val atext_newline = atext_strcst"\n"
(* ****** ****** *)
@@ -71,11 +71,11 @@ in
fun xmltagging (
tag: string, x: string
-) : text = let
- val _opn = TEXTappstr3 (LT, tag, GT)
- val _clo = TEXTappstr3 (LTSLASH, tag, GT)
+) : atext = let
+ val _opn = atext_appstr3 (LT, tag, GT)
+ val _clo = atext_appstr3 (LTSLASH, tag, GT)
in
- TEXTapptxt3 (_opn, TEXTstrsub(x), _clo)
+ atext_apptxt3 (_opn, atext_strsub(x), _clo)
end // end of [xmltagging]
end // end of [local]
@@ -90,21 +90,21 @@ macdef body (x) = xmltagging ("body", ,(x))
local
//
-val COMMENTopn = TEXTstrcst"<!--"
-and COMMENTcls = TEXTstrcst("-->")
+val COMMENTopn = atext_strcst"<!--"
+and COMMENTcls = atext_strcst("-->")
//
in
-fun comment (x: string): text =
- TEXTapptxt3 (COMMENTopn, TEXTstrsub(x), COMMENTcls)
+fun comment (x: string): atext =
+ atext_apptxt3 (COMMENTopn, atext_strsub(x), COMMENTcls)
// end of [comment]
end // end of [local]
(* ****** ****** *)
-fun ignore (x: string): text = TEXTnil ()
-fun ignoretxt (x: text): text = TEXTnil ()
+fun ignore (x: string): atext = atext_nil ()
+fun ignoretxt (x: atext): atext = atext_nil ()
(* ****** ****** *)
@@ -119,24 +119,24 @@ macdef textpre(x) = xmltagging ("pre", ,(x)) // <pre> ... </pre>
(* ****** ****** *)
fn pcenter
- (x: string): text = let
- val opn = TEXTstrcst"<p style=\"text-align: center;\">"
- val cls = TEXTstrcst"</p>"
+ (x: string): atext = let
+ val opn = atext_strcst"<p style=\"text-align: center;\">"
+ val cls = atext_strcst"</p>"
in
- TEXTapptxt3 (opn, TEXTstrsub(x), cls)
+ atext_apptxt3 (opn, atext_strsub(x), cls)
end // end of [pcenter]
(* ****** ****** *)
fun timestamp
- (): text = let
+ (): atext = let
var time = $TIME.time_get ()
val (fpf | x) = $TIME.ctime (time)
val x1 = sprintf ("%s", @($UN.castvwtp1(x)))
prval () = fpf (x)
val x1 = string_of_strptr (x1)
in
- TEXTstrcst (x1)
+ atext_strcst (x1)
end // end of [val]
(* ****** ****** *)

No commit comments for this range

Something went wrong with that request. Please try again.