From 7be07a6bc84b383dcf78b990a99e3d6370bd5741 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 27 Dec 2016 09:08:30 -0800 Subject: 3719 - cross-link Mu waypoints to their location --- exuberant_ctags_rc | 1 + html/075channel.mu.html | 8 ++--- html/edit/001-editor.mu.html | 2 +- html/edit/002-typing.mu.html | 20 +++++------ html/edit/003-shortcuts.mu.html | 50 +++++++++++++-------------- html/edit/004-programming-environment.mu.html | 20 +++++------ html/edit/005-sandbox.mu.html | 30 ++++++++-------- html/edit/006-sandbox-copy.mu.html | 2 +- html/edit/007-sandbox-delete.mu.html | 2 +- html/edit/008-sandbox-edit.mu.html | 2 +- html/edit/009-sandbox-test.mu.html | 10 +++--- html/edit/010-sandbox-trace.mu.html | 6 ++-- html/edit/011-errors.mu.html | 14 ++++---- html/edit/012-editor-undo.mu.html | 40 ++++++++++----------- linkify/003linkify.cc | 17 ++++++++- 15 files changed, 120 insertions(+), 104 deletions(-) diff --git a/exuberant_ctags_rc b/exuberant_ctags_rc index ce0ac4a8..25d3780c 100644 --- a/exuberant_ctags_rc +++ b/exuberant_ctags_rc @@ -6,3 +6,4 @@ --regex-mu=/^recipe![ \t]+([^ \t]*)/\1/d,definition/ --regex-mu=/^container[ \t]+([^ \t]*)/\1/s,struct/ --regex-mu=/^exclusive-container[ \t]+([^ \t]*)/\1/u,union/ +--regex-mu=/^[ \t]*(<[^ \t]*>)/\1/d,definition/ diff --git a/html/075channel.mu.html b/html/075channel.mu.html index 6c83aeea..cf0470d3 100644 --- a/html/075channel.mu.html +++ b/html/075channel.mu.html @@ -130,7 +130,7 @@ if ('onhashchange' in window) { 68 load-ingredients 69 assert out, [write to null channel] 70 chan:&:channel:_elem <- get *out, chan:offset - 71 <channel-write-initial> + 71 <channel-write-initial> 72 # block until lock is acquired AND queue has room 73 lock:location <- get-location *chan, lock:offset 74 #? $print [write], 10/newline @@ -190,7 +190,7 @@ if ('onhashchange' in window) { 128 # add to it 129 reset lock 130 current-routine-is-blocked -131 <channel-read-empty> +131 <channel-read-empty> 132 switch # avoid spinlocking 133 loop 134 } @@ -392,11 +392,11 @@ if ('onhashchange' in window) { 330 # if a channel is closed for writing, 331 # future reads continue until the channel empties, 332 # then the channel is also closed for reading -333 after <channel-write-initial> [ +333 after <channel-write-initial> [ 334 closed?:bool <- get *chan, closed?:offset 335 return-if closed? 336 ] -337 after <channel-read-empty> [ +337 after <channel-read-empty> [ 338 closed?:bool <- get *chan, closed?:offset 339 { 340 break-unless closed? diff --git a/html/edit/001-editor.mu.html b/html/edit/001-editor.mu.html index 63919b99..525ab56f 100644 --- a/html/edit/001-editor.mu.html +++ b/html/edit/001-editor.mu.html @@ -127,7 +127,7 @@ if ('onhashchange' in window) { 66 *result <- put *result, top-of-screen:offset, init 67 *result <- put *result, before-cursor:offset, init 68 result <- insert-text result, s - 69 <editor-initialization> + 69 <editor-initialization> 70 ] 71 72 def insert-text editor:&:editor, text:text -> editor:&:editor [ diff --git a/html/edit/002-typing.mu.html b/html/edit/002-typing.mu.html index 9d883a7e..d3f59451 100644 --- a/html/edit/002-typing.mu.html +++ b/html/edit/002-typing.mu.html @@ -241,7 +241,7 @@ if ('onhashchange' in window) { 180 break-unless is-unicode? 181 trace 10, [app], [handle-keyboard-event: special character] 182 # exceptions for special characters go here - 183 <handle-special-character> + 183 <handle-special-character> 184 # ignore any other special characters 185 regular-character?:bool <- greater-or-equal c, 32/space 186 return-unless regular-character?, 0/don't-render @@ -255,7 +255,7 @@ if ('onhashchange' in window) { 194 k:num, is-keycode?:bool <- maybe-convert e:event, keycode:variant 195 assert is-keycode?, [event was of unknown type; neither keyboard nor mouse] 196 # handlers for each special key will go here - 197 <handle-special-key> + 197 <handle-special-key> 198 return 1/go-render 199 ] 200 @@ -275,7 +275,7 @@ if ('onhashchange' in window) { 214 screen-width:num <- screen-width screen 215 screen-height:num <- screen-height screen 216 # occasionally we'll need to mess with the cursor - 217 <insert-character-special-case> + 217 <insert-character-special-case> 218 # but mostly we'll just move the cursor right 219 cursor-column <- add cursor-column, 1 220 *editor <- put *editor, cursor-column:offset, cursor-column @@ -748,7 +748,7 @@ if ('onhashchange' in window) { 687 ] 688 ] 689 - 690 after <insert-character-special-case> [ + 690 after <insert-character-special-case> [ 691 # if the line wraps at the cursor, move cursor to start of next row 692 { 693 # if either: @@ -887,7 +887,7 @@ if ('onhashchange' in window) { 826 indent?:bool 827 ] 828 - 829 after <editor-initialization> [ + 829 after <editor-initialization> [ 830 *result <- put *result, indent?:offset, 1/true 831 ] 832 @@ -911,13 +911,13 @@ if ('onhashchange' in window) { 850 ] 851 ] 852 - 853 after <handle-special-character> [ + 853 after <handle-special-character> [ 854 { 855 newline?:bool <- equal c, 10/newline 856 break-unless newline? - 857 <insert-enter-begin> + 857 <insert-enter-begin> 858 insert-new-line-and-indent editor, screen - 859 <insert-enter-end> + 859 <insert-enter-end> 860 return 1/go-render 861 } 862 ] @@ -1094,7 +1094,7 @@ if ('onhashchange' in window) { 1033 ] 1034 ] 1035 -1036 after <handle-special-key> [ +1036 after <handle-special-key> [ 1037 { 1038 paste-start?:bool <- equal k, 65507/paste-start 1039 break-unless paste-start? @@ -1103,7 +1103,7 @@ if ('onhashchange' in window) { 1042 } 1043 ] 1044 -1045 after <handle-special-key> [ +1045 after <handle-special-key> [ 1046 { 1047 paste-end?:bool <- equal k, 65506/paste-end 1048 break-unless paste-end? diff --git a/html/edit/003-shortcuts.mu.html b/html/edit/003-shortcuts.mu.html index 77446c2a..078af9cb 100644 --- a/html/edit/003-shortcuts.mu.html +++ b/html/edit/003-shortcuts.mu.html @@ -84,7 +84,7 @@ if ('onhashchange' in window) { 24 ] 25 ] 26 - 27 after <handle-special-character> [ + 27 after <handle-special-character> [ 28 { 29 tab?:bool <- equal c, 9/tab 30 break-unless tab? @@ -126,13 +126,13 @@ if ('onhashchange' in window) { 66 check-trace-count-for-label 3, [print-character] # length of original line to overwrite 67 ] 68 - 69 after <handle-special-character> [ + 69 after <handle-special-character> [ 70 { 71 delete-previous-character?:bool <- equal c, 8/backspace 72 break-unless delete-previous-character? - 73 <backspace-character-begin> + 73 <backspace-character-begin> 74 go-render?:bool, backspaced-cell:&:duplex-list:char <- delete-before-cursor editor, screen - 75 <backspace-character-end> + 75 <backspace-character-end> 76 return 77 } 78 ] @@ -394,13 +394,13 @@ if ('onhashchange' in window) { 334 check-trace-count-for-label 2, [print-character] # new length to overwrite 335 ] 336 - 337 after <handle-special-key> [ + 337 after <handle-special-key> [ 338 { 339 delete-next-character?:bool <- equal k, 65522/delete 340 break-unless delete-next-character? - 341 <delete-character-begin> + 341 <delete-character-begin> 342 go-render?:bool, deleted-cell:&:duplex-list:char <- delete-at-cursor editor, screen - 343 <delete-character-end> + 343 <delete-character-end> 344 return 345 } 346 ] @@ -467,7 +467,7 @@ if ('onhashchange' in window) { 407 check-trace-count-for-label 3, [print-character] # 0 and following characters 408 ] 409 - 410 after <handle-special-key> [ + 410 after <handle-special-key> [ 411 { 412 move-to-next-character?:bool <- equal k, 65514/right-arrow 413 break-unless move-to-next-character? @@ -751,7 +751,7 @@ if ('onhashchange' in window) { 691 check-trace-count-for-label 3, [print-character] 692 ] 693 - 694 after <handle-special-key> [ + 694 after <handle-special-key> [ 695 { 696 move-to-previous-character?:bool <- equal k, 65515/left-arrow 697 break-unless move-to-previous-character? @@ -1021,7 +1021,7 @@ if ('onhashchange' in window) { 961 ] 962 ] 963 - 964 after <handle-special-key> [ + 964 after <handle-special-key> [ 965 { 966 move-to-previous-line?:bool <- equal k, 65517/up-arrow 967 break-unless move-to-previous-line? @@ -1252,7 +1252,7 @@ if ('onhashchange' in window) { 1192 ] 1193 ] 1194 -1195 after <handle-special-key> [ +1195 after <handle-special-key> [ 1196 { 1197 move-to-next-line?:bool <- equal k, 65516/down-arrow 1198 break-unless move-to-next-line? @@ -1383,7 +1383,7 @@ if ('onhashchange' in window) { 1323 check-trace-count-for-label 0, [print-character] 1324 ] 1325 -1326 after <handle-special-character> [ +1326 after <handle-special-character> [ 1327 { 1328 move-to-start-of-line?:bool <- equal c, 1/ctrl-a 1329 break-unless move-to-start-of-line? @@ -1395,7 +1395,7 @@ if ('onhashchange' in window) { 1335 } 1336 ] 1337 -1338 after <handle-special-key> [ +1338 after <handle-special-key> [ 1339 { 1340 move-to-start-of-line?:bool <- equal k, 65521/home 1341 break-unless move-to-start-of-line? @@ -1557,7 +1557,7 @@ if ('onhashchange' in window) { 1497 check-trace-count-for-label 1, [print-character] 1498 ] 1499 -1500 after <handle-special-character> [ +1500 after <handle-special-character> [ 1501 { 1502 move-to-end-of-line?:bool <- equal c, 5/ctrl-e 1503 break-unless move-to-end-of-line? @@ -1569,7 +1569,7 @@ if ('onhashchange' in window) { 1509 } 1510 ] 1511 -1512 after <handle-special-key> [ +1512 after <handle-special-key> [ 1513 { 1514 move-to-end-of-line?:bool <- equal k, 65520/end 1515 break-unless move-to-end-of-line? @@ -1705,13 +1705,13 @@ if ('onhashchange' in window) { 1645 ] 1646 ] 1647 -1648 after <handle-special-character> [ +1648 after <handle-special-character> [ 1649 { 1650 delete-to-start-of-line?:bool <- equal c, 21/ctrl-u 1651 break-unless delete-to-start-of-line? -1652 <delete-to-start-of-line-begin> +1652 <delete-to-start-of-line-begin> 1653 deleted-cells:&:duplex-list:char <- delete-to-start-of-line editor -1654 <delete-to-start-of-line-end> +1654 <delete-to-start-of-line-end> 1655 return 1/go-render 1656 } 1657 ] @@ -1842,13 +1842,13 @@ if ('onhashchange' in window) { 1782 ] 1783 ] 1784 -1785 after <handle-special-character> [ +1785 after <handle-special-character> [ 1786 { 1787 delete-to-end-of-line?:bool <- equal c, 11/ctrl-k 1788 break-unless delete-to-end-of-line? -1789 <delete-to-end-of-line-begin> +1789 <delete-to-end-of-line-begin> 1790 deleted-cells:&:duplex-list:char <- delete-to-end-of-line editor -1791 <delete-to-end-of-line-end> +1791 <delete-to-end-of-line-end> 1792 return 1/go-render 1793 } 1794 ] @@ -2814,7 +2814,7 @@ if ('onhashchange' in window) { 2754 ] 2755 ] 2756 -2757 after <handle-special-character> [ +2757 after <handle-special-character> [ 2758 { 2759 page-down?:bool <- equal c, 6/ctrl-f 2760 break-unless page-down? @@ -2829,7 +2829,7 @@ if ('onhashchange' in window) { 2769 } 2770 ] 2771 -2772 after <handle-special-key> [ +2772 after <handle-special-key> [ 2773 { 2774 page-down?:bool <- equal k, 65518/page-down 2775 break-unless page-down? @@ -3013,7 +3013,7 @@ if ('onhashchange' in window) { 2953 ] 2954 ] 2955 -2956 after <handle-special-character> [ +2956 after <handle-special-character> [ 2957 { 2958 page-up?:bool <- equal c, 2/ctrl-b 2959 break-unless page-up? @@ -3028,7 +3028,7 @@ if ('onhashchange' in window) { 2968 } 2969 ] 2970 -2971 after <handle-special-key> [ +2971 after <handle-special-key> [ 2972 { 2973 page-up?:bool <- equal k, 65519/page-up 2974 break-unless page-up? diff --git a/html/edit/004-programming-environment.mu.html b/html/edit/004-programming-environment.mu.html index 2ae4fb29..31bf0534 100644 --- a/html/edit/004-programming-environment.mu.html +++ b/html/edit/004-programming-environment.mu.html @@ -94,7 +94,7 @@ if ('onhashchange' in window) { 33 *result <- put *result, recipes:offset, recipes 34 *result <- put *result, current-sandbox:offset, current-sandbox 35 *result <- put *result, sandbox-in-focus?:offset, 0/false - 36 <programming-environment-initialization> + 36 <programming-environment-initialization> 37 ] 38 39 def event-loop screen:&:screen, console:&:console, env:&:environment, resources:&:resources -> screen:&:screen, console:&:console, env:&:environment, resources:&:resources [ @@ -114,17 +114,17 @@ if ('onhashchange' in window) { 53 loop-unless found? 54 break-if quit? # only in tests 55 trace 10, [app], [next-event] - 56 <handle-event> + 56 <handle-event> 57 # check for global events that will trigger regardless of which editor has focus 58 { 59 k:num, is-keycode?:bool <- maybe-convert e:event, keycode:variant 60 break-unless is-keycode? - 61 <global-keypress> + 61 <global-keypress> 62 } 63 { 64 c:char, is-unicode?:bool <- maybe-convert e:event, text:variant 65 break-unless is-unicode? - 66 <global-type> + 66 <global-type> 67 } 68 # 'touch' event - send to both sides, see what picks it up 69 { @@ -138,7 +138,7 @@ if ('onhashchange' in window) { 77 click-row:num <- get t, row:offset 78 click-column:num <- get t, column:offset 79 # later exceptions for non-editor touches will go here - 80 <global-touch> + 80 <global-touch> 81 # send to both editors 82 _ <- move-cursor-in-editor screen, recipes, t 83 sandbox-in-focus?:bool <- move-cursor-in-editor screen, current-sandbox, t @@ -525,7 +525,7 @@ if ('onhashchange' in window) { 464 # 465 screen <- render-recipes screen, env, render-editor 466 screen <- render-sandbox-side screen, env, render-editor -467 <render-components-end> +467 <render-components-end> 468 # 469 recipes:&:editor <- get *env, recipes:offset 470 current-sandbox:&:editor <- get *env, current-sandbox:offset @@ -546,7 +546,7 @@ if ('onhashchange' in window) { 485 row:num, column:num, screen <- call render-editor, screen, recipes 486 clear-line-until screen, right 487 row <- add row, 1 -488 <render-recipe-components-end> +488 <render-recipe-components-end> 489 # draw dotted line after recipes 490 draw-horizontal screen, row, left, right, 9480/horizontal-dotted 491 row <- add row, 1 @@ -572,7 +572,7 @@ if ('onhashchange' in window) { 511 def update-cursor screen:&:screen, recipes:&:editor, current-sandbox:&:editor, sandbox-in-focus?:bool, env:&:environment -> screen:&:screen [ 512 local-scope 513 load-ingredients -514 <update-cursor-special-cases> +514 <update-cursor-special-cases> 515 { 516 break-if sandbox-in-focus? 517 cursor-row:num <- get *recipes, cursor-row:offset @@ -651,7 +651,7 @@ if ('onhashchange' in window) { 590 591 # ctrl-l - redraw screen (just in case it printed junk somehow) 592 -593 after <global-type> [ +593 after <global-type> [ 594 { 595 redraw-screen?:bool <- equal c, 12/ctrl-l 596 break-unless redraw-screen? @@ -664,7 +664,7 @@ if ('onhashchange' in window) { 603 # ctrl-n - switch focus 604 # todo: test this 605 -606 after <global-type> [ +606 after <global-type> [ 607 { 608 switch-side?:bool <- equal c, 14/ctrl-n 609 break-unless switch-side? diff --git a/html/edit/005-sandbox.mu.html b/html/edit/005-sandbox.mu.html index 14e49d55..5c940763 100644 --- a/html/edit/005-sandbox.mu.html +++ b/html/edit/005-sandbox.mu.html @@ -84,7 +84,7 @@ if ('onhashchange' in window) { 23 number-of-sandboxes:num 24 ] 25 - 26 after <programming-environment-initialization> [ + 26 after <programming-environment-initialization> [ 27 *result <- put *result, render-from:offset, -1 28 ] 29 @@ -183,7 +183,7 @@ if ('onhashchange' in window) { 122 ] 123 ] 124 - 125 after <global-keypress> [ + 125 after <global-keypress> [ 126 # F4? load all code and run all sandboxes. 127 { 128 do-run?:bool <- equal k, 65532/F4 @@ -207,7 +207,7 @@ if ('onhashchange' in window) { 146 errors-found?:bool <- update-recipes env, resources, screen 147 return-if errors-found? 148 # check contents of right editor (sandbox) - 149 <run-sandboxes-begin> + 149 <run-sandboxes-begin> 150 current-sandbox:&:editor <- get *env, current-sandbox:offset 151 { 152 sandbox-contents:text <- editor-contents current-sandbox @@ -241,7 +241,7 @@ if ('onhashchange' in window) { 180 idx <- add idx, 1 181 loop 182 } - 183 <run-sandboxes-end> + 183 <run-sandboxes-end> 184 ] 185 186 # load code from disk @@ -286,7 +286,7 @@ if ('onhashchange' in window) { 225 data:text <- get *curr, data:offset 226 filename:text <- append [lesson/], idx 227 resources <- dump resources, filename, data - 228 <end-save-sandbox> + 228 <end-save-sandbox> 229 idx <- add idx, 1 230 curr <- get *curr, next-sandbox:offset 231 loop @@ -341,7 +341,7 @@ if ('onhashchange' in window) { 280 *sandbox <- put *sandbox, code-ending-row-on-screen:offset, row 281 # render sandbox warnings, screen or response, in that order 282 sandbox-response:text <- get *sandbox, response:offset - 283 <render-sandbox-results> + 283 <render-sandbox-results> 284 { 285 sandbox-screen:&:screen <- get *sandbox, screen:offset 286 empty-screen?:bool <- fake-screen-is-empty? sandbox-screen @@ -350,7 +350,7 @@ if ('onhashchange' in window) { 289 } 290 { 291 break-unless empty-screen? - 292 <render-sandbox-response> + 292 <render-sandbox-response> 293 row, screen <- render-text screen, sandbox-response, left, right, 245/grey, row 294 } 295 +render-sandbox-end @@ -364,7 +364,7 @@ if ('onhashchange' in window) { 303 break-unless hidden? 304 *sandbox <- put *sandbox, starting-row-on-screen:offset, 0 305 *sandbox <- put *sandbox, code-ending-row-on-screen:offset, 0 - 306 <end-render-sandbox-reset-hidden> + 306 <end-render-sandbox-reset-hidden> 307 } 308 # draw next sandbox 309 next-sandbox:&:sandbox <- get *sandbox, next-sandbox:offset @@ -490,7 +490,7 @@ if ('onhashchange' in window) { 429 # create new sandbox for file 430 curr <- new sandbox:type 431 *curr <- put *curr, data:offset, contents - 432 <end-restore-sandbox> + 432 <end-restore-sandbox> 433 { 434 break-if idx 435 *env <- put *env, sandbox:offset, curr @@ -762,11 +762,11 @@ if ('onhashchange' in window) { 701 recipe-bottom:num 702 ] 703 - 704 after <render-recipe-components-end> [ + 704 after <render-recipe-components-end> [ 705 *env <- put *env, recipe-bottom:offset, row 706 ] 707 - 708 after <global-keypress> [ + 708 after <global-keypress> [ 709 { 710 break-if sandbox-in-focus? 711 down-arrow?:bool <- equal k, 65516/down-arrow @@ -790,7 +790,7 @@ if ('onhashchange' in window) { 729 } 730 ] 731 - 732 after <global-type> [ + 732 after <global-type> [ 733 { 734 break-if sandbox-in-focus? 735 page-down?:bool <- equal k, 6/ctrl-f @@ -928,7 +928,7 @@ if ('onhashchange' in window) { 867 ] 868 869 # page-down on sandbox side updates render-from to scroll sandboxes - 870 after <global-keypress> [ + 870 after <global-keypress> [ 871 { 872 break-unless sandbox-in-focus? 873 page-down?:bool <- equal k, 65518/page-down @@ -953,7 +953,7 @@ if ('onhashchange' in window) { 892 ] 893 894 # update-cursor takes render-from into account - 895 after <update-cursor-special-cases> [ + 895 after <update-cursor-special-cases> [ 896 { 897 break-unless sandbox-in-focus? 898 render-from:num <- get *env, render-from:offset @@ -966,7 +966,7 @@ if ('onhashchange' in window) { 905 ] 906 907 # 'page-up' on sandbox side is like 'page-down': updates render-from when necessary - 908 after <global-keypress> [ + 908 after <global-keypress> [ 909 { 910 break-unless sandbox-in-focus? 911 page-up?:bool <- equal k, 65519/page-up diff --git a/html/edit/006-sandbox-copy.mu.html b/html/edit/006-sandbox-copy.mu.html index dec7b976..7810c2b3 100644 --- a/html/edit/006-sandbox-copy.mu.html +++ b/html/edit/006-sandbox-copy.mu.html @@ -181,7 +181,7 @@ if ('onhashchange' in window) { 121 ] 122 ] 123 -124 after <global-touch> [ +124 after <global-touch> [ 125 # support 'copy' button 126 { 127 copy?:bool <- should-attempt-copy? click-row, click-column, env diff --git a/html/edit/007-sandbox-delete.mu.html b/html/edit/007-sandbox-delete.mu.html index 6da7f3da..ab5dac63 100644 --- a/html/edit/007-sandbox-delete.mu.html +++ b/html/edit/007-sandbox-delete.mu.html @@ -125,7 +125,7 @@ if ('onhashchange' in window) { 65 ] 66 ] 67 - 68 after <global-touch> [ + 68 after <global-touch> [ 69 # support 'delete' button 70 { 71 delete?:bool <- should-attempt-delete? click-row, click-column, env diff --git a/html/edit/008-sandbox-edit.mu.html b/html/edit/008-sandbox-edit.mu.html index 014c939e..70f0141f 100644 --- a/html/edit/008-sandbox-edit.mu.html +++ b/html/edit/008-sandbox-edit.mu.html @@ -164,7 +164,7 @@ if ('onhashchange' in window) { 104 ] 105 ] 106 -107 after <global-touch> [ +107 after <global-touch> [ 108 # support 'edit' button 109 { 110 edit?:bool <- should-attempt-edit? click-row, click-column, env diff --git a/html/edit/009-sandbox-test.mu.html b/html/edit/009-sandbox-test.mu.html index e0edd9a7..c2774b98 100644 --- a/html/edit/009-sandbox-test.mu.html +++ b/html/edit/009-sandbox-test.mu.html @@ -153,7 +153,7 @@ if ('onhashchange' in window) { 92 ] 93 94 # include expected response when saving or restoring a sandbox - 95 before <end-save-sandbox> [ + 95 before <end-save-sandbox> [ 96 { 97 expected-response:text <- get *curr, expected-response:offset 98 break-unless expected-response @@ -162,7 +162,7 @@ if ('onhashchange' in window) { 101 } 102 ] 103 -104 before <end-restore-sandbox> [ +104 before <end-restore-sandbox> [ 105 { 106 filename <- append filename, [.out] 107 contents <- slurp resources, filename @@ -172,7 +172,7 @@ if ('onhashchange' in window) { 111 ] 112 113 # clicks on sandbox responses save it as 'expected' -114 after <global-touch> [ +114 after <global-touch> [ 115 # check if it's inside the output of any sandbox 116 { 117 sandbox-left-margin:num <- get *current-sandbox, left:offset @@ -244,7 +244,7 @@ if ('onhashchange' in window) { 183 ] 184 185 # when rendering a sandbox, color it in red/green if expected response exists -186 after <render-sandbox-response> [ +186 after <render-sandbox-response> [ 187 { 188 break-unless sandbox-response 189 *sandbox <- put *sandbox, response-starting-row-on-screen:offset, row @@ -263,7 +263,7 @@ if ('onhashchange' in window) { 202 } 203 ] 204 -205 before <end-render-sandbox-reset-hidden> [ +205 before <end-render-sandbox-reset-hidden> [ 206 *sandbox <- put *sandbox, response-starting-row-on-screen:offset, 0 207 ] diff --git a/html/edit/010-sandbox-trace.mu.html b/html/edit/010-sandbox-trace.mu.html index 39f7c7b8..1d33d9a5 100644 --- a/html/edit/010-sandbox-trace.mu.html +++ b/html/edit/010-sandbox-trace.mu.html @@ -241,7 +241,7 @@ if ('onhashchange' in window) { 180 ] 181 182 # clicks on sandbox code toggle its display-trace? flag -183 after <global-touch> [ +183 after <global-touch> [ 184 # check if it's inside the code of any sandbox 185 { 186 sandbox-left-margin:num <- get *current-sandbox, left:offset @@ -302,7 +302,7 @@ if ('onhashchange' in window) { 241 ] 242 243 # when rendering a sandbox, dump its trace before response/warning if display-trace? property is set -244 after <render-sandbox-results> [ +244 after <render-sandbox-results> [ 245 { 246 display-trace?:bool <- get *sandbox, display-trace?:offset 247 break-unless display-trace? @@ -310,7 +310,7 @@ if ('onhashchange' in window) { 249 break-unless sandbox-trace # nothing to print; move on 250 row, screen <- render-text screen, sandbox-trace, left, right, 245/grey, row 251 } -252 <render-sandbox-trace-done> +252 <render-sandbox-trace-done> 253 ] diff --git a/html/edit/011-errors.mu.html b/html/edit/011-errors.mu.html index cd2cf200..ee653626 100644 --- a/html/edit/011-errors.mu.html +++ b/html/edit/011-errors.mu.html @@ -84,7 +84,7 @@ if ('onhashchange' in window) { 23 errors-found? <- copy 0/false 24 ] 25 - 26 before <render-components-end> [ + 26 before <render-components-end> [ 27 trace 11, [app], [render status] 28 recipe-errors:text <- get *env, recipe-errors:offset 29 { @@ -93,7 +93,7 @@ if ('onhashchange' in window) { 32 } 33 ] 34 - 35 before <render-recipe-components-end> [ + 35 before <render-recipe-components-end> [ 36 { 37 recipe-errors:text <- get *env, recipe-errors:offset 38 break-unless recipe-errors @@ -105,15 +105,15 @@ if ('onhashchange' in window) { 44 error-index:num # index of first sandbox with an error (or -1 if none) 45 ] 46 - 47 after <programming-environment-initialization> [ + 47 after <programming-environment-initialization> [ 48 *result <- put *result, error-index:offset, -1 49 ] 50 - 51 after <run-sandboxes-begin> [ + 51 after <run-sandboxes-begin> [ 52 *env <- put *env, error-index:offset, -1 53 ] 54 - 55 before <run-sandboxes-end> [ + 55 before <run-sandboxes-end> [ 56 { 57 error-index:num <- get *env, error-index:offset 58 sandboxes-completed-successfully?:bool <- equal error-index, -1 @@ -122,7 +122,7 @@ if ('onhashchange' in window) { 61 } 62 ] 63 - 64 before <render-components-end> [ + 64 before <render-components-end> [ 65 { 66 break-if recipe-errors 67 error-index:num <- get *env, error-index:offset @@ -164,7 +164,7 @@ if ('onhashchange' in window) { 103 ] 104 105 # make sure we render any trace -106 after <render-sandbox-trace-done> [ +106 after <render-sandbox-trace-done> [ 107 { 108 sandbox-errors:text <- get *sandbox, errors:offset 109 break-unless sandbox-errors diff --git a/html/edit/012-editor-undo.mu.html b/html/edit/012-editor-undo.mu.html index 452c9809..aa6ef95e 100644 --- a/html/edit/012-editor-undo.mu.html +++ b/html/edit/012-editor-undo.mu.html @@ -122,7 +122,7 @@ if ('onhashchange' in window) { 61 ] 62 63 # ctrl-z - undo operation - 64 after <handle-special-character> [ + 64 after <handle-special-character> [ 65 { 66 undo?:bool <- equal c, 26/ctrl-z 67 break-unless undo? @@ -134,13 +134,13 @@ if ('onhashchange' in window) { 73 redo:&:list:&:operation <- get *editor, redo:offset 74 redo <- push op, redo 75 *editor <- put *editor, redo:offset, redo - 76 <handle-undo> + 76 <handle-undo> 77 return 1/go-render 78 } 79 ] 80 81 # ctrl-y - redo operation - 82 after <handle-special-character> [ + 82 after <handle-special-character> [ 83 { 84 redo?:bool <- equal c, 25/ctrl-y 85 break-unless redo? @@ -152,7 +152,7 @@ if ('onhashchange' in window) { 91 undo:&:list:&:operation <- get *editor, undo:offset 92 undo <- push op, undo 93 *editor <- put *editor, undo:offset, undo - 94 <handle-redo> + 94 <handle-redo> 95 return 1/go-render 96 } 97 ] @@ -235,13 +235,13 @@ if ('onhashchange' in window) { 174 ] 175 176 # enter operations never coalesce with typing before or after - 177 after <insert-enter-begin> [ + 177 after <insert-enter-begin> [ 178 cursor-row-before:num <- copy cursor-row 179 cursor-column-before:num <- copy cursor-column 180 top-before:&:duplex-list:char <- get *editor, top-of-screen:offset 181 cursor-before:&:duplex-list:char <- get *editor, before-cursor:offset 182 ] - 183 before <insert-enter-end> [ + 183 before <insert-enter-end> [ 184 top-after:&:duplex-list:char <- get *editor, top-of-screen:offset 185 cursor-row:num <- get *editor, cursor-row:offset 186 cursor-column:num <- get *editor, cursor-row:offset @@ -269,7 +269,7 @@ if ('onhashchange' in window) { 208 *editor <- put *editor, redo:offset, redo 209 ] 210 - 211 after <handle-undo> [ + 211 after <handle-undo> [ 212 { 213 typing:insert-operation, is-insert?:bool <- maybe-convert *op, typing:variant 214 break-unless is-insert? @@ -469,7 +469,7 @@ if ('onhashchange' in window) { 408 ] 409 ] 410 - 411 after <handle-redo> [ + 411 after <handle-redo> [ 412 { 413 typing:insert-operation, is-insert?:bool <- maybe-convert *op, typing:variant 414 break-unless is-insert? @@ -810,7 +810,7 @@ if ('onhashchange' in window) { 749 +done-adding-move-operation 750 ] 751 - 752 after <handle-undo> [ + 752 after <handle-undo> [ 753 { 754 move:move-operation, is-move?:bool <- maybe-convert *op, move:variant 755 break-unless is-move? @@ -1446,7 +1446,7 @@ if ('onhashchange' in window) { 1385 ] 1386 ] 1387 -1388 after <handle-redo> [ +1388 after <handle-redo> [ 1389 { 1390 move:move-operation, is-move?:bool <- maybe-convert *op, move:variant 1391 break-unless is-move? @@ -1675,10 +1675,10 @@ if ('onhashchange' in window) { 1614 ] 1615 1616 # save operation to undo -1617 after <backspace-character-begin> [ +1617 after <backspace-character-begin> [ 1618 top-before:&:duplex-list:char <- get *editor, top-of-screen:offset 1619 ] -1620 before <backspace-character-end> [ +1620 before <backspace-character-end> [ 1621 { 1622 break-unless backspaced-cell # backspace failed; don't add an undo operation 1623 top-after:&:duplex-list:char <- get *editor, top-of-screen:offset @@ -1714,7 +1714,7 @@ if ('onhashchange' in window) { 1653 } 1654 ] 1655 -1656 after <handle-undo> [ +1656 after <handle-undo> [ 1657 { 1658 deletion:delete-operation, is-delete?:bool <- maybe-convert *op, delete:variant 1659 break-unless is-delete? @@ -1734,7 +1734,7 @@ if ('onhashchange' in window) { 1673 } 1674 ] 1675 -1676 after <handle-redo> [ +1676 after <handle-redo> [ 1677 { 1678 deletion:delete-operation, is-delete?:bool <- maybe-convert *op, delete:variant 1679 break-unless is-delete? @@ -1901,10 +1901,10 @@ if ('onhashchange' in window) { 1840 ] 1841 ] 1842 -1843 after <delete-character-begin> [ +1843 after <delete-character-begin> [ 1844 top-before:&:duplex-list:char <- get *editor, top-of-screen:offset 1845 ] -1846 before <delete-character-end> [ +1846 before <delete-character-end> [ 1847 { 1848 break-unless deleted-cell # delete failed; don't add an undo operation 1849 top-after:&:duplex-list:char <- get *editor, top-of-screen:offset @@ -2027,10 +2027,10 @@ if ('onhashchange' in window) { 1966 ] 1967 ] 1968 -1969 after <delete-to-end-of-line-begin> [ +1969 after <delete-to-end-of-line-begin> [ 1970 top-before:&:duplex-list:char <- get *editor, top-of-screen:offset 1971 ] -1972 before <delete-to-end-of-line-end> [ +1972 before <delete-to-end-of-line-end> [ 1973 { 1974 break-unless deleted-cells # delete failed; don't add an undo operation 1975 top-after:&:duplex-list:char <- get *editor, top-of-screen:offset @@ -2130,10 +2130,10 @@ if ('onhashchange' in window) { 2069 ] 2070 ] 2071 -2072 after <delete-to-start-of-line-begin> [ +2072 after <delete-to-start-of-line-begin> [ 2073 top-before:&:duplex-list:char <- get *editor, top-of-screen:offset 2074 ] -2075 before <delete-to-start-of-line-end> [ +2075 before <delete-to-start-of-line-end> [ 2076 { 2077 break-unless deleted-cells # delete failed; don't add an undo operation 2078 top-after:&:duplex-list:char <- get *editor, top-of-screen:offset diff --git a/linkify/003linkify.cc b/linkify/003linkify.cc index 40eec81d..8f97a1d7 100644 --- a/linkify/003linkify.cc +++ b/linkify/003linkify.cc @@ -18,7 +18,6 @@ // single definition but there's still multiple overloads (say I defined // 'clear()' on some type, and it's already defined on STL classes) // - ctags misses some symbols in layered code -// - Mu's before/after blocks should point to the location of their labels struct syminfo { string filename; @@ -40,12 +39,28 @@ bool starts_with(const string& s, const string& pat) { return b == pat.end(); } +void encode_some_html_entities(string& s) { + std::string::size_type pos = 0; + while (true) { + pos = s.find_first_of("<>", pos); + if (pos == std::string::npos) break; + std::string replacement; + switch (s.at(pos)) { + case '<': replacement = "<"; break; + case '>': replacement = ">"; break; + } + s.replace(pos, 1, replacement); + pos += replacement.size(); + }; +} + void read_tags(const string& filename, map& info) { ifstream in(filename); //& cerr << "reading " << filename << '\n'; string dummy; while (has_data(in)) { string symbol; in >> symbol; + encode_some_html_entities(symbol); //& cerr << symbol << '\n'; if (info.find(symbol) != info.end()) { info[symbol].line_num = -1; -- cgit 1.4.1-2-gfad0