annotate tests/espec.ur @ 1078:b9321bcefb42

Fix new Especialize security bug: do not duplicate free variables as specialized arguments
author Adam Chlipala <adamc@hcoop.net>
date Tue, 15 Dec 2009 13:20:13 -0500
parents a3273bee05a9
children
rev   line source
adamc@1077 1 fun foo (wrap : xbody -> transaction page) = wrap <xml>
adamc@1077 2 <a link={foo wrap}>Foo</a>
adamc@1077 3 </xml>
adamc@1077 4
adamc@1077 5 fun bar (wrap : xbody -> transaction page) (n : int) = wrap <xml>
adamc@1077 6 <a link={bar wrap n}>Bar</a>; {[n]}
adamc@1077 7 </xml>
adamc@1077 8
adamc@1077 9 fun baz (n : int) (wrap : xbody -> transaction page) = wrap <xml>
adamc@1077 10 <a link={baz n wrap}>Baz</a>; {[n]}
adamc@1077 11 </xml>
adamc@1077 12
adamc@1077 13 fun middle (n : int) (wrap : xbody -> transaction page) (m : int) = wrap <xml>
adamc@1077 14 <a link={middle n wrap m}>Middle</a>; {[n]}; {[m]}
adamc@1077 15 </xml>
adamc@1077 16
adamc@1077 17 fun crazy (f : int -> int) (b : bool) (wrap : xbody -> transaction page) (m : int) = wrap <xml>
adamc@1077 18 <a link={crazy f b wrap m}>Crazy</a>; {[b]}; {[f m]}
adamc@1077 19 </xml>
adamc@1077 20
adamc@1077 21 fun wild (q : bool) (f : int -> int) (n : float) (wrap : xbody -> transaction page) (m : int) = wrap <xml>
adamc@1077 22 <a link={wild q f n wrap m}>Wild</a>; {[n]}; {[f m]}; {[q]}
adamc@1077 23 </xml>
adamc@1077 24
adamc@1077 25 fun wrap x = return <xml><body>{x}</body></xml>
adamc@1077 26
adamc@1077 27 fun wrapN n x = return <xml><body>{[n]}; {x}</body></xml>
adamc@1077 28
adamc@1077 29 fun foo2 (wrap : xbody -> transaction page) = wrap <xml>
adamc@1077 30 <a link={foo2 wrap}>Foo</a>
adamc@1077 31 </xml>
adamc@1077 32
adamc@1077 33 fun foo3 (n : int) = wrap <xml>
adamc@1077 34 <a link={foo2 (wrapN n)}>Foo</a>
adamc@1077 35 </xml>
adamc@1077 36
adamc@1077 37 fun bar2 (n : int) (wrap : xbody -> transaction page) = wrap <xml>
adamc@1077 38 <a link={bar2 n wrap}>Bar</a>; n={[n]}
adamc@1077 39 </xml>
adamc@1077 40
adamc@1077 41 fun bar3 (n : int) = wrap <xml>
adamc@1077 42 <a link={bar2 88 (wrapN n)}>Bar</a>
adamc@1077 43 </xml>
adamc@1077 44
adamc@1077 45
adamc@1077 46 fun main () = return <xml><body>
adamc@1077 47 <a link={foo wrap}>Foo</a>
adamc@1077 48 <a link={bar wrap 32}>Bar</a>
adamc@1077 49 <a link={baz 18 wrap}>Baz</a>
adamc@1077 50 <a link={middle 1 wrap 2}>Middle</a>
adamc@1077 51 <a link={crazy (fn n => 2 * n) False wrap 2}>Crazy</a>
adamc@1077 52 <a link={wild True (fn n => 2 * n) 1.23 wrap 2}>Wild</a>
adamc@1077 53 <hr/>
adamc@1077 54 <a link={foo3 15}>Foo3</a>
adamc@1077 55 <a link={bar3 44}>Bar3</a>
adamc@1077 56 </body></xml>