Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
985d174f
Commit
985d174f
authored
Oct 05, 2007
by
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
a77dadae
Changes
2
Hide whitespace changes
Inline
Side-by-side
driver/examples.ml
View file @
985d174f
let
examples
=
[
"ovfun"
,
"
type Person = FPerson | MPerson;;
type FPerson = <person gender =
\"
F
\"
>[ Name Children (Tel | Email)?];;
...
...
tests/web.cd
View file @
985d174f
...
...
@@ -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))) '";;' ];;
*)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment