Mercurial > meta
annotate tests/testHtml.ur @ 29:7530b2b54353
Update for Ur/Web's new type class handling
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Sun, 29 Jul 2012 12:27:36 -0400 |
parents | 8eaaca74a64c |
children |
rev | line source |
---|---|
adam@9 | 1 open Parse |
adam@9 | 2 open Html |
adam@9 | 3 |
adam@9 | 4 val parser = format (b, i, a) |
adam@9 | 5 |
adam@9 | 6 fun parse r = |
adam@9 | 7 case parser r.Source of |
adam@9 | 8 Failure s => error <xml>Bad HTML: {[s]}</xml> |
adam@9 | 9 | Success x => return <xml><body> |
adam@9 | 10 <h1>Here it is:</h1> |
adam@9 | 11 |
adam@9 | 12 {x} |
adam@9 | 13 </body></xml> |
adam@9 | 14 |
adam@9 | 15 fun main () = return <xml><body> |
adam@9 | 16 <form> <textarea{#Source}/> <submit action={parse}/> </form> |
adam@9 | 17 </body></xml> |