-
Notifications
You must be signed in to change notification settings - Fork 1
/
tozawa2.mtt
34 lines (26 loc) · 910 Bytes
/
tozawa2.mtt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
type Input = doc[preface[header[],Paras],Blocs]
type Blocs = (div[Blocs] | p[] | note[Paras])*
type Paras = p[]*
type Xhtml = html[head[meta[]*, title[], meta[]*],body[Blocks]]
type Blocks = (h1[]|h2[]|h3[]|h4[]|h5[]|h6[]|h7[]|h8[]|h9[]
|p[]|b[]|div[Blocks])*
expr Rest2 =
if Copy in () then rest
else let rest = !Rest2 in
if Copy in header[Any],Any then h3[/Copy],rest
else _[/Copy],rest
expr RestHtml =
if Copy in () then rest
else let rest = !RestHtml in
if Copy in preface[Any],Any | note[Any],Any then /Rest2
else /RestHtml
expr Body =
if Copy in () then ()
else if Copy in preface[Any],Any | note[Any],Any then !Body
else _[/Body],!Body
expr Append = if Copy in () then rest else _[/Copy],!Append
expr AppHtml =
html[ head[title[]], body[
let rest = div[ h2[], let rest = () in /RestHtml] in
(/Body; Append) ] ]
check AppHtml: Input -> Xhtml