about summary refs log tree commit diff stats
path: root/sandbox/012-editor-undo.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-10-22 12:08:10 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-10-22 12:08:10 -0700
commitada5eb55cb185edf30dcac48b25cc485d44677ef (patch)
treee147838f053a582e33146ac4fc4ab30ac8434e0e /sandbox/012-editor-undo.mu
parenta6deb48067f8049922f16ed3489896f7749fd39f (diff)
downloadmu-ada5eb55cb185edf30dcac48b25cc485d44677ef.tar.gz
3552
Stop requiring jump instructions to explicitly provide a ':label' type
for jump targets.

This has been a source of repeated confusion for my students:
  a) They'd add the ':label' to the label definition rather than the
  jump target (label use)
  b) They'd spend time thinking about whether the initial '+' prefix was
  part of the label name.

In the process I cleaned up a couple of things:

  - the space of names is more cleanly partitioned into labels and
    non-labels (clarifying that '_' and '-' are non-label prefixes)
  - you can't use label names as regular variables anymore
  - you can infer the type of a label just from its name
Diffstat (limited to 'sandbox/012-editor-undo.mu')
-rw-r--r--sandbox/012-editor-undo.mu8
1 files changed, 4 insertions, 4 deletions
diff --git a/sandbox/012-editor-undo.mu b/sandbox/012-editor-undo.mu
index ce8c9e21..27f49377 100644
--- a/sandbox/012-editor-undo.mu
+++ b/sandbox/012-editor-undo.mu
@@ -162,7 +162,7 @@ before <insert-character-end> [
     typing <- put typing, after-column:offset, cursor-column
     typing <- put typing, after-top-of-screen:offset, top-after
     *op <- merge 0/insert-operation, typing
-    break +done-adding-insert-operation:label
+    break +done-adding-insert-operation
   }
   # if not, create a new operation
   insert-from:&:duplex-list:char <- next cursor-before
@@ -742,7 +742,7 @@ before <move-cursor-end> [
     move <- put move, after-column:offset, cursor-column
     move <- put move, after-top-of-screen:offset, top-after
     *op <- merge 1/move-operation, move
-    break +done-adding-move-operation:label
+    break +done-adding-move-operation
   }
   op:&:operation <- new operation:type
   *op <- merge 1/move-operation, cursor-row-before, cursor-column-before, top-before, cursor-row/after, cursor-column/after, top-after, undo-coalesce-tag
@@ -1441,7 +1441,7 @@ before <backspace-character-end> [
       deletion <- put deletion, after-column:offset, cursor-column
       deletion <- put deletion, after-top-of-screen:offset, top-after
       *op <- merge 2/delete-operation, deletion
-      break +done-adding-backspace-operation:label
+      break +done-adding-backspace-operation
     }
     # if not, create a new operation
     op:&:operation <- new operation:type
@@ -1668,7 +1668,7 @@ before <delete-character-end> [
       deletion <- put deletion, after-column:offset, cursor-column
       deletion <- put deletion, after-top-of-screen:offset, top-after
       *op <- merge 2/delete-operation, deletion
-      break +done-adding-delete-operation:label
+      break +done-adding-delete-operation
     }
     # if not, create a new operation
     op:&:operation <- new operation:type