Mercurial > urweb
annotate tests/tail.ur @ 2142:3288e3c9948b
Fix XML indentation in Emacs mode
The return value of MATCH-STRING is a string. At least on Emacs 25,
the comparisons between string and character with EQUAL could never
succeed, and so the cases for matching braces were never triggered.
GET-TEXT-PROPERTY may return a list rather than an atom (for example,
on long lines with whitespace-mode turned on), and this broke the
heuristic of looking for the tag face in previous text.
author | Julian Squires <julian@cipht.net> |
---|---|
date | Mon, 04 May 2015 14:35:07 -0400 |
parents | d80734855790 |
children |
rev | line source |
---|---|
adamc@954 | 1 fun one () = return 1 |
adamc@954 | 2 |
adamc@954 | 3 fun addEm n = |
adamc@954 | 4 if n = 0 then |
adamc@954 | 5 return 0 |
adamc@954 | 6 else |
adamc@954 | 7 n1 <- rpc (one ()); |
adamc@954 | 8 n2 <- addEm (n - 1); |
adamc@954 | 9 return (n1 + n2) |
adamc@954 | 10 |
adamc@956 | 11 fun addEm' n acc = |
adamc@956 | 12 if n = 0 then |
adamc@956 | 13 return acc |
adamc@956 | 14 else |
adamc@956 | 15 n1 <- rpc (one ()); |
adamc@956 | 16 addEm' (n - 1) (n1 + acc) |
adamc@956 | 17 |
adamc@954 | 18 fun main () = |
adamc@954 | 19 s <- source 0; |
adamc@956 | 20 s' <- source 0; |
adamc@956 | 21 return <xml><body onload={n <- addEm 3; set s n; n <- addEm' 4 0; set s' n; alert "Welcome!"}> |
adamc@954 | 22 <dyn signal={n <- signal s; return (txt n)}/> |
adamc@956 | 23 <dyn signal={n <- signal s'; return (txt n)}/> |
adamc@954 | 24 </body></xml> |