comparison tests/crud1.ur @ 360:c1e96b387115

Syntax highlighting for embedded XML
author Adam Chlipala <adamc@hcoop.net>
date Tue, 14 Oct 2008 16:37:43 -0400
parents 9390c55b9f1f
children 24a31b35e08f
comparison
equal deleted inserted replaced
359:465593c024ca 360:c1e96b387115
1 table t1 : {Id : int, A : int, B : string, C : float, D : bool} 1 table t1 : {Id : int, A : int, B : string, C : float, D : bool}
2 2
3 val a = {Nam = "A", 3 val a = {Nam = "A",
4 Show = txt _, 4 Show = txt _,
5 Widget = fn nm :: Name => <lform><textbox{nm}/></lform>, 5 Widget = fn nm :: Name => <xml><textbox{nm}/></xml>,
6 WidgetPopulated = fn (nm :: Name) n => 6 WidgetPopulated = fn (nm :: Name) n =>
7 <lform><textbox{nm} value={show _ n}/></lform>, 7 <xml><textbox{nm} value={show _ n}/></xml>,
8 Parse = readError _, 8 Parse = readError _,
9 Inject = _} 9 Inject = _}
10 10
11 val b = {Nam = "B", 11 val b = {Nam = "B",
12 Show = txt _, 12 Show = txt _,
13 Widget = fn nm :: Name => <lform><textbox{nm}/></lform>, 13 Widget = fn nm :: Name => <xml><textbox{nm}/></xml>,
14 WidgetPopulated = fn (nm :: Name) s => 14 WidgetPopulated = fn (nm :: Name) s =>
15 <lform><textbox{nm} value={s}/></lform>, 15 <xml><textbox{nm} value={s}/></xml>,
16 Parse = readError _, 16 Parse = readError _,
17 Inject = _} 17 Inject = _}
18 18
19 val c = {Nam = "C", 19 val c = {Nam = "C",
20 Show = txt _, 20 Show = txt _,
21 Widget = fn nm :: Name => <lform><textbox{nm}/></lform>, 21 Widget = fn nm :: Name => <xml><textbox{nm}/></xml>,
22 WidgetPopulated = fn (nm :: Name) n => 22 WidgetPopulated = fn (nm :: Name) n =>
23 <lform><textbox{nm} value={show _ n}/></lform>, 23 <xml><textbox{nm} value={show _ n}/></xml>,
24 Parse = readError _, 24 Parse = readError _,
25 Inject = _} 25 Inject = _}
26 26
27 val d = {Nam = "D", 27 val d = {Nam = "D",
28 Show = txt _, 28 Show = txt _,
29 Widget = fn nm :: Name => <lform><checkbox{nm}/></lform>, 29 Widget = fn nm :: Name => <xml><checkbox{nm}/></xml>,
30 WidgetPopulated = fn (nm :: Name) b => 30 WidgetPopulated = fn (nm :: Name) b =>
31 <lform><checkbox{nm} checked={b}/></lform>, 31 <xml><checkbox{nm} checked={b}/></xml>,
32 Parse = fn x => x, 32 Parse = fn x => x,
33 Inject = _} 33 Inject = _}
34 34
35 open Crud.Make(struct 35 open Crud.Make(struct
36 val tab = t1 36 val tab = t1