diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-01-27 19:59:29 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-01-27 19:59:29 -0800 |
commit | 0d3f30c21164b9fd722455e9fc60cdb0add2a866 (patch) | |
tree | c8b87736fd7c330f2b305923cb992998266f459f /edit | |
parent | 50689bff2ed59814a67e74e90a33717552d69df0 (diff) | |
download | mu-0d3f30c21164b9fd722455e9fc60cdb0add2a866.tar.gz |
2610 - warn when recipes don't use default-space
Somehow this never transferred over from the Arc version until now.
Diffstat (limited to 'edit')
-rw-r--r-- | edit/005-sandbox.mu | 21 | ||||
-rw-r--r-- | edit/010-warnings.mu | 7 |
2 files changed, 19 insertions, 9 deletions
diff --git a/edit/005-sandbox.mu b/edit/005-sandbox.mu index 568c7cb1..244c24f6 100644 --- a/edit/005-sandbox.mu +++ b/edit/005-sandbox.mu @@ -446,6 +446,7 @@ scenario run-updates-results [ # define a recipe (no indent for the 'add' line below so column numbers are more obvious) 1:address:shared:array:character <- new [ recipe foo [ +local-scope z:number <- add 2, 2 reply z ]] @@ -461,15 +462,16 @@ reply z . run (F4) . . ┊ . .recipe foo [ ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. - .z:number <- add 2, 2 ┊0 x. - .reply z ┊foo . - .] ┊4 . - .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. + .local-scope ┊0 x. + .z:number <- add 2, 2 ┊foo . + .reply z ┊4 . + .] ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. + .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊ . . ┊ . ] # make a change (incrementing one of the args to 'add'), then rerun assume-console [ - left-click 3, 28 # one past the value of the second arg + left-click 4, 28 # one past the value of the second arg press backspace type [3] press F4 @@ -482,10 +484,11 @@ reply z . run (F4) . . ┊ . .recipe foo [ ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. - .z:number <- add 2, 3 ┊0 x. - .reply z ┊foo . - .] ┊5 . - .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. + .local-scope ┊0 x. + .z:number <- add 2, 3 ┊foo . + .reply z ┊5 . + .] ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. + .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊ . . ┊ . ] ] diff --git a/edit/010-warnings.mu b/edit/010-warnings.mu index c37e31e2..5220ad3e 100644 --- a/edit/010-warnings.mu +++ b/edit/010-warnings.mu @@ -415,6 +415,7 @@ scenario run-shows-get-on-non-container-warnings [ assume-screen 100/width, 15/height 1:address:shared:array:character <- new [ recipe foo [ + local-scope x:address:shared:point <- new point:type get x:address:shared:point, 1:offset ]] @@ -430,6 +431,7 @@ recipe foo [ . errors found run (F4) . . ┊foo . .recipe foo [ ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. + . local-scope ┊ . . x:address:shared:point <- new point:type ┊ . . get x:address:shared:point, 1:offset ┊ . .] ┊ . @@ -445,6 +447,7 @@ scenario run-shows-non-literal-get-argument-warnings [ assume-screen 100/width, 15/height 1:address:shared:array:character <- new [ recipe foo [ + local-scope x:number <- copy 0 y:address:shared:point <- new point:type get *y:address:shared:point, x:number @@ -461,6 +464,7 @@ recipe foo [ . errors found run (F4) . . ┊foo . .recipe foo [ ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. + . local-scope ┊ . . x:number <- copy 0 ┊ . . y:address:shared:point <- new point:type ┊ . . get *y:address:shared:point, x:number ┊ . @@ -480,6 +484,7 @@ scenario run-shows-warnings-everytime [ assume-screen 100/width, 15/height 1:address:shared:array:character <- new [ recipe foo [ + local-scope x:number <- copy y:number ]] 2:address:shared:array:character <- new [foo] @@ -492,6 +497,7 @@ recipe foo [ . errors found run (F4) . . ┊foo . .recipe foo [ ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. + . local-scope ┊ . . x:number <- copy y:number ┊ . .] ┊ . .foo: use before set: y ┊ . @@ -509,6 +515,7 @@ recipe foo [ . errors found run (F4) . . ┊foo . .recipe foo [ ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. + . local-scope ┊ . . x:number <- copy y:number ┊ . .] ┊ . .foo: use before set: y ┊ . |