diff tests/testHtml.ur @ 9:8eaaca74a64c

Import HTML parser
author Adam Chlipala <adam@chlipala.net>
date Wed, 15 Dec 2010 09:27:46 -0500
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/testHtml.ur	Wed Dec 15 09:27:46 2010 -0500
@@ -0,0 +1,17 @@
+open Parse
+open Html
+
+val parser = format (b, i, a)
+
+fun parse r =
+    case parser r.Source of
+        Failure s => error <xml>Bad HTML: {[s]}</xml>
+      | Success x => return <xml><body>
+        <h1>Here it is:</h1>
+
+        {x}
+      </body></xml>
+
+fun main () = return <xml><body>
+  <form> <textarea{#Source}/> <submit action={parse}/> </form>
+</body></xml>