about summary refs log tree commit diff stats
path: root/edit/002-typing.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 /edit/002-typing.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 'edit/002-typing.mu')
-rw-r--r--edit/002-typing.mu6
1 files changed, 3 insertions, 3 deletions
diff --git a/edit/002-typing.mu b/edit/002-typing.mu
index 2f94f362..12448e18 100644
--- a/edit/002-typing.mu
+++ b/edit/002-typing.mu
@@ -29,7 +29,7 @@ def editor-event-loop screen:&:screen, console:&:console, editor:&:editor -> scr
     {
       break-unless is-touch?
       move-cursor-in-editor screen, editor, t
-      loop +next-event:label
+      loop +next-event
     }
     # keyboard events
     {
@@ -125,7 +125,7 @@ def snap-cursor screen:&:screen, editor:&:editor, target-row:num, target-column:
       column <- copy left
       curr <- next curr
       prev <- next prev
-      loop +next-character:label
+      loop +next-character
     }
     {
       # at right? wrap. even if there's only one more letter left; we need
@@ -135,7 +135,7 @@ def snap-cursor screen:&:screen, editor:&:editor, target-row:num, target-column:
       column <- copy left
       row <- add row, 1
       # don't increment curr/prev
-      loop +next-character:label
+      loop +next-character
     }
     curr <- next curr
     prev <- next prev