annotate tests/buffer.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 2197f0e24a9f
children
rev   line source
adamc@728 1 datatype lines = End | Line of string * source lines
adamc@728 2
adamc@728 3 type t = { Head : source lines, Tail : source (source lines) }
adamc@728 4
adamc@728 5 val create =
adamc@728 6 head <- source End;
adamc@728 7 tail <- source head;
adamc@728 8 return {Head = head, Tail = tail}
adamc@728 9
adamc@728 10 fun renderL lines =
adamc@728 11 case lines of
adamc@728 12 End => <xml/>
adamc@728 13 | Line (line, linesS) => <xml>{[line]}<br/><dyn signal={renderS linesS}/></xml>
adamc@728 14
adamc@728 15 and renderS linesS =
adamc@728 16 lines <- signal linesS;
adamc@728 17 return (renderL lines)
adamc@728 18
adamc@728 19 fun render t = renderS t.Head
adamc@728 20
adamc@728 21 fun write t s =
adamc@728 22 oldTail <- get t.Tail;
adamc@728 23 newTail <- source End;
adamc@728 24 set oldTail (Line (s, newTail));
adamc@728 25 set t.Tail newTail