annotate tests/fromString.ur @ 1739:c414850f206f

Add support for -boot flag, which allows in-tree execution of Ur/Web The boot flag rewrites most hardcoded paths to point to the build directory, and also forces static compilation. This is convenient for developing Ur/Web, or if you cannot 'sudo make install' Ur/Web. The following changes were made: * Header files were moved to include/urweb instead of include; this lets FFI users point their C_INCLUDE_PATH at this directory at write <urweb/urweb.h>. For internal Ur/Web executables, we simply pass -I$PATH/include/urweb as normal. * Differentiate between LIB and SRCLIB; SRCLIB is Ur and JavaScript source files, while LIB is compiled products from libtool. For in-tree compilation these live in different places. * No longer reference Config for paths; instead use Settings; these settings can be changed dynamically by Compiler.enableBoot () (TODO: add a disableBoot function.) * config.h is now generated directly in include/urweb/config.h, for consistency's sake (especially since it gets installed along with the rest of the headers!) * All of the autotools build products got updated. * The linkStatic field in protocols now only contains the name of the build product, and not the absolute path. Future users have to be careful not to reference the Settings files to early, lest they get an old version (this was the source of two bugs during development of this patch.)
author Edward Z. Yang <ezyang@mit.edu>
date Wed, 02 May 2012 17:17:57 -0400
parents 550100a44cca
children
rev   line source
adamc@289 1 fun s2i s =
adamc@290 2 case read _ s of
adamc@288 3 None => 0
adamc@288 4 | Some n => n
adamc@288 5
adamc@289 6 fun s2f s =
adamc@290 7 case read _ s of
adamc@289 8 None => 0.0
adamc@289 9 | Some n => n
adamc@289 10
adamc@291 11 fun s2s s =
adamc@291 12 case read _ s of
adamc@291 13 None => "Error"
adamc@291 14 | Some s => s
adamc@291 15
adamc@289 16 fun s2b s =
adamc@290 17 case read _ s of
adamc@289 18 None => False
adamc@289 19 | Some b => b
adamc@289 20
adamc@288 21 fun main () : transaction page = return <html><body>
adamc@289 22 Error = {cdata (show _ (s2i "Error"))}<br/>
adamc@289 23 3 = {cdata (show _ (s2i "+3"))}<br/>
adamc@289 24 <br/>
adamc@289 25 Error = {cdata (show _ (s2f "Error"))}<br/>
adamc@289 26 98.76 = {cdata (show _ (s2f "98.76"))}<br/>
adamc@289 27 <br/>
adamc@289 28 Error = {cdata (show _ (s2b "Error"))}<br/>
adamc@289 29 False = {cdata (show _ (s2b "false"))}<br/>
adamc@289 30 True = {cdata (show _ (s2b "trUE"))}<br/>
adamc@291 31 <br/>
adamc@291 32 Hi = {cdata (s2s "Hi")}<br/>
adamc@288 33 </body></html>