comparison tests/lessSafeFfi.ur @ 2038:ec2c7a22df0d

Fix off-by-one error in less-safe FFI wrapper generation
author Adam Chlipala <adam@chlipala.net>
date Sun, 13 Jul 2014 06:14:23 -0400
parents 403f0cc65b9c
children 3d10ae22abd6
comparison
equal deleted inserted replaced
2037:cf453f48d28b 2038:ec2c7a22df0d
1 ffi foo : int -> int 1 ffi foo : int -> int
2 ffi bar serverOnly benignEffectful : int -> transaction unit 2 ffi bar serverOnly benignEffectful : int -> transaction unit
3 ffi baz : transaction int 3 ffi baz : transaction int
4 ffi adder : int -> int -> int
4 5
5 ffi bup jsFunc "jsbup" : int -> transaction unit 6 ffi bup jsFunc "alert" : string -> transaction unit
6 7
7 fun other () : transaction page = 8 fun other () : transaction page =
8 (*bar 17; 9 (*bar 17;
9 q <- baz;*) 10 q <- baz;*)
10 return <xml><body> 11 return <xml><body>
11 (*{[foo 42]}, {[q]}*) 12 (*{[foo 42]}, {[q]}*)
12 <button onclick={fn _ => bup 32}/> 13 <button onclick={fn _ => bup "asdf"}/>
13 </body></xml> 14 </body></xml>
14 15
15 fun main () = return <xml><body> 16 fun main () = return <xml><body>
16 <form> 17 <form>
17 <submit action={other}/> 18 <submit action={other}/>