Commit 85cfbbbf authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2002-11-16 00:34:14 by cvscast] Empty log message

Original author: cvscast
Date: 2002-11-16 00:34:14+00:00
parent 8be464d0
let examples = [ "ovfun","
type Person = FPerson | MPerson;;
type FPerson = <person gender = \"F\" >[ Name Children (Tel | Email)?];;
......
......@@ -54,8 +54,6 @@ let examples =
| Examples & <_>e -> e
| _ -> raise "Invalid input document";;
let cduce = [ <b>"C" 'Duce' ];;
let website : String = "http://www.cduce.org";;
let fun script (code : String) : String =
"/cgi-bin/cduce2?example=" @ code;;
......@@ -63,12 +61,33 @@ let fun script (code : String) : String =
let fun do_example (<_ code=c>[<title>t <abstract>a; _] : Example) : Li =
<li>[ <a href = script c >[ !t '.' ] !a ];;
let fun protect_quote (s : String) : String =
transform s with '"' -> [ '\\"' ] | c -> [c];;
let fun to_ml (e : [Example*]) : String =
transform e with
<_ code=c>[_ _ <code>cd] -> [ '"' !c '","' !(protect_quote cd) '";'];;
dump_to_file "driver/examples.ml"
[ '
let examples = [ ' !(to_ml examples) ' ];;
let present = "'
!(protect_quote (print_xml
<ul>(map examples with e -> do_example e))
) '";;' ];;
(*
let cduce = [ <b>"C" 'Duce' ];;
let website : String = "http://www.cduce.org";;
let presentation : [ Block* ] =
[ <h2>"Presentation of the language"
<p>[ !cduce ' is an higher-order functional language adapted to '
' XML applications.' ]
];;
let doc : Html =
<html>[
......@@ -85,17 +104,5 @@ let doc : Html =
<address>[ 'This page has been generated by a ' !cduce ' program.' ]
]
];;
let fun protect_quote (s : String) : String =
transform s with '"' -> [ '\\"' ] | c -> [c];;
let fun to_ml (e : [Example*]) : String =
transform e with
<_ code=c>[_ _ <code>cd] -> [ '"' !c '","' !(protect_quote cd) '";'];;
dump_to_file "tests/examples.html" (print_xml doc);;
dump_to_file "driver/examples.ml"
[ 'let examples = [ ' !(to_ml examples) ' ];;
let present = "' !(protect_quote (print_xml <ul>(map examples with e -> do_example e))) '";;' ];;
*)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment