From 63513e9fdb400ee9319640ab6c3d03058a20df61 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 21 Mar 2017 08:44:22 -0700 Subject: 3806 --- sandbox/001-editor.mu | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'sandbox') diff --git a/sandbox/001-editor.mu b/sandbox/001-editor.mu index dab475fb..60042344 100644 --- a/sandbox/001-editor.mu +++ b/sandbox/001-editor.mu @@ -413,8 +413,7 @@ def get-color color:num, c:char -> color:num [ starting-comment?:bool <- equal c, 35/# break-unless starting-comment? trace 90, [app], [switch color back to blue] - color <- copy 12/lightblue - jump +exit + return 12/lightblue } # if color is blue and next character is newline, switch color to white { @@ -423,16 +422,14 @@ def get-color color:num, c:char -> color:num [ ending-comment?:bool <- equal c, 10/newline break-unless ending-comment? trace 90, [app], [switch color back to white] - color <- copy 7/white - jump +exit + return 7/white } # if color is white (no comments) and next character is '<', switch color to red { break-unless color-is-white? starting-assignment?:bool <- equal c, 60/< break-unless starting-assignment? - color <- copy 1/red - jump +exit + return 1/red } # if color is red and next character is space, switch color to white { @@ -440,11 +437,9 @@ def get-color color:num, c:char -> color:num [ break-unless color-is-red? ending-assignment?:bool <- equal c, 32/space break-unless ending-assignment? - color <- copy 7/white - jump +exit + return 7/white } # otherwise no change - +exit return color ] -- cgit 1.4.1-2-gfad0