diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-05-13 09:09:22 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-05-13 09:11:16 -0700 |
commit | 01caf342d072115c27926b1a61c2fc75ab9fbee0 (patch) | |
tree | 72d8a05a5e90c61f4cbab201e3b2d6625199bb8f | |
parent | 12cc442f4aa4286150aa12316e74da38bc35b96c (diff) | |
download | mu-01caf342d072115c27926b1a61c2fc75ab9fbee0.tar.gz |
1362
Mu allows us to use multiple ingredients/products without commas, but make sure we don't. $ grep "<- [^ ]\+ [^#\[,]* [^#\[,]*$" * $ grep "^[ ]*[^ #,][^#,]* [^#,]* <- " *
-rw-r--r-- | 023jump.cc | 8 | ||||
-rw-r--r-- | 040brace.cc | 2 | ||||
-rw-r--r-- | 071print.mu | 12 | ||||
-rw-r--r-- | 074keyboard.mu | 4 | ||||
-rw-r--r-- | chessboard.mu | 4 |
5 files changed, 15 insertions, 15 deletions
diff --git a/023jump.cc b/023jump.cc index 807113f3..0ce916e0 100644 --- a/023jump.cc +++ b/023jump.cc @@ -56,7 +56,7 @@ case JUMP_IF: { :(scenario jump_if) recipe main [ - jump-if 999:literal 1:offset + jump-if 999:literal, 1:offset 1:integer <- copy 1:literal ] +run: instruction main/0 @@ -67,7 +67,7 @@ recipe main [ :(scenario jump_if_fallthrough) recipe main [ - jump-if 0:literal 1:offset + jump-if 0:literal, 1:offset 123:integer <- copy 1:literal ] +run: instruction main/0 @@ -96,7 +96,7 @@ case JUMP_UNLESS: { :(scenario jump_unless) recipe main [ - jump-unless 0:literal 1:offset + jump-unless 0:literal, 1:offset 1:integer <- copy 1:literal ] +run: instruction main/0 @@ -107,7 +107,7 @@ recipe main [ :(scenario jump_unless_fallthrough) recipe main [ - jump-unless 999:literal 1:offset + jump-unless 999:literal, 1:offset 123:integer <- copy 1:literal ] +run: instruction main/0 diff --git a/040brace.cc b/040brace.cc index 224dbf96..4eed9abb 100644 --- a/040brace.cc +++ b/040brace.cc @@ -380,7 +380,7 @@ recipe test-factorial [ 1:integer <- copy 5:literal 2:integer <- copy 1:literal { - 3:boolean <- equal 1:integer 1:literal + 3:boolean <- equal 1:integer, 1:literal break-if 3:boolean # $print 1:integer 2:integer <- multiply 2:integer, 1:integer diff --git a/071print.mu b/071print.mu index d6c72b32..f864eef9 100644 --- a/071print.mu +++ b/071print.mu @@ -218,9 +218,9 @@ recipe move-cursor [ # if x exists, move cursor in fake screen { break-unless x:address:screen - row:address:integer <- get-address x:address:screen/deref cursor-row:offset + row:address:integer <- get-address x:address:screen/deref, cursor-row:offset row:address:integer/deref <- copy new-row:integer - column:address:integer <- get-address x:address:screen/deref cursor-column:offset + column:address:integer <- get-address x:address:screen/deref, cursor-column:offset column:address:integer/deref <- copy new-column:integer reply x:address:screen/same-as-ingredient:0 } @@ -263,7 +263,7 @@ recipe cursor-down [ { # if row < height height:integer <- get x:address:screen/deref, num-rows:offset - row:address:integer <- get-address x:address:screen/deref cursor-row:offset + row:address:integer <- get-address x:address:screen/deref, cursor-row:offset at-bottom?:boolean <- greater-or-equal row:address:integer/deref, height:integer break-if at-bottom?:boolean # row = row+1 @@ -289,7 +289,7 @@ recipe cursor-up [ break-unless x:address:screen { # if row >= 0 - row:address:integer <- get-address x:address:screen/deref cursor-row:offset + row:address:integer <- get-address x:address:screen/deref, cursor-row:offset at-top?:boolean <- lesser-than row:address:integer/deref, 0:literal break-if at-top?:boolean # row = row-1 @@ -311,7 +311,7 @@ recipe cursor-right [ { # if column < width width:integer <- get x:address:screen/deref, num-columns:offset - column:address:integer <- get-address x:address:screen/deref cursor-column:offset + column:address:integer <- get-address x:address:screen/deref, cursor-column:offset at-bottom?:boolean <- greater-or-equal column:address:integer/deref, width:integer break-if at-bottom?:boolean # column = column+1 @@ -332,7 +332,7 @@ recipe cursor-left [ break-unless x:address:screen { # if column >= 0 - column:address:integer <- get-address x:address:screen/deref cursor-column:offset + column:address:integer <- get-address x:address:screen/deref, cursor-column:offset at-top?:boolean <- lesser-than column:address:integer/deref, 0:literal break-if at-top?:boolean # column = column-1 diff --git a/074keyboard.mu b/074keyboard.mu index 7149a290..dd7740e9 100644 --- a/074keyboard.mu +++ b/074keyboard.mu @@ -9,11 +9,11 @@ container keyboard [ # can't think of another word like screen/display, so real recipe init-fake-keyboard [ default-space:address:array:location <- new location:type, 30:literal result:address:keyboard <- new keyboard:type - buf:address:address:array:character <- get-address result:address:keyboard/deref data:offset + buf:address:address:array:character <- get-address result:address:keyboard/deref, data:offset #? $start-tracing #? 1 buf:address:address:array:character/deref <- next-ingredient #? $stop-tracing #? 1 - idx:address:integer <- get-address result:address:keyboard/deref index:offset + idx:address:integer <- get-address result:address:keyboard/deref, index:offset idx:address:integer/deref <- copy 0:literal reply result:address:keyboard ] diff --git a/chessboard.mu b/chessboard.mu index adae42b9..93867fd4 100644 --- a/chessboard.mu +++ b/chessboard.mu @@ -316,7 +316,7 @@ recipe read-rank [ #? ] #? 1 # assert'1' <= rank <= '8' { - above-min:boolean <- greater-or-equal rank:integer 0:literal + above-min:boolean <- greater-or-equal rank:integer, 0:literal break-if above-min:boolean error-message:address:array:character <- new [rank too low: ] print-string screen:address, error-message:address:array:character @@ -324,7 +324,7 @@ recipe read-rank [ reply 0:literal/dummy, 0:literal/quit, 1:literal/error } { - below-max:boolean <- lesser-or-equal rank:integer 7:literal + below-max:boolean <- lesser-or-equal rank:integer, 7:literal break-if below-max:boolean error-message:address:array:character <- new [rank too high: ] print-string screen:address, error-message:address:array:character |