view tests/urblog.ur @ 1906:0d2fdc2cc46c

Allow building in a separate build directory Signed-off-by: Anders Kaseorg <andersk@mit.edu> --- Makefile.am | 30 +++--- src/c/Makefile.am | 2 +- src/compiler.mlb | 2 +- src/sources | 302 +++++++++++++++++++++++++++--------------------------- 4 files changed, 168 insertions(+), 168 deletions(-)
author Anders Kaseorg <andersk@mit.edu>
date Fri, 22 Nov 2013 09:36:14 -0500
parents 19e8e3d556d6
children
line wrap: on
line source
table entry : { Id : int, Title : string, Created : time, Author : string,
Body : string }
  PRIMARY KEY Id

fun list () =
    rows <- queryX (SELECT * FROM entry)
            (fn row => 
				<xml>
					<div>
						<h1>{[row.Entry.Title]}</h1><br />
							<h2>By {[row.Entry.Author]} at {[row.Entry.Created]}</h2>
						<p>{[row.Entry.Body]}</p>
					</div>
				</xml>
            );
    return 
	 	<xml>
		  <head>
				<title>All Entries</title>
		  </head>
		  <body>
			<h1>All Entries</h1>
        {rows}
		  </body>
    	</xml>

fun main () = return <xml>
  <head>
    <title>UrBlog</title>
  </head>

  <body>
    <h1>UrBlog</h1>
  </body>
</xml>