# HG changeset patch # User Mike Pavone # Date 1240985604 14400 # Node ID b3f71490858cfcd46cd4098aa77515ceff719700 # Parent 76568becd6d6e7fd336bfd4732c7b89a967265d4 Small fixes and enhancements from main windows box diff -r 76568becd6d6 -r b3f71490858c extendlib.rhope --- a/extendlib.rhope Tue Apr 28 23:06:07 2009 +0000 +++ b/extendlib.rhope Wed Apr 29 02:13:24 2009 -0400 @@ -70,9 +70,19 @@ } } +To String@String[string:out] +{ + out <- string +} + +Empty@String[string:out] +{ + out <- "" +} + In[needle,haystack:found?] { - [haystack]Get DString[needle] + [haystack]Get DString[To String[needle]] { found? <- Yes } {} {} { @@ -201,6 +211,41 @@ } } +_Zip[left,lindex,right,rindex,outlist:out] +{ + nlist <- [outlist]Append[ + [[()]Append[ [left]Index[lindex] ]]Append[ [right]Index[rindex] ] + ] + nlindex <- [left]Next[lindex] + { + [right]Next[rindex] + { + out <- _Zip[left,nlindex,right,~,nlist] + }{ + out <- Val[nlist] + } + }{ + out <- Val[nlist] + } +} + +Zip[left,right:out] +{ + lindex <- [left]First + { + Print[~] + [right]First + { + Print[~] + out <- _Zip[left,lindex,right,~,()] + }{ + out <- () + } + }{ + out <- () + } +} + _Dict Split[dict,entry,index,keydelim:out] { parts <- [entry]Split[keydelim] @@ -524,3 +569,28 @@ out <- Fold["_Keys", New@List[], container] } +And[left,right:out] +{ + ,out <- If[left] + { + out,out <- If[right] + } +} + +Or[left,right:out] +{ + out <- If[left] {} + { + out,out <- If[right] + } +} + +After[text,prefix:after,not found] +{ + If[[text]Starts With[prefix]] + { + ,after <- [text]Slice[[prefix]Length] + }{ + not found <- text + } +} diff -r 76568becd6d6 -r b3f71490858c framework.rhope --- a/framework.rhope Tue Apr 28 23:06:07 2009 +0000 +++ b/framework.rhope Wed Apr 29 02:13:24 2009 -0400 @@ -323,7 +323,7 @@ newlist <- [destlist]Set[index, [[""]Put Byte[From Hex@Whole Number[code]]]Append[rest]] [list]Next[index] { - out <- Decode Helper Straight[list, newlist, ~] + out <- Decode Helper Decode[list, newlist, ~] }{ out <- Val[newlist] } @@ -658,7 +658,7 @@ }{ queryvars <- "" } - out <- [[[[[[[">]]Append[queryvars]]Append["\""] + out <- [[[[[[[">]Replace["\"", "%22"]]]Append[queryvars]]Append["\""] ]Append[Get Class[link]]]Append[">"]]Append[Escape HTML Text[[link]Text>>]]]Append[""] } @@ -748,3 +748,35 @@ ]Append[ Fold[["Make Table Row"]>] ] ]Append["\t\n"] } + +Blueprint Web Image +{ + Source + Alt +} + +New@Web Image[source,alt:out] +{ + out <- [[Build["Web Image"]]Source <<[source]]Alt <<[alt] +} + +Name@Web Image[image:name,none] +{ + name <- [image]Source >> +} + +Set Session@Web Image[in,session:out] +{ + out <- in +} + +Postback@Web Image[image,post data:out,events] +{ + out <- image + events <- () +} + +Render@Web Image[image:out,headers] +{ + out <- [[[[">]]Append["\" alt=\""]]Append[[image]Alt >>]]Append["\">"] +} diff -r 76568becd6d6 -r b3f71490858c parser.vistxt --- a/parser.vistxt Tue Apr 28 23:06:07 2009 +0000 +++ b/parser.vistxt Wed Apr 29 02:13:24 2009 -0400 @@ -846,12 +846,13 @@ value,after(1) <- Parse Number[name, params(1)] :||: delims <- [[[[[[{"\n"}]Append[[params(1)]Block Begin >>]]Append[[params(1)]Block End >>]]Append[[params(1)]Empty Block >>]]Append[[params(1)]Arg End >>]]Append[[params(1)]List Delim >>]]Append[[params(1)]List End >>] - ,before,delim <- [name]Get Comment DString[delims, params(1)] + afterdelim,raw before,delim <- [name]Get Comment DString[delims, params(1)] |: after(1) <- [delim]Append[~] :| |::| |::| |: after(1) <- "" :| + before <- Trim[raw before, "\r\n\t "] If[[before] = ["Yes"]] |: yesno <- Yes