From 3e1349d29fa00db1fab3a811b60bc9d8de0355e4 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 30 Sep 2016 10:45:14 -0700 Subject: 3431 Improvements to syntax highlighting, particularly for Mu code in C++ files. --- html/010vm.cc.html | 3 +- html/011load.cc.html | 43 +++--- html/014literal_string.cc.html | 29 ++-- html/015literal_noninteger.cc.html | 7 +- html/016dilated_reagent.cc.html | 13 +- html/017parse_tree.cc.html | 14 +- html/018type_abbreviations.cc.html | 34 +++-- html/020run.cc.html | 35 ++--- html/021check_instruction.cc.html | 15 +- html/022arithmetic.cc.html | 89 +++++------ html/023boolean.cc.html | 21 +-- html/024jump.cc.html | 33 ++-- html/025compare.cc.html | 49 +++--- html/026call.cc.html | 17 ++- html/027call_ingredient.cc.html | 25 +-- html/028call_reply.cc.html | 21 +-- html/029tools.cc.html | 17 ++- html/030container.cc.html | 92 +++++------ html/031merge.cc.html | 30 ++-- html/032array.cc.html | 50 +++--- html/033exclusive_container.cc.html | 94 ++++++------ html/034address.cc.html | 37 ++--- html/035lookup.cc.html | 69 ++++----- html/036refcount.cc.html | 144 +++++++++--------- html/037abandon.cc.html | 64 ++++---- html/038new_text.cc.html | 23 +-- html/040brace.cc.html | 55 +++---- html/041jump_target.cc.html | 31 ++-- html/042name.cc.html | 37 ++--- html/043space.cc.html | 58 +++---- html/044space_surround.cc.html | 11 +- html/045closure_name.cc.html | 25 +-- html/046global.cc.html | 15 +- html/047check_type_by_name.cc.html | 25 +-- html/050scenario.cc.html | 66 ++++---- html/051scenario_test.mu.html | 2 +- html/052tangle.cc.html | 85 +++++------ html/053recipe_header.cc.html | 75 ++++----- html/054static_dispatch.cc.html | 108 ++++++------- html/055shape_shifting_container.cc.html | 106 ++++++------- html/056shape_shifting_recipe.cc.html | 210 +++++++++++++------------- html/057immutable.cc.html | 188 +++++++++++------------ html/059to_text.mu.html | 4 +- html/060rewrite_literal_string.cc.html | 9 +- html/061text.mu.html | 12 +- html/062convert_ingredients_to_text.cc.html | 26 ++-- html/063array.mu.html | 6 +- html/064list.mu.html | 10 +- html/065duplex_list.mu.html | 10 +- html/066stream.mu.html | 6 +- html/068random.mu.html | 6 +- html/069hash.cc.html | 60 ++++---- html/070table.mu.html | 12 +- html/071recipe.cc.html | 59 ++++---- html/072scheduler.cc.html | 81 +++++----- html/073wait.cc.html | 58 +++---- html/074deep_copy.cc.html | 108 ++++++------- html/075channel.mu.html | 14 +- html/081print.mu.html | 6 +- html/082scenario_screen.cc.html | 16 +- html/083scenario_screen_test.mu.html | 2 +- html/084console.mu.html | 6 +- html/085scenario_console.cc.html | 5 +- html/086scenario_console_test.mu.html | 5 +- html/088file.mu.html | 4 +- html/089scenario_filesystem.cc.html | 25 +-- html/090scenario_filesystem_test.mu.html | 6 +- html/101run_sandboxed.cc.html | 29 ++-- html/channel.mu.html | 4 +- html/chessboard.mu.html | 12 +- html/console.mu.html | 4 +- html/counters.mu.html | 2 +- html/display.mu.html | 2 +- html/edit/001-editor.mu.html | 8 +- html/edit/002-typing.mu.html | 46 +++--- html/edit/003-shortcuts.mu.html | 47 +++--- html/edit/004-programming-environment.mu.html | 22 +-- html/edit/005-sandbox.mu.html | 22 +-- html/edit/006-sandbox-copy.mu.html | 17 +-- html/edit/007-sandbox-delete.mu.html | 29 ++-- html/edit/008-sandbox-edit.mu.html | 21 ++- html/edit/009-sandbox-test.mu.html | 10 +- html/edit/010-sandbox-trace.mu.html | 8 +- html/edit/011-errors.mu.html | 20 +-- html/edit/012-editor-undo.mu.html | 86 +++++------ html/example1.mu.html | 2 +- html/factorial.mu.html | 6 +- html/filesystem.mu.html | 4 +- html/fork.mu.html | 6 +- html/global.mu.html | 2 +- html/immutable-error.mu.html | 2 +- html/lambda-to-mu.mu.html | 18 +-- html/mutable.mu.html | 2 +- html/nqueens.mu.html | 4 +- html/real-files.mu.html | 2 +- html/screen.mu.html | 2 +- html/server-socket.mu.html | 4 +- html/static-dispatch.mu.html | 2 +- html/tangle.mu.html | 4 +- html/x.mu.html | 2 +- mu.vim | 29 ++-- vimrc.vim | 12 ++ 102 files changed, 1644 insertions(+), 1569 deletions(-) diff --git a/html/010vm.cc.html b/html/010vm.cc.html index 3955c7cd..341348d3 100644 --- a/html/010vm.cc.html +++ b/html/010vm.cc.html @@ -15,6 +15,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } .cSpecial { color: #008000; } +.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .SalientComment { color: #00ffff; } @@ -290,7 +291,7 @@ restore_snapshots(); //:: Helpers :(code) -recipe::recipe() { +recipe::recipe() { // End recipe Constructor } diff --git a/html/011load.cc.html b/html/011load.cc.html index bf642aaf..febd4f72 100644 --- a/html/011load.cc.html +++ b/html/011load.cc.html @@ -16,12 +16,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color .Constant { color: #00a0a0; } .traceAbsent { color: #c00000; } .cSpecial { color: #008000; } -.traceContains { color: #008000; } +.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.Identifier { color: #fcb165; } --> @@ -37,7 +38,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color :(scenarios load) // use 'load' instead of 'run' in all scenarios in this layer :(scenario first_recipe) -def main [ +def main [ 1:number <- copy 23 ] +parse: instruction: copy @@ -264,7 +265,7 @@ Disable_redefine_checks = false} :(scenario recipe_instead_of_def) -recipe main [ +recipe main [ 1:number <- copy 23 ] +parse: instruction: copy @@ -273,10 +274,10 @@ recipe main [ :(scenario parse_comment_outside_recipe) # this comment will be dropped by the tangler, so we need a dummy recipe to stop that -def f1 [ +def f1 [ ] # this comment will go through to 'load' -def main [ +def main [ 1:number <- copy 23 ] +parse: instruction: copy @@ -284,7 +285,7 @@ def main [ +parse: product: {1: "number"} :(scenario parse_comment_amongst_instruction) -def main [ +def main [ # comment 1:number <- copy 23 ] @@ -293,7 +294,7 @@ def main [ +parse: product: {1: "number"} :(scenario parse_comment_amongst_instruction_2) -def main [ +def main [ # comment 1:number <- copy 23 # comment @@ -303,7 +304,7 @@ def main [ +parse: product: {1: "number"} :(scenario parse_comment_amongst_instruction_3) -def main [ +def main [ 1:number <- copy 23 # comment 2:number <- copy 23 @@ -316,7 +317,7 @@ def main [ +parse: product: {2: "number"} :(scenario parse_comment_after_instruction) -def main [ +def main [ 1:number <- copy 23 # comment ] +parse: instruction: copy @@ -324,19 +325,19 @@ def main [ +parse: product: {1: "number"} :(scenario parse_label) -def main [ +def main [ +foo ] +parse: label: +foo :(scenario parse_dollar_as_recipe_name) -def main [ +def main [ $foo ] +parse: instruction: $foo :(scenario parse_multiple_properties) -def main [ +def main [ 1:number <- copy 23/foo:bar:baz ] +parse: instruction: copy @@ -344,7 +345,7 @@ def main [ +parse: product: {1: "number"} :(scenario parse_multiple_products) -def main [ +def main [ 1:number, 2:number <- copy 23 ] +parse: instruction: copy @@ -353,7 +354,7 @@ def main [ +parse: product: {2: "number"} :(scenario parse_multiple_ingredients) -def main [ +def main [ 1:number, 2:number <- copy 23, 4:number ] +parse: instruction: copy @@ -363,7 +364,7 @@ def main [ +parse: product: {2: "number"} :(scenario parse_multiple_types) -def main [ +def main [ 1:number, 2:address:number <- copy 23, 4:number ] +parse: instruction: copy @@ -373,7 +374,7 @@ def main [ +parse: product: {2: ("address" "number")} :(scenario parse_properties) -def main [ +def main [ 1:address:number/lookup <- copy 23 ] +parse: product: {1: ("address" "number"), "lookup": ()} @@ -390,19 +391,19 @@ def main [ :(scenario forbid_redefining_recipes) % Hide_errors = true; -def main [ +def main [ 1:number <- copy 23 ] -def main [ +def main [ 1:number <- copy 24 ] +error: redefining recipe main :(scenario permit_forcibly_redefining_recipes) -def main [ +def main [ 1:number <- copy 23 ] -def! main [ +def! main [ 1:number <- copy 24 ] -error: redefining recipe main diff --git a/html/014literal_string.cc.html b/html/014literal_string.cc.html index 10456661..c19da0af 100644 --- a/html/014literal_string.cc.html +++ b/html/014literal_string.cc.html @@ -15,12 +15,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } .cSpecial { color: #008000; } -.traceContains { color: #008000; } +.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.Identifier { color: #fcb165; } --> @@ -42,13 +43,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color :(scenarios load) :(scenario string_literal) -def main [ +def main [ 1:address:array:character <- copy [abc def] ] +parse: ingredient: {"abc def": "literal-string"} :(scenario string_literal_with_colons) -def main [ +def main [ 1:address:array:character <- copy [abc:def/ghi] ] +parse: ingredient: {"abc:def/ghi": "literal-string"} @@ -202,26 +203,26 @@ string emit_literal_string(string name} :(scenario string_literal_nested) -def main [ +def main [ 1:address:array:character <- copy [abc [def]] ] +parse: ingredient: {"abc [def]": "literal-string"} :(scenario string_literal_escaped) -def main [ +def main [ 1:address:array:character <- copy [abc \[def] ] +parse: ingredient: {"abc [def": "literal-string"} :(scenario string_literal_escaped_twice) -def main [ +def main [ 1:address:array:character <- copy [ abc \\[def] ] +parse: ingredient: {"\nabc \[def": "literal-string"} :(scenario string_literal_and_comment) -def main [ +def main [ 1:address:array:character <- copy [abc] # comment ] +parse: --- defining main @@ -231,14 +232,14 @@ def main [ +parse: product: {1: ("address" "array" "character")} :(scenario string_literal_escapes_newlines_in_trace) -def main [ +def main [ copy [abc -def] +def] ] +parse: ingredient: {"abc\ndef": "literal-string"} :(scenario string_literal_can_skip_past_comments) -def main [ +def main [ copy [ # ']' inside comment bar @@ -247,15 +248,15 @@ def main [ +parse: ingredient: {"\n # ']' inside comment\n bar\n ": "literal-string"} :(scenario string_literal_empty) -def main [ +def main [ copy [] ] +parse: ingredient: {"": "literal-string"} :(scenario multiple_unfinished_recipes) % Hide_errors = true; -def f1 [ -def f2 [ +def f1 [ +def f2 [ +error: unbalanced '[' diff --git a/html/015literal_noninteger.cc.html b/html/015literal_noninteger.cc.html index c8fd93f3..dd45673a 100644 --- a/html/015literal_noninteger.cc.html +++ b/html/015literal_noninteger.cc.html @@ -15,12 +15,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } .cSpecial { color: #008000; } -.traceContains { color: #008000; } +.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.Identifier { color: #fcb165; } --> @@ -36,7 +37,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color :(scenarios load) :(scenario noninteger_literal) -def main [ +def main [ 1:number <- copy 3.14159 ] +parse: ingredient: {3.14159: "literal-fractional-number"} diff --git a/html/016dilated_reagent.cc.html b/html/016dilated_reagent.cc.html index 3454ae68..65d8ba2e 100644 --- a/html/016dilated_reagent.cc.html +++ b/html/016dilated_reagent.cc.html @@ -15,14 +15,15 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } -.traceContains { color: #008000; } +.muRecipe { color: #ff8700; } .cSpecial { color: #008000; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Error { color: #ffffff; background-color: #ff6060; padding-bottom: 1px; } .PreProc { color: #800080; } +.Identifier { color: #fcb165; } --> @@ -40,27 +41,27 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color :(scenarios load) :(scenario dilated_reagent) -def main [ +def main [ {1: number, foo: bar} <- copy 34 ] +parse: product: {1: "number", "foo": "bar"} :(scenario load_trailing_space_after_curly_bracket) -def main [ +def main [ # line below has a space at the end { ] # successfully parsed :(scenario dilated_reagent_with_comment) -def main [ +def main [ {1: number, foo: bar} <- copy 34 # test comment ] +parse: product: {1: "number", "foo": "bar"} $error: 0 :(scenario dilated_reagent_with_comment_immediately_following) -def main [ +def main [ 1:number <- copy {34: literal} # test comment ] $error: 0 diff --git a/html/017parse_tree.cc.html b/html/017parse_tree.cc.html index c9cfae37..0ff64fb1 100644 --- a/html/017parse_tree.cc.html +++ b/html/017parse_tree.cc.html @@ -14,12 +14,14 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background- body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } -.traceContains { color: #008000; } +.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.muData { color: #ffff00; } +.Identifier { color: #fcb165; } --> @@ -46,7 +48,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color :(scenarios load) :(scenario dilated_reagent_with_nested_brackets) -def main [ +def main [ {1: number, foo: (bar (baz quux))} <- copy 34 ] +parse: product: {1: "number", "foo": ("bar" ("baz" "quux"))} @@ -114,13 +116,13 @@ string_tree* parse_string_tree(istream& in:(scenario dilated_reagent_with_type_tree) % Hide_errors = true; // 'map' isn't defined yet -def main [ +def main [ {1: (foo (address array character) (bar number))} <- copy 34 ] # just to avoid errors -container foo [ +container foo [ ] -container bar [ +container bar [ ] +parse: product: {1: ("foo" ("address" "array" "character") ("bar" "number"))} diff --git a/html/018type_abbreviations.cc.html b/html/018type_abbreviations.cc.html index abb190c1..342d614b 100644 --- a/html/018type_abbreviations.cc.html +++ b/html/018type_abbreviations.cc.html @@ -13,15 +13,17 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.Constant { color: #00a0a0; } +.muData { color: #ffff00; } .cSpecial { color: #008000; } -.traceContains { color: #008000; } +.muRecipe { color: #ff8700; } .SalientComment { color: #00ffff; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.Constant { color: #00a0a0; } +.Identifier { color: #fcb165; } --> @@ -37,8 +39,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color :(scenarios transform) :(scenario type_abbreviations) -type foo = number -def main [ +type foo = number +def main [ a:foo <- copy 34 ] +transform: product type after expanding abbreviations: "number" @@ -106,28 +108,28 @@ string_tree* parse_string_list(:(scenario type_error1) % Hide_errors = true; -type foo +type foo +error: incomplete 'type' statement 'type foo' :(scenario type_error2) % Hide_errors = true; -type foo = +type foo = +error: incomplete 'type' statement 'type foo =' :(scenario type_error3) % Hide_errors = true; -type foo bar baz +type foo bar baz +error: 'type' statements must be of the form 'type <new type name> = <type expression>' but got 'type foo bar' :(scenario type_conflict_error) % Hide_errors = true; -type foo = bar -type foo = baz +type foo = bar +type foo = baz +error: 'type' conflict: 'foo' defined as both 'bar' and 'baz' :(scenario type_abbreviation_for_compound) -type foo = address:number -def main [ +type foo = address:number +def main [ a:foo <- copy 0 ] +transform: product type after expanding abbreviations: ("address" "number") @@ -165,8 +167,8 @@ put(Type_abbreviations,(Type_abbreviations, "char", new_type_tree("character")); :(scenario use_type_abbreviations_when_declaring_type_abbreviations) -type foo = &:num -def main [ +type foo = &:num +def main [ a:foo <- copy 0 ] +transform: product type after expanding abbreviations: ("address" "number") @@ -176,14 +178,14 @@ def main [ //: before we use them. :(scenario abbreviations_for_address_and_array) -def main [ +def main [ f 1:&:num # abbreviation for 'address:number' f 2:@:num # abbreviation for 'array:number' f 3:&:@:num # combining '&' and '@' f 4:&:&:@:&:@:num # ..any number of times f {5: (array (& num) 3)} # support for dilated reagents and more complex parse trees ] -def f [ +def f [ ] +transform: --- expand type abbreviations in recipe 'main' +transform: ingredient type after expanding abbreviations: ("address" "number") diff --git a/html/020run.cc.html b/html/020run.cc.html index fca868e8..ffecb92f 100644 --- a/html/020run.cc.html +++ b/html/020run.cc.html @@ -13,18 +13,19 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.Constant { color: #00a0a0; } -.traceAbsent { color: #c00000; } -.cSpecial { color: #008000; } -.traceContains { color: #008000; } .SalientComment { color: #00ffff; } -.Comment { color: #9090ff; } +.CommentedCode { color: #6c6c6c; } +.muRecipe { color: #ff8700; } +.traceContains { color: #008000; } .Delimiter { color: #800080; } +.Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.cSpecial { color: #008000; } +.traceAbsent { color: #c00000; } +.Comment { color: #9090ff; } +.Constant { color: #00a0a0; } .Special { color: #c00000; } .Identifier { color: #fcb165; } -.Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } .PreProc { color: #800080; } -.CommentedCode { color: #6c6c6c; } --> @@ -48,14 +49,14 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color //: another. Later layers will add more primitives. :(scenario copy_literal) -def main [ +def main [ 1:num <- copy 23 ] +run: {1: "number"} <- copy {23: "literal"} +mem: storing 23 in location 1 :(scenario copy) -def main [ +def main [ 1:num <- copy 23 2:num <- copy 1:num ] @@ -64,7 +65,7 @@ def main [ +mem: storing 23 in location 2 :(scenario copy_multiple) -def main [ +def main [ 1:num, 2:num <- copy 23, 24 ] +mem: storing 23 in location 1 @@ -401,7 +402,7 @@ vector<double> read_memory} :(scenario run_label) -def main [ +def main [ +foo 1:num <- copy 23 2:num <- copy 1:num @@ -411,14 +412,14 @@ def main [ -run: +foo :(scenario run_dummy) -def main [ +def main [ _ <- copy 0 ] +run: _ <- copy {0: "literal"} :(scenario write_to_0_disallowed) % Hide_errors = true; -def main [ +def main [ 0:num <- copy 34 ] -mem: storing 34 in location 0 @@ -427,25 +428,25 @@ def main [ //: to put spaces around the '<-'. :(scenario comma_without_space) -def main [ +def main [ 1:num, 2:num <- copy 2,2 ] +mem: storing 2 in location 1 :(scenario space_without_comma) -def main [ +def main [ 1:num, 2:num <- copy 2 2 ] +mem: storing 2 in location 1 :(scenario comma_before_space) -def main [ +def main [ 1:num, 2:num <- copy 2, 2 ] +mem: storing 2 in location 1 :(scenario comma_after_space) -def main [ +def main [ 1:num, 2:num <- copy 2 ,2 ] +mem: storing 2 in location 1 diff --git a/html/021check_instruction.cc.html b/html/021check_instruction.cc.html index 111355b4..bd53bd82 100644 --- a/html/021check_instruction.cc.html +++ b/html/021check_instruction.cc.html @@ -15,6 +15,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } .Special { color: #c00000; } +.muRecipe { color: #ff8700; } .traceContains { color: #008000; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } @@ -79,34 +80,34 @@ Transform.push_back(:(scenario copy_checks_reagent_count) % Hide_errors = true; -def main [ +def main [ 1:num <- copy 34, 35 ] +error: main: ingredients and products should match in '1:num <- copy 34, 35' :(scenario write_scalar_to_array_disallowed) % Hide_errors = true; -def main [ +def main [ 1:array:num <- copy 34 ] +error: main: can't copy '34' to '1:array:num'; types don't match :(scenario write_scalar_to_array_disallowed_2) % Hide_errors = true; -def main [ +def main [ 1:num, 2:array:num <- copy 34, 35 ] +error: main: can't copy '35' to '2:array:num'; types don't match :(scenario write_scalar_to_address_disallowed) % Hide_errors = true; -def main [ +def main [ 1:address:num <- copy 34 ] +error: main: can't copy '34' to '1:address:num'; types don't match :(scenario write_address_to_number_allowed) -def main [ +def main [ 1:address:num <- copy 12/unsafe 2:num <- copy 1:address:num ] @@ -114,7 +115,7 @@ def main [ $error: 0 :(scenario write_boolean_to_number_allowed) -def main [ +def main [ 1:bool <- copy 1/true 2:num <- copy 1:bool ] @@ -122,7 +123,7 @@ def main [ $error: 0 :(scenario write_number_to_boolean_allowed) -def main [ +def main [ 1:num <- copy 34 2:bool <- copy 1:num ] diff --git a/html/022arithmetic.cc.html b/html/022arithmetic.cc.html index 476f505a..c8fefec6 100644 --- a/html/022arithmetic.cc.html +++ b/html/022arithmetic.cc.html @@ -15,6 +15,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } .Special { color: #c00000; } +.muRecipe { color: #ff8700; } .traceContains { color: #008000; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } @@ -70,13 +71,13 @@ put(Recipe_ordinal,} :(scenario add_literal) -def main [ +def main [ 1:num <- add 23, 34 ] +mem: storing 57 in location 1 :(scenario add) -def main [ +def main [ 1:num <- copy 23 2:num <- copy 34 3:num <- add 1:num, 2:num @@ -84,21 +85,21 @@ def main [ +mem: storing 57 in location 3 :(scenario add_multiple) -def main [ +def main [ 1:num <- add 3, 4, 5 ] +mem: storing 12 in location 1 :(scenario add_checks_type) % Hide_errors = true; -def main [ +def main [ 1:num <- add 2:bool, 1 ] +error: main: 'add' requires number ingredients, but got '2:bool' :(scenario add_checks_return_type) % Hide_errors = true; -def main [ +def main [ 1:address:num <- add 2, 2 ] +error: main: 'add' should yield a number, but got '1:address:num' @@ -145,13 +146,13 @@ put(Recipe_ordinal,} :(scenario subtract_literal) -def main [ +def main [ 1:num <- subtract 5, 2 ] +mem: storing 3 in location 1 :(scenario subtract) -def main [ +def main [ 1:num <- copy 23 2:num <- copy 34 3:num <- subtract 1:num, 2:num @@ -159,7 +160,7 @@ def main [ +mem: storing -11 in location 3 :(scenario subtract_multiple) -def main [ +def main [ 1:num <- subtract 6, 3, 2 ] +mem: storing 1 in location 1 @@ -198,13 +199,13 @@ put(Recipe_ordinal,} :(scenario multiply_literal) -def main [ +def main [ 1:num <- multiply 2, 3 ] +mem: storing 6 in location 1 :(scenario multiply) -def main [ +def main [ 1:num <- copy 4 2:num <- copy 6 3:num <- multiply 1:num, 2:num @@ -212,7 +213,7 @@ def main [ +mem: storing 24 in location 3 :(scenario multiply_multiple) -def main [ +def main [ 1:num <- multiply 2, 3, 4 ] +mem: storing 24 in location 1 @@ -254,13 +255,13 @@ put(Recipe_ordinal,} :(scenario divide_literal) -def main [ +def main [ 1:num <- divide 8, 2 ] +mem: storing 4 in location 1 :(scenario divide) -def main [ +def main [ 1:num <- copy 27 2:num <- copy 3 3:num <- divide 1:num, 2:num @@ -268,7 +269,7 @@ def main [ +mem: storing 9 in location 3 :(scenario divide_multiple) -def main [ +def main [ 1:num <- divide 12, 3, 2 ] +mem: storing 2 in location 1 @@ -322,14 +323,14 @@ put(Recipe_ordinal,} :(scenario divide_with_remainder_literal) -def main [ +def main [ 1:num, 2:num <- divide-with-remainder 9, 2 ] +mem: storing 4 in location 1 +mem: storing 1 in location 2 :(scenario divide_with_remainder) -def main [ +def main [ 1:num <- copy 27 2:num <- copy 11 3:num, 4:num <- divide-with-remainder 1:num, 2:num @@ -338,20 +339,20 @@ def main [ +mem: storing 5 in location 4 :(scenario divide_with_decimal_point) -def main [ +def main [ 1:num <- divide 5, 2 ] +mem: storing 2.5 in location 1 :(scenario divide_by_zero) -def main [ +def main [ 1:num <- divide 4, 0 ] +mem: storing inf in location 1 :(scenario divide_by_zero_2) % Hide_errors = true; -def main [ +def main [ 1:num <- divide-with-remainder 4, 0 ] # integer division can't return floating-point infinity @@ -399,32 +400,32 @@ put(Recipe_ordinal,} :(scenario shift_left_by_zero) -def main [ +def main [ 1:num <- shift-left 1, 0 ] +mem: storing 1 in location 1 :(scenario shift_left_1) -def main [ +def main [ 1:num <- shift-left 1, 4 ] +mem: storing 16 in location 1 :(scenario shift_left_2) -def main [ +def main [ 1:num <- shift-left 3, 2 ] +mem: storing 12 in location 1 :(scenario shift_left_by_negative) % Hide_errors = true; -def main [ +def main [ 1:num <- shift-left 3, -1 ] +error: main: second ingredient can't be negative in '1:num <- shift-left 3, -1' :(scenario shift_left_ignores_fractional_part) -def main [ +def main [ 1:num <- divide 3, 2 2:num <- shift-left 1:num, 1 ] @@ -470,32 +471,32 @@ put(Recipe_ordinal,} :(scenario shift_right_by_zero) -def main [ +def main [ 1:num <- shift-right 1, 0 ] +mem: storing 1 in location 1 :(scenario shift_right_1) -def main [ +def main [ 1:num <- shift-right 1024, 1 ] +mem: storing 512 in location 1 :(scenario shift_right_2) -def main [ +def main [ 1:num <- shift-right 3, 1 ] +mem: storing 1 in location 1 :(scenario shift_right_by_negative) % Hide_errors = true; -def main [ +def main [ 1:num <- shift-right 4, -1 ] +error: main: second ingredient can't be negative in '1:num <- shift-right 4, -1' :(scenario shift_right_ignores_fractional_part) -def main [ +def main [ 1:num <- divide 3, 2 2:num <- shift-right 1:num, 1 ] @@ -536,25 +537,25 @@ put(Recipe_ordinal,} :(scenario and_bits_1) -def main [ +def main [ 1:num <- and-bits 8, 3 ] +mem: storing 0 in location 1 :(scenario and_bits_2) -def main [ +def main [ 1:num <- and-bits 3, 2 ] +mem: storing 2 in location 1 :(scenario and_bits_3) -def main [ +def main [ 1:num <- and-bits 14, 3 ] +mem: storing 2 in location 1 :(scenario and_bits_negative) -def main [ +def main [ 1:num <- and-bits -3, 4 ] +mem: storing 4 in location 1 @@ -594,19 +595,19 @@ put(Recipe_ordinal,} :(scenario or_bits_1) -def main [ +def main [ 1:num <- or-bits 3, 8 ] +mem: storing 11 in location 1 :(scenario or_bits_2) -def main [ +def main [ 1:num <- or-bits 3, 10 ] +mem: storing 11 in location 1 :(scenario or_bits_3) -def main [ +def main [ 1:num <- or-bits 4, 6 ] +mem: storing 6 in location 1 @@ -646,19 +647,19 @@ put(Recipe_ordinal,} :(scenario xor_bits_1) -def main [ +def main [ 1:num <- xor-bits 3, 8 ] +mem: storing 11 in location 1 :(scenario xor_bits_2) -def main [ +def main [ 1:num <- xor-bits 3, 10 ] +mem: storing 9 in location 1 :(scenario xor_bits_3) -def main [ +def main [ 1:num <- xor-bits 4, 6 ] +mem: storing 2 in location 1 @@ -697,25 +698,25 @@ put(Recipe_ordinal,} :(scenario flip_bits_zero) -def main [ +def main [ 1:num <- flip-bits 0 ] +mem: storing -1 in location 1 :(scenario flip_bits_negative) -def main [ +def main [ 1:num <- flip-bits -1 ] +mem: storing 0 in location 1 :(scenario flip_bits_1) -def main [ +def main [ 1:num <- flip-bits 3 ] +mem: storing -4 in location 1 :(scenario flip_bits_2) -def main [ +def main [ 1:num <- flip-bits 12 ] +mem: storing -13 in location 1 @@ -744,7 +745,7 @@ put(Recipe_ordinal,} :(scenario round_to_nearest_integer) -def main [ +def main [ 1:num <- round 12.2 ] +mem: storing 12 in location 1 diff --git a/html/023boolean.cc.html b/html/023boolean.cc.html index 0faab3e0..38d2a665 100644 --- a/html/023boolean.cc.html +++ b/html/023boolean.cc.html @@ -15,6 +15,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } .Special { color: #c00000; } +.muRecipe { color: #ff8700; } .traceContains { color: #008000; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } @@ -67,7 +68,7 @@ put(Recipe_ordinal,} :(scenario and) -def main [ +def main [ 1:bool <- copy 1 2:bool <- copy 0 3:bool <- and 1:bool, 2:bool @@ -75,19 +76,19 @@ def main [ +mem: storing 0 in location 3 :(scenario and_2) -def main [ +def main [ 1:bool <- and 1, 1 ] +mem: storing 1 in location 1 :(scenario and_multiple) -def main [ +def main [ 1:bool <- and 1, 1, 0 ] +mem: storing 0 in location 1 :(scenario and_multiple_2) -def main [ +def main [ 1:bool <- and 1, 1, 1 ] +mem: storing 1 in location 1 @@ -125,7 +126,7 @@ put(Recipe_ordinal,} :(scenario or) -def main [ +def main [ 1:bool <- copy 1 2:bool <- copy 0 3:bool <- or 1:bool, 2:bool @@ -133,19 +134,19 @@ def main [ +mem: storing 1 in location 3 :(scenario or_2) -def main [ +def main [ 1:bool <- or 0, 0 ] +mem: storing 0 in location 1 :(scenario or_multiple) -def main [ +def main [ 1:bool <- and 0, 0, 0 ] +mem: storing 0 in location 1 :(scenario or_multiple_2) -def main [ +def main [ 1:bool <- or 0, 0, 1 ] +mem: storing 1 in location 1 @@ -185,14 +186,14 @@ put(Recipe_ordinal,} :(scenario not) -def main [ +def main [ 1:bool <- copy 1 2:bool <- not 1:bool ] +mem: storing 0 in location 2 :(scenario not_multiple) -def main [ +def main [ 1:bool, 2:bool, 3:bool <- not 1, 0, 1 ] +mem: storing 0 in location 1 diff --git a/html/024jump.cc.html b/html/024jump.cc.html index f222fa52..077373b7 100644 --- a/html/024jump.cc.html +++ b/html/024jump.cc.html @@ -16,12 +16,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color .Constant { color: #00a0a0; } .traceAbsent { color: #c00000; } .cSpecial { color: #008000; } -.traceContains { color: #008000; } +.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.Identifier { color: #fcb165; } --> @@ -36,8 +37,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color //: Jump primitives :(scenario jump_can_skip_instructions) -def main [ - jump 1:offset +def main [ + jump 1:offset 1:num <- copy 1 ] +run: jump {1: "offset"} @@ -73,11 +74,11 @@ put(Recipe_ordinal,(Type_ordinal, "offset", 0); :(scenario jump_backward) -def main [ - jump 1:offset # 0 -+ - jump 3:offset # | +-+ 1 +def main [ + jump 1:offset # 0 -+ + jump 3:offset # | +-+ 1 # \/ /\ | - jump -2:offset # 2 +-->+ | + jump -2:offset # 2 +-->+ | ] # \/ 3 +run: jump {1: "offset"} +run: jump {-2: "offset"} @@ -117,8 +118,8 @@ put(Recipe_ordinal,} :(scenario jump_if) -def main [ - jump-if 999, 1:offset +def main [ + jump-if 999, 1:offset 123:num <- copy 1 ] +run: jump-if {999: "literal"}, {1: "offset"} @@ -127,8 +128,8 @@ def main [ -mem: storing 1 in location 123 :(scenario jump_if_fallthrough) -def main [ - jump-if 0, 1:offset +def main [ + jump-if 0, 1:offset 123:num <- copy 1 ] +run: jump-if {0: "literal"}, {1: "offset"} @@ -170,8 +171,8 @@ put(Recipe_ordinal,} :(scenario jump_unless) -def main [ - jump-unless 0, 1:offset +def main [ + jump-unless 0, 1:offset 123:num <- copy 1 ] +run: jump-unless {0: "literal"}, {1: "offset"} @@ -180,8 +181,8 @@ def main [ -mem: storing 1 in location 123 :(scenario jump_unless_fallthrough) -def main [ - jump-unless 999, 1:offset +def main [ + jump-unless 999, 1:offset 123:num <- copy 1 ] +run: jump-unless {999: "literal"}, {1: "offset"} diff --git a/html/025compare.cc.html b/html/025compare.cc.html index 987b6602..805d3735 100644 --- a/html/025compare.cc.html +++ b/html/025compare.cc.html @@ -15,6 +15,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } .Special { color: #c00000; } +.muRecipe { color: #ff8700; } .traceContains { color: #008000; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } @@ -77,7 +78,7 @@ put(Recipe_ordinal,} :(scenario equal) -def main [ +def main [ 1:num <- copy 34 2:num <- copy 33 3:bool <- equal 1:num, 2:num @@ -87,7 +88,7 @@ def main [ +mem: storing 0 in location 3 :(scenario equal_2) -def main [ +def main [ 1:num <- copy 34 2:num <- copy 34 3:bool <- equal 1:num, 2:num @@ -97,13 +98,13 @@ def main [ +mem: storing 1 in location 3 :(scenario equal_multiple) -def main [ +def main [ 1:bool <- equal 34, 34, 34 ] +mem: storing 1 in location 1 :(scenario equal_multiple_2) -def main [ +def main [ 1:bool <- equal 34, 34, 35 ] +mem: storing 0 in location 1 @@ -143,7 +144,7 @@ put(Recipe_ordinal,} :(scenario not_equal) -def main [ +def main [ 1:num <- copy 34 2:num <- copy 33 3:bool <- not-equal 1:num, 2:num @@ -153,7 +154,7 @@ def main [ +mem: storing 1 in location 3 :(scenario not_equal_2) -def main [ +def main [ 1:num <- copy 34 2:num <- copy 34 3:bool <- not-equal 1:num, 2:num @@ -202,7 +203,7 @@ put(Recipe_ordinal,} :(scenario greater_than) -def main [ +def main [ 1:num <- copy 34 2:num <- copy 33 3:bool <- greater-than 1:num, 2:num @@ -210,7 +211,7 @@ def main [ +mem: storing 1 in location 3 :(scenario greater_than_2) -def main [ +def main [ 1:num <- copy 34 2:num <- copy 34 3:bool <- greater-than 1:num, 2:num @@ -218,13 +219,13 @@ def main [ +mem: storing 0 in location 3 :(scenario greater_than_multiple) -def main [ +def main [ 1:bool <- greater-than 36, 35, 34 ] +mem: storing 1 in location 1 :(scenario greater_than_multiple_2) -def main [ +def main [ 1:bool <- greater-than 36, 35, 35 ] +mem: storing 0 in location 1 @@ -269,7 +270,7 @@ put(Recipe_ordinal,} :(scenario lesser_than) -def main [ +def main [ 1:num <- copy 32 2:num <- copy 33 3:bool <- lesser-than 1:num, 2:num @@ -277,7 +278,7 @@ def main [ +mem: storing 1 in location 3 :(scenario lesser_than_2) -def main [ +def main [ 1:num <- copy 34 2:num <- copy 33 3:bool <- lesser-than 1:num, 2:num @@ -285,13 +286,13 @@ def main [ +mem: storing 0 in location 3 :(scenario lesser_than_multiple) -def main [ +def main [ 1:bool <- lesser-than 34, 35, 36 ] +mem: storing 1 in location 1 :(scenario lesser_than_multiple_2) -def main [ +def main [ 1:bool <- lesser-than 34, 35, 35 ] +mem: storing 0 in location 1 @@ -336,7 +337,7 @@ put(Recipe_ordinal,} :(scenario greater_or_equal) -def main [ +def main [ 1:num <- copy 34 2:num <- copy 33 3:bool <- greater-or-equal 1:num, 2:num @@ -344,7 +345,7 @@ def main [ +mem: storing 1 in location 3 :(scenario greater_or_equal_2) -def main [ +def main [ 1:num <- copy 34 2:num <- copy 34 3:bool <- greater-or-equal 1:num, 2:num @@ -352,7 +353,7 @@ def main [ +mem: storing 1 in location 3 :(scenario greater_or_equal_3) -def main [ +def main [ 1:num <- copy 34 2:num <- copy 35 3:bool <- greater-or-equal 1:num, 2:num @@ -360,13 +361,13 @@ def main [ +mem: storing 0 in location 3 :(scenario greater_or_equal_multiple) -def main [ +def main [ 1:bool <- greater-or-equal 36, 35, 35 ] +mem: storing 1 in location 1 :(scenario greater_or_equal_multiple_2) -def main [ +def main [ 1:bool <- greater-or-equal 36, 35, 36 ] +mem: storing 0 in location 1 @@ -411,7 +412,7 @@ put(Recipe_ordinal,} :(scenario lesser_or_equal) -def main [ +def main [ 1:num <- copy 32 2:num <- copy 33 3:bool <- lesser-or-equal 1:num, 2:num @@ -419,7 +420,7 @@ def main [ +mem: storing 1 in location 3 :(scenario lesser_or_equal_2) -def main [ +def main [ 1:num <- copy 33 2:num <- copy 33 3:bool <- lesser-or-equal 1:num, 2:num @@ -427,7 +428,7 @@ def main [ +mem: storing 1 in location 3 :(scenario lesser_or_equal_3) -def main [ +def main [ 1:num <- copy 34 2:num <- copy 33 3:bool <- lesser-or-equal 1:num, 2:num @@ -435,13 +436,13 @@ def main [ +mem: storing 0 in location 3 :(scenario lesser_or_equal_multiple) -def main [ +def main [ 1:bool <- lesser-or-equal 34, 35, 35 ] +mem: storing 1 in location 1 :(scenario lesser_or_equal_multiple_2) -def main [ +def main [ 1:bool <- lesser-or-equal 34, 35, 34 ] +mem: storing 0 in location 1 diff --git a/html/026call.cc.html b/html/026call.cc.html index fc0cd90d..4afc0186 100644 --- a/html/026call.cc.html +++ b/html/026call.cc.html @@ -15,13 +15,14 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } .cSpecial { color: #008000; } -.traceContains { color: #008000; } +.muRecipe { color: #ff8700; } .SalientComment { color: #00ffff; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.Identifier { color: #fcb165; } --> @@ -36,22 +37,22 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color //: So far the recipes we define can't run each other. Let's fix that. :(scenario calling_recipe) -def main [ +def main [ f ] -def f [ +def f [ 3:num <- add 2, 2 ] +mem: storing 4 in location 3 :(scenario return_on_fallthrough) -def main [ +def main [ f 1:num <- copy 0 2:num <- copy 0 3:num <- copy 0 ] -def f [ +def f [ 4:num <- copy 0 5:num <- copy 0 ] @@ -165,14 +166,14 @@ call& current_call() :(scenario calling_undefined_recipe_fails) % Hide_errors = true; -def main [ +def main [ foo ] +error: main: undefined operation in 'foo ' :(scenario calling_undefined_recipe_handles_missing_result) % Hide_errors = true; -def main [ +def main [ x:num <- foo ] +error: main: undefined operation in 'x:num <- foo ' diff --git a/html/027call_ingredient.cc.html b/html/027call_ingredient.cc.html index 95aed732..01d66d38 100644 --- a/html/027call_ingredient.cc.html +++ b/html/027call_ingredient.cc.html @@ -15,12 +15,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } .cSpecial { color: #008000; } -.traceContains { color: #008000; } +.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.Identifier { color: #fcb165; } --> @@ -36,20 +37,20 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color //: ingredients, use 'next-ingredient'. :(scenario next_ingredient) -def main [ +def main [ f 2 ] -def f [ +def f [ 12:num <- next-ingredient 13:num <- add 1, 12:num ] +mem: storing 3 in location 13 :(scenario next_ingredient_missing) -def main [ +def main [ f ] -def f [ +def f [ _, 12:num <- next-ingredient ] +mem: storing 0 in location 12 @@ -121,19 +122,19 @@ put(Recipe_ordinal,:(scenario next_ingredient_fail_on_missing) % Hide_errors = true; -def main [ +def main [ f ] -def f [ +def f [ 11:num <- next-ingredient ] +error: f: no ingredient to save in '11:num' :(scenario rewind_ingredients) -def main [ +def main [ f 2 ] -def f [ +def f [ 12:num <- next-ingredient # consume ingredient _, 1:bool <- next-ingredient # will not find any ingredients rewind-ingredients @@ -159,10 +160,10 @@ put(Recipe_ordinal,} :(scenario ingredient) -def main [ +def main [ f 1, 2 ] -def f [ +def f [ 12:num <- ingredient 1 # consume second ingredient first 13:num, 1:bool <- next-ingredient # next-ingredient tries to scan past that ] diff --git a/html/028call_reply.cc.html b/html/028call_reply.cc.html index 3e4de57d..cea9db3e 100644 --- a/html/028call_reply.cc.html +++ b/html/028call_reply.cc.html @@ -15,12 +15,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } .cSpecial { color: #008000; } -.traceContains { color: #008000; } +.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.Identifier { color: #fcb165; } --> @@ -35,10 +36,10 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color //: Calls can also generate products, using 'reply' or 'return'. :(scenario return) -def main [ +def main [ 1:num, 2:num <- f 34 ] -def f [ +def f [ 12:num <- next-ingredient 13:num <- add 1, 12:num reply 12:num, 13:num @@ -135,10 +136,10 @@ Transform.push_back(:(scenario return_type_mismatch) % Hide_errors = true; -def main [ +def main [ 3:num <- f 2 ] -def f [ +def f [ 12:num <- next-ingredient 13:num <- copy 35 14:point <- copy 12:point/raw @@ -153,22 +154,22 @@ def f [ :(scenario return_same_as_ingredient) % Hide_errors = true; -def main [ +def main [ 1:num <- copy 0 2:num <- test1 1:num # call with different ingredient and product ] -def test1 [ +def test1 [ 10:num <- next-ingredient return 10:num/same-as-ingredient:0 ] +error: main: '2:num <- test1 1:num' should write to '1:num' rather than '2:num' :(scenario return_same_as_ingredient_dummy) -def main [ +def main [ 1:num <- copy 0 _ <- test1 1:num # call with different ingredient and product ] -def test1 [ +def test1 [ 10:num <- next-ingredient return 10:num/same-as-ingredient:0 ] diff --git a/html/029tools.cc.html b/html/029tools.cc.html index 1005b991..f9e4f000 100644 --- a/html/029tools.cc.html +++ b/html/029tools.cc.html @@ -15,14 +15,15 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } .Special { color: #c00000; } -.traceContains { color: #008000; } +.CommentedCode { color: #6c6c6c; } +.muRecipe { color: #ff8700; } .SalientComment { color: #00ffff; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .cSpecial { color: #008000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } -.CommentedCode { color: #6c6c6c; } +.Identifier { color: #fcb165; } --> @@ -37,7 +38,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color //: Allow mu programs to log facts just like we've been doing in C++ so far. :(scenario trace) -def main [ +def main [ trace 1, [foo], [this is a trace in mu] ] +foo: this is a trace in mu @@ -97,19 +98,19 @@ put(Recipe_ordinal,} :(scenario stash_literal_string) -def main [ +def main [ stash [foo] ] +app: foo :(scenario stash_literal_number) -def main [ +def main [ stash [foo:], 4 ] +app: foo: 4 :(scenario stash_number) -def main [ +def main [ 1:num <- copy 34 stash [foo:], 1:num ] @@ -227,7 +228,7 @@ put(Recipe_ordinal,:(scenario assert) % Hide_errors = true; // '%' lines insert arbitrary C code into tests before calling 'run' with the lines below. Must be immediately after :(scenario) line. -def main [ +def main [ assert 0, [this is an assert in mu] ] +error: this is an assert in mu diff --git a/html/030container.cc.html b/html/030container.cc.html index 040af497..7bb979a9 100644 --- a/html/030container.cc.html +++ b/html/030container.cc.html @@ -16,13 +16,15 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color .Constant { color: #00a0a0; } .traceAbsent { color: #c00000; } .cSpecial { color: #008000; } -.traceContains { color: #008000; } +.muRecipe { color: #ff8700; } .SalientComment { color: #00ffff; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.muData { color: #ffff00; } +.Identifier { color: #fcb165; } --> @@ -52,7 +54,7 @@ get(Type, point//: container. Don't do this in general. I'm tagging exceptions with /unsafe to //: skip later checks. :(scenario copy_multiple_locations) -def main [ +def main [ 1:num <- copy 34 2:num <- copy 35 3:point <- copy 1:point/unsafe @@ -63,7 +65,7 @@ def main [ //: trying to copy to a differently-typed destination will fail :(scenario copy_checks_size) % Hide_errors = true; -def main [ +def main [ 2:point <- copy 1:num ] +error: main: can't copy '1:num' to '2:point'; types don't match @@ -79,7 +81,7 @@ get(Type, point_nu get(Type, point_number).elements.push_back(reagent("z:number")); :(scenario copy_handles_nested_container_elements) -def main [ +def main [ 12:num <- copy 34 13:num <- copy 35 14:num <- copy 36 @@ -89,10 +91,10 @@ def main [ //: products of recipes can include containers :(scenario return_container) -def main [ +def main [ 3:point <- f 2 ] -def f [ +def f [ 12:num <- next-ingredient 13:num <- copy 35 return 12:point/raw @@ -105,7 +107,7 @@ def f [ //: numbers, no matter how large they are. :(scenario compare_multiple_locations) -def main [ +def main [ 1:num <- copy 34 # first 2:num <- copy 35 3:num <- copy 36 @@ -117,7 +119,7 @@ def main [ +mem: storing 1 in location 7 :(scenario compare_multiple_locations_2) -def main [ +def main [ 1:num <- copy 34 # first 2:num <- copy 35 3:num <- copy 36 @@ -310,7 +312,7 @@ container_metadata& get(vector<pair<typ } :(scenario stash_container) -def main [ +def main [ 1:num <- copy 34 # first 2:num <- copy 35 3:num <- copy 36 @@ -448,10 +450,10 @@ def main [ //: appropriate element of the container value. :(scenario get) -def main [ +def main [ 12:num <- copy 34 13:num <- copy 35 - 15:num <- get 12:point/raw, 1:offset # unsafe + 15:num <- get 12:point/raw, 1:offset # unsafe ] +mem: storing 35 in location 15 @@ -540,62 +542,62 @@ put(Recipe_ordinal,} :(scenario get_handles_nested_container_elements) -def main [ +def main [ 12:num <- copy 34 13:num <- copy 35 14:num <- copy 36 - 15:num <- get 12:point-number/raw, 1:offset # unsafe + 15:num <- get 12:point-number/raw, 1:offset # unsafe ] +mem: storing 36 in location 15 :(scenario get_out_of_bounds) % Hide_errors = true; -def main [ +def main [ 12:num <- copy 34 13:num <- copy 35 14:num <- copy 36 - get 12:point-number/raw, 2:offset # point-number occupies 3 locations but has only 2 fields; out of bounds + get 12:point-number/raw, 2:offset # point-number occupies 3 locations but has only 2 fields; out of bounds ] +error: main: invalid offset '2' for 'point-number' :(scenario get_out_of_bounds_2) % Hide_errors = true; -def main [ +def main [ 12:num <- copy 34 13:num <- copy 35 14:num <- copy 36 - get 12:point-number/raw, -1:offset + get 12:point-number/raw, -1:offset ] +error: main: invalid offset '-1' for 'point-number' :(scenario get_product_type_mismatch) % Hide_errors = true; -def main [ +def main [ 12:num <- copy 34 13:num <- copy 35 14:num <- copy 36 - 15:address:num <- get 12:point-number/raw, 1:offset + 15:address:num <- get 12:point-number/raw, 1:offset ] +error: main: 'get 12:point-number/raw, 1:offset' should write to number but '15' has type (address number) //: we might want to call 'get' without saving the results, say in a sandbox :(scenario get_without_product) -def main [ +def main [ 12:num <- copy 34 13:num <- copy 35 - get 12:point/raw, 1:offset # unsafe + get 12:point/raw, 1:offset # unsafe ] # just don't die //:: To write to elements of containers, use 'put'. :(scenario put) -def main [ +def main [ 12:num <- copy 34 13:num <- copy 35 $clear-trace - 12:point <- put 12:point, 1:offset, 36 + 12:point <- put 12:point, 1:offset, 36 ] +mem: storing 36 in location 13 -mem: storing 34 in location 12 @@ -680,11 +682,11 @@ put(Recipe_ordinal,:(scenario put_product_error) % Hide_errors = true; -def main [ +def main [ local-scope load-ingredients 1:point <- merge 34, 35 - 3:point <- put 1:point, x:offset, 36 + 3:point <- put 1:point, x:offset, 36 ] +error: main: product of 'put' must be first ingredient '1:point', but got '3:point' @@ -692,7 +694,7 @@ def main [ :(scenarios load) :(scenario container) -container foo [ +container foo [ x:num y:num ] @@ -701,11 +703,11 @@ container foo [ +parse: element: {y: "number"} :(scenario container_use_before_definition) -container foo [ +container foo [ x:num y:bar ] -container bar [ +container bar [ x:num y:num ] @@ -724,18 +726,18 @@ container bar [ //: if a container is defined again, the new fields add to the original definition :(scenarios run) :(scenario container_extend) -container foo [ +container foo [ x:num ] # add to previous definition -container foo [ +container foo [ y:num ] -def main [ +def main [ 1:num <- copy 34 2:num <- copy 35 - 3:num <- get 1:foo, 0:offset - 4:num <- get 1:foo, 1:offset + 3:num <- get 1:foo, 0:offset + 4:num <- get 1:foo, 1:offset ] +mem: storing 34 in location 3 +mem: storing 35 in location 4 @@ -827,7 +829,7 @@ Num_calls_to_transform_all_at_first_definition = -1:(scenario multi_word_line_in_container_declaration) % Hide_errors = true; -container foo [ +container foo [ x:num y:num ] +error: container 'foo' contains multiple elements on a single line. Containers and exclusive containers must only contain elements, one to a line, no code. @@ -835,13 +837,13 @@ container foo [ //: support type abbreviations in container definitions :(scenario type_abbreviations_in_containers) -type foo = number -container bar [ +type foo = number +container bar [ x:foo ] -def main [ +def main [ 1:num <- copy 34 - 2:foo <- get 1:bar/unsafe, 0:offset + 2:foo <- get 1:bar/unsafe, 0:offset ] +mem: storing 34 in location 2 @@ -885,17 +887,17 @@ assert(Next_type_ordinal < :(scenario run_complains_on_unknown_types) % Hide_errors = true; -def main [ +def main [ # integer is not a type 1:integer <- copy 0 ] +error: main: unknown type integer in '1:integer <- copy 0' :(scenario run_allows_type_definition_after_use) -def main [ +def main [ 1:bar <- copy 0/unsafe ] -container bar [ +container bar [ x:num ] $error: 0 @@ -937,14 +939,14 @@ Transform.push_back(:(scenario container_unknown_field) % Hide_errors = true; -container foo [ +container foo [ x:num y:bar ] +error: foo: unknown type in y :(scenario read_container_with_bracket_in_comment) -container foo [ +container foo [ x:num # ']' in comment y:num @@ -954,7 +956,7 @@ container foo [ +parse: element: {y: "number"} :(scenario container_with_compound_field_type) -container foo [ +container foo [ {x: (address array (address array character))} ] $error: 0 diff --git a/html/031merge.cc.html b/html/031merge.cc.html index 9f3e8440..c2e9b5d0 100644 --- a/html/031merge.cc.html +++ b/html/031merge.cc.html @@ -13,15 +13,17 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.Constant { color: #00a0a0; } +.muData { color: #ffff00; } .cSpecial { color: #008000; } -.traceContains { color: #008000; } +.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } .PreProc { color: #800080; } +.Constant { color: #00a0a0; } +.Identifier { color: #fcb165; } --> @@ -36,11 +38,11 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color //: Construct types out of their constituent fields. :(scenario merge) -container foo [ +container foo [ x:num y:num ] -def main [ +def main [ 1:foo <- merge 3, 4 ] +mem: storing 3 in location 1 @@ -67,21 +69,21 @@ put(Recipe_ordinal,//: type-check 'merge' to avoid interpreting numbers as addresses :(scenario merge_check) -def main [ +def main [ 1:point <- merge 3, 4 ] $error: 0 :(scenario merge_check_missing_element) % Hide_errors = true; -def main [ +def main [ 1:point <- merge 3 ] +error: main: too few ingredients in '1:point <- merge 3' :(scenario merge_check_extra_element) % Hide_errors = true; -def main [ +def main [ 1:point <- merge 3, 4, 5 ] +error: main: too many ingredients in '1:point <- merge 3, 4, 5' @@ -92,7 +94,7 @@ def main [ //: container fields. :(scenario merge_check_recursive_containers) -def main [ +def main [ 1:point <- merge 3, 4 1:point-number <- merge 1:point, 5 ] @@ -100,28 +102,28 @@ $error: 0 :(scenario merge_check_recursive_containers_2) % Hide_errors = true; -def main [ +def main [ 1:point <- merge 3, 4 2:point-number <- merge 1:point ] +error: main: too few ingredients in '2:point-number <- merge 1:point' :(scenario merge_check_recursive_containers_3) -def main [ +def main [ 1:point-number <- merge 3, 4, 5 ] $error: 0 :(scenario merge_check_recursive_containers_4) % Hide_errors = true; -def main [ +def main [ 1:point-number <- merge 3, 4 ] +error: main: too few ingredients in '1:point-number <- merge 3, 4' :(scenario merge_check_reflexive) % Hide_errors = true; -def main [ +def main [ 1:point <- merge 3, 4 2:point <- merge 1:point ] @@ -246,7 +248,7 @@ Transform.push_back(:(scenario merge_check_product) % Hide_errors = true; -def main [ +def main [ 1:num <- merge 3 ] +error: main: 'merge' should yield a container in '1:num <- merge 3' diff --git a/html/032array.cc.html b/html/032array.cc.html index 77cfb88c..a9f545f9 100644 --- a/html/032array.cc.html +++ b/html/032array.cc.html @@ -15,13 +15,15 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } .cSpecial { color: #008000; } -.traceContains { color: #008000; } +.muRecipe { color: #ff8700; } .SalientComment { color: #00ffff; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.muData { color: #ffff00; } +.Identifier { color: #fcb165; } --> @@ -42,7 +44,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color //: You can create arrays using 'create-array'. :(scenario create_array) -def main [ +def main [ # create an array occupying locations 1 (for the size) and 2-4 (for the elements) 1:array:num:3 <- create-array ] @@ -111,7 +113,7 @@ put(Recipe_ordinal,# size in memory at run-time. We'll call a variable with an explicit size a # 'static' array, and one without a 'dynamic' array since it can contain # arrays of many different sizes. -def main [ +def main [ 1:array:num:3 <- create-array 2:num <- copy 14 3:num <- copy 15 @@ -124,7 +126,7 @@ def main [ +mem: storing 16 in location 8 :(scenario stash_array) -def main [ +def main [ 1:array:num:3 <- create-array 2:num <- copy 14 3:num <- copy 15 @@ -154,14 +156,14 @@ def main [ //: advance :(scenario container_permits_static_array_element) -container foo [ +container foo [ x:array:num:3 ] $error: 0 :(scenario container_disallows_dynamic_array_element) % Hide_errors = true; -container foo [ +container foo [ x:array:num ] +error: container 'foo' cannot determine size of element 'x' @@ -175,11 +177,11 @@ container foo [ } :(scenario merge_static_array_into_container) -container foo [ +container foo [ x:num y:array:num:3 ] -def main [ +def main [ 1:array:num:3 <- create-array 10:foo <- merge 34, 1:array:num:3 ] @@ -206,19 +208,19 @@ def main [ :(scenario code_inside_container) % Hide_errors = true; -container card [ +container card [ rank:num <- next-ingredient ] -def foo [ +def foo [ 1:card <- merge 3 - 2:num <- get 1:card rank:offset + 2:num <- get 1:card rank:offset ] # shouldn't die //:: To access elements of an array, use 'index' :(scenario index) -def main [ +def main [ 1:array:num:3 <- create-array 2:num <- copy 14 3:num <- copy 15 @@ -228,7 +230,7 @@ def main [ +mem: storing 14 in location 5 :(scenario index_compound_element) -def main [ +def main [ {1: (array (address number) 3)} <- create-array 2:num <- copy 14 3:num <- copy 15 @@ -238,7 +240,7 @@ def main [ +mem: storing 14 in location 5 :(scenario index_direct_offset) -def main [ +def main [ 1:array:num:3 <- create-array 2:num <- copy 14 3:num <- copy 15 @@ -342,7 +344,7 @@ type_tree* copy_array_element(:(scenario index_out_of_bounds) % Hide_errors = true; -def main [ +def main [ 1:array:num:3 <- create-array 2:num <- copy 14 3:num <- copy 15 @@ -356,7 +358,7 @@ def main [ :(scenario index_out_of_bounds_2) % Hide_errors = true; -def main [ +def main [ 1:array:point:3 <- create-array 2:num <- copy 14 3:num <- copy 15 @@ -370,7 +372,7 @@ def main [ :(scenario index_product_type_mismatch) % Hide_errors = true; -def main [ +def main [ 1:array:point:3 <- create-array 2:num <- copy 14 3:num <- copy 15 @@ -385,7 +387,7 @@ def main [ //: we might want to call 'index' without saving the results, say in a sandbox :(scenario index_without_product) -def main [ +def main [ 1:array:num:3 <- create-array 2:num <- copy 14 3:num <- copy 15 @@ -397,7 +399,7 @@ def main [ //:: To write to elements of arrays, use 'put'. :(scenario put_index) -def main [ +def main [ 1:array:num:3 <- create-array 2:num <- copy 14 3:num <- copy 15 @@ -478,7 +480,7 @@ put(Recipe_ordinal,:(scenario put_index_out_of_bounds) % Hide_errors = true; -def main [ +def main [ 1:array:point:3 <- create-array 2:num <- copy 14 3:num <- copy 15 @@ -493,7 +495,7 @@ def main [ :(scenario put_index_out_of_bounds_2) % Hide_errors = true; -def main [ +def main [ 1:array:point:3 <- create-array 2:num <- copy 14 3:num <- copy 15 @@ -508,7 +510,7 @@ def main [ :(scenario put_index_product_error) % Hide_errors = true; -def main [ +def main [ local-scope load-ingredients 1:array:num:3 <- create-array @@ -519,7 +521,7 @@ def main [ //:: compute the length of an array :(scenario array_length) -def main [ +def main [ 1:array:num:3 <- create-array 2:num <- copy 14 3:num <- copy 15 diff --git a/html/033exclusive_container.cc.html b/html/033exclusive_container.cc.html index f0d129e3..d2bc91c3 100644 --- a/html/033exclusive_container.cc.html +++ b/html/033exclusive_container.cc.html @@ -15,13 +15,15 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } .cSpecial { color: #008000; } -.traceContains { color: #008000; } +.muRecipe { color: #ff8700; } .SalientComment { color: #00ffff; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.muData { color: #ffff00; } +.Identifier { color: #fcb165; } --> @@ -55,7 +57,7 @@ get(Type, tmp//: checks in future layers from flagging them. :(scenario copy_exclusive_container) # Copying exclusive containers copies all their contents and an extra location for the tag. -def main [ +def main [ 1:num <- copy 1 # 'point' variant 2:num <- copy 34 3:num <- copy 35 @@ -104,11 +106,11 @@ def main [ put(Type_ordinal, "variant", 0); :(scenario maybe_convert) -def main [ +def main [ 12:num <- copy 1 13:num <- copy 35 14:num <- copy 36 - 20:point, 22:bool <- maybe-convert 12:number-or-point/unsafe, 1:variant + 20:point, 22:bool <- maybe-convert 12:number-or-point/unsafe, 1:variant ] # boolean +mem: storing 1 in location 22 @@ -117,11 +119,11 @@ def main [ +mem: storing 36 in location 21 :(scenario maybe_convert_fail) -def main [ +def main [ 12:num <- copy 1 13:num <- copy 35 14:num <- copy 36 - 20:num, 21:bool <- maybe-convert 12:number-or-point/unsafe, 0:variant + 20:num, 21:bool <- maybe-convert 12:number-or-point/unsafe, 0:variant ] # boolean +mem: storing 0 in location 21 @@ -234,27 +236,27 @@ put(Recipe_ordinal,:(scenario maybe_convert_product_type_mismatch) % Hide_errors = true; -def main [ +def main [ 12:num <- copy 1 13:num <- copy 35 14:num <- copy 36 - 20:num, 21:bool <- maybe-convert 12:number-or-point/unsafe, 1:variant + 20:num, 21:bool <- maybe-convert 12:number-or-point/unsafe, 1:variant ] +error: main: 'maybe-convert 12:number-or-point/unsafe, 1:variant' should write to point but '20' has type number :(scenario maybe_convert_dummy_product) -def main [ +def main [ 12:num <- copy 1 13:num <- copy 35 14:num <- copy 36 - _, 21:bool <- maybe-convert 12:number-or-point/unsafe, 1:variant + _, 21:bool <- maybe-convert 12:number-or-point/unsafe, 1:variant ] $error: 0 //:: Allow exclusive containers to be defined in mu code. :(scenario exclusive_container) -exclusive-container foo [ +exclusive-container foo [ x:num y:num ] @@ -271,25 +273,25 @@ exclusive-container foo [ //: fixed in advance :(scenario exclusive_container_contains_array) -exclusive-container foo [ +exclusive-container foo [ x:array:num:3 ] $error: 0 :(scenario exclusive_container_disallows_dynamic_array_element) % Hide_errors = true; -exclusive-container foo [ +exclusive-container foo [ x:array:num ] +error: container 'foo' cannot determine size of element 'x' //:: To construct exclusive containers out of variant types, use 'merge'. :(scenario lift_to_exclusive_container) -exclusive-container foo [ +exclusive-container foo [ x:num y:num ] -def main [ +def main [ 1:num <- copy 34 2:foo <- merge 0/x, 1:num # tag must be a literal when merging exclusive containers 4:foo <- merge 1/y, 1:num @@ -302,14 +304,14 @@ def main [ //: type-checking for 'merge' on exclusive containers :(scenario merge_handles_exclusive_container) -exclusive-container foo [ +exclusive-container foo [ x:num y:bar ] -container bar [ +container bar [ z:num ] -def main [ +def main [ 1:foo <- merge 0/x, 34 ] +mem: storing 0 in location 1 @@ -318,29 +320,29 @@ $error: 0 :(scenario merge_requires_literal_tag_for_exclusive_container) % Hide_errors = true; -exclusive-container foo [ +exclusive-container foo [ x:num y:bar ] -container bar [ +container bar [ z:num ] -def main [ +def main [ 1:num <- copy 0 2:foo <- merge 1:num, 34 ] +error: main: ingredient 0 of 'merge' should be a literal, for the tag of exclusive-container 'foo' in '2:foo <- merge 1:num, 34' :(scenario merge_handles_exclusive_container_inside_exclusive_container) -exclusive-container foo [ +exclusive-container foo [ x:num y:bar ] -exclusive-container bar [ +exclusive-container bar [ a:num b:num ] -def main [ +def main [ 1:num <- copy 0 2:bar <- merge 0/a, 34 4:foo <- merge 1/y, 2:bar @@ -376,15 +378,15 @@ $error: 0 } :(scenario merge_check_container_containing_exclusive_container) -container foo [ +container foo [ x:num y:bar ] -exclusive-container bar [ +exclusive-container bar [ x:num y:num ] -def main [ +def main [ 1:foo <- merge 23, 1/y, 34 ] +mem: storing 23 in location 1 @@ -394,29 +396,29 @@ $error: 0 :(scenario merge_check_container_containing_exclusive_container_2) % Hide_errors = true; -container foo [ +container foo [ x:num y:bar ] -exclusive-container bar [ +exclusive-container bar [ x:num y:num ] -def main [ +def main [ 1:foo <- merge 23, 1/y, 34, 35 ] +error: main: too many ingredients in '1:foo <- merge 23, 1/y, 34, 35' :(scenario merge_check_exclusive_container_containing_container) -exclusive-container foo [ +exclusive-container foo [ x:num y:bar ] -container bar [ +container bar [ x:num y:num ] -def main [ +def main [ 1:foo <- merge 1/y, 23, 34 ] +mem: storing 1 in location 1 @@ -425,44 +427,44 @@ def main [ $error: 0 :(scenario merge_check_exclusive_container_containing_container_2) -exclusive-container foo [ +exclusive-container foo [ x:num y:bar ] -container bar [ +container bar [ x:num y:num ] -def main [ +def main [ 1:foo <- merge 0/x, 23 ] $error: 0 :(scenario merge_check_exclusive_container_containing_container_3) % Hide_errors = true; -exclusive-container foo [ +exclusive-container foo [ x:num y:bar ] -container bar [ +container bar [ x:num y:num ] -def main [ +def main [ 1:foo <- merge 1/y, 23 ] +error: main: too few ingredients in '1:foo <- merge 1/y, 23' :(scenario merge_check_exclusive_container_containing_container_4) -exclusive-container foo [ +exclusive-container foo [ x:num y:bar ] -container bar [ +container bar [ a:num b:num ] -def main [ +def main [ 1:bar <- merge 23, 24 3:foo <- merge 1/y, 1:bar ] @@ -484,15 +486,15 @@ $error: 0 } :(scenario merge_exclusive_container_with_mismatched_sizes) -container foo [ +container foo [ x:num y:num ] -exclusive-container bar [ +exclusive-container bar [ x:num y:foo ] -def main [ +def main [ 1:num <- copy 34 2:num <- copy 35 3:bar <- merge 0/x, 1:num diff --git a/html/034address.cc.html b/html/034address.cc.html index ea739cf3..f7f575e0 100644 --- a/html/034address.cc.html +++ b/html/034address.cc.html @@ -15,13 +15,14 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } .cSpecial { color: #008000; } -.traceContains { color: #008000; } +.CommentedCode { color: #6c6c6c; } +.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } -.CommentedCode { color: #6c6c6c; } +.Identifier { color: #fcb165; } --> @@ -157,15 +158,15 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color :(scenario new) # call 'new' two times with identical types without modifying the results; you # should get back different results -def main [ - 1:address:num/raw <- new number:type - 2:address:num/raw <- new number:type +def main [ + 1:address:num/raw <- new number:type + 2:address:num/raw <- new number:type 3:bool/raw <- equal 1:address:num/raw, 2:address:num/raw ] +mem: storing 0 in location 3 :(scenario dilated_reagent_with_new) -def main [ +def main [ 1:address:address:num <- new {(address number): type} ] +new: size of ("address" "number") is 1 @@ -375,15 +376,15 @@ put(Recipe_ordinal,:(scenario new_initializes) % Memory_allocated_until = 10; % put(Memory, Memory_allocated_until, 1); -def main [ - 1:address:num <- new number:type +def main [ + 1:address:num <- new number:type ] +mem: storing 0 in location 10 :(scenario new_array) -def main [ - 1:address:array:num/raw <- new number:type, 5 - 2:address:num/raw <- new number:type +def main [ + 1:address:array:num/raw <- new number:type, 5 + 2:address:num/raw <- new number:type 3:num/raw <- subtract 2:address:num/raw, 1:address:array:num/raw ] +run: {1: ("address" "array" "number"), "raw": ()} <- new {number: "type"}, {5: "literal"} @@ -392,9 +393,9 @@ def main [ +mem: storing 7 in location 3 :(scenario new_empty_array) -def main [ - 1:address:array:num/raw <- new number:type, 0 - 2:address:num/raw <- new number:type +def main [ + 1:address:array:num/raw <- new number:type, 0 + 2:address:num/raw <- new number:type 3:num/raw <- subtract 2:address:num/raw, 1:address:array:num/raw ] +run: {1: ("address" "array" "number"), "raw": ()} <- new {number: "type"}, {0: "literal"} @@ -405,9 +406,9 @@ def main [ //: If a routine runs out of its initial allocation, it should allocate more. :(scenario new_overflow) % Initial_memory_per_routine = 3; // barely enough room for point allocation below -def main [ - 1:address:num/raw <- new number:type - 2:address:point/raw <- new point:type # not enough room in initial page +def main [ + 1:address:num/raw <- new number:type + 2:address:point/raw <- new point:type # not enough room in initial page ] +new: routine allocated memory from 1000 to 1003 +new: routine allocated memory from 1003 to 1006 diff --git a/html/035lookup.cc.html b/html/035lookup.cc.html index 967f4e6d..b9993bac 100644 --- a/html/035lookup.cc.html +++ b/html/035lookup.cc.html @@ -16,13 +16,14 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color .Constant { color: #00a0a0; } .traceAbsent { color: #c00000; } .cSpecial { color: #008000; } -.traceContains { color: #008000; } +.muRecipe { color: #ff8700; } .SalientComment { color: #00ffff; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.Identifier { color: #fcb165; } --> @@ -69,7 +70,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color //: 'new'. :(scenario copy_indirect) -def main [ +def main [ 1:address:num <- copy 10/unsafe 11:num <- copy 34 # This loads location 1 as an address and looks up *that* location. @@ -84,7 +85,7 @@ canonize(x); //: similarly, write to addresses pointing at other locations using the //: 'lookup' property :(scenario store_indirect) -def main [ +def main [ 1:address:num <- copy 10/unsafe 1:address:num/lookup <- copy 34 ] @@ -96,7 +97,7 @@ canonize(x); //: writes to address 0 always loudly fail :(scenario store_to_0_fails) % Hide_errors = true; -def main [ +def main [ 1:address:num <- copy 0 1:address:num/lookup <- copy 34 ] @@ -218,33 +219,33 @@ assert(!has_property(//: 'products' variables in run_current_routine(). :(scenario get_indirect) -def main [ +def main [ 1:address:point <- copy 10/unsafe # 10 reserved for refcount 11:num <- copy 34 12:num <- copy 35 - 2:num <- get 1:address:point/lookup, 0:offset + 2:num <- get 1:address:point/lookup, 0:offset ] +mem: storing 34 in location 2 :(scenario get_indirect2) -def main [ +def main [ 1:address:point <- copy 10/unsafe # 10 reserved for refcount 11:num <- copy 34 12:num <- copy 35 2:address:num <- copy 20/unsafe - 2:address:num/lookup <- get 1:address:point/lookup, 0:offset + 2:address:num/lookup <- get 1:address:point/lookup, 0:offset ] +mem: storing 34 in location 21 :(scenario include_nonlookup_properties) -def main [ +def main [ 1:address:point <- copy 10/unsafe # 10 reserved for refcount 11:num <- copy 34 12:num <- copy 35 - 2:num <- get 1:address:point/lookup/foo, 0:offset + 2:num <- get 1:address:point/lookup/foo, 0:offset ] +mem: storing 34 in location 2 @@ -256,12 +257,12 @@ def main [ canonize(base); :(scenario put_indirect) -def main [ +def main [ 1:address:point <- copy 10/unsafe # 10 reserved for refcount 11:num <- copy 34 12:num <- copy 35 - 1:address:point/lookup <- put 1:address:point/lookup, 0:offset, 36 + 1:address:point/lookup <- put 1:address:point/lookup, 0:offset, 36 ] +mem: storing 36 in location 11 @@ -274,12 +275,12 @@ canonize(base); :(scenario put_product_error_with_lookup) % Hide_errors = true; -def main [ +def main [ 1:address:point <- copy 10/unsafe # 10 reserved for refcount 11:num <- copy 34 12:num <- copy 35 - 1:address:point <- put 1:address:point/lookup, x:offset, 36 + 1:address:point <- put 1:address:point/lookup, x:offset, 36 ] +error: main: product of 'put' must be first ingredient '1:address:point/lookup', but got '1:address:point' @@ -295,8 +296,8 @@ reagent/*copy:(scenario new_error) % Hide_errors = true; -def main [ - 1:num/raw <- new number:type +def main [ + 1:num/raw <- new number:type ] +error: main: product of 'new' has incorrect type: '1:num/raw <- new number:type' @@ -304,7 +305,7 @@ def main [ canonize_type(product); :(scenario copy_array_indirect) -def main [ +def main [ # 10 reserved for refcount 11:array:num:3 <- create-array 12:num <- copy 14 @@ -319,7 +320,7 @@ def main [ +mem: storing 16 in location 5 :(scenario create_array_indirect) -def main [ +def main [ 1000:num/raw <- copy 1 # pretend refcount 1:address:array:num:3 <- copy 1000/unsafe # pretend allocation 1:address:array:num:3/lookup <- create-array @@ -332,7 +333,7 @@ def main [ canonize(product); :(scenario index_indirect) -def main [ +def main [ # 10 reserved for refcount 11:array:num:3 <- create-array 12:num <- copy 14 @@ -356,7 +357,7 @@ canonize(base); canonize(index); :(scenario put_index_indirect) -def main [ +def main [ # 10 reserved for refcount 11:array:num:3 <- create-array 12:num <- copy 14 @@ -368,7 +369,7 @@ def main [ +mem: storing 34 in location 13 :(scenario put_index_indirect_2) -def main [ +def main [ 1:array:num:3 <- create-array 2:num <- copy 14 3:num <- copy 15 @@ -382,7 +383,7 @@ def main [ :(scenario put_index_product_error_with_lookup) % Hide_errors = true; -def main [ +def main [ # 10 reserved for refcount 11:array:num:3 <- create-array 12:num <- copy 14 @@ -404,9 +405,9 @@ reagent/*copy} :(scenario dilated_reagent_in_static_array) -def main [ +def main [ {1: (array (address number) 3)} <- create-array - 5:address:num <- new number:type + 5:address:num <- new number:type {1: (array (address number) 3)} <- put-index {1: (array (address number) 3)}, 0, 5:address:num *5:address:num <- copy 34 6:num <- copy *5:address:num @@ -427,7 +428,7 @@ canonize(base); canonize(index); :(scenario length_indirect) -def main [ +def main [ # 10 reserved for refcount 11:array:num:3 <- create-array 12:num <- copy 14 @@ -444,33 +445,33 @@ def main [ canonize(array); :(scenario maybe_convert_indirect) -def main [ +def main [ # 10 reserved for refcount 11:number-or-point <- merge 0/number, 34 1:address:number-or-point <- copy 10/unsafe - 2:num, 3:bool <- maybe-convert 1:address:number-or-point/lookup, i:variant + 2:num, 3:bool <- maybe-convert 1:address:number-or-point/lookup, i:variant ] +mem: storing 1 in location 3 +mem: storing 34 in location 2 :(scenario maybe_convert_indirect_2) -def main [ +def main [ # 10 reserved for refcount 11:number-or-point <- merge 0/number, 34 1:address:number-or-point <- copy 10/unsafe 2:address:num <- copy 20/unsafe - 2:address:num/lookup, 3:bool <- maybe-convert 1:address:number-or-point/lookup, i:variant + 2:address:num/lookup, 3:bool <- maybe-convert 1:address:number-or-point/lookup, i:variant ] +mem: storing 1 in location 3 +mem: storing 34 in location 21 :(scenario maybe_convert_indirect_3) -def main [ +def main [ # 10 reserved for refcount 11:number-or-point <- merge 0/number, 34 1:address:number-or-point <- copy 10/unsafe 2:address:bool <- copy 20/unsafe - 3:num, 2:address:bool/lookup <- maybe-convert 1:address:number-or-point/lookup, i:variant + 3:num, 2:address:bool/lookup <- maybe-convert 1:address:number-or-point/lookup, i:variant ] +mem: storing 1 in location 21 +mem: storing 34 in location 3 @@ -490,7 +491,7 @@ canonize(product); canonize(status); :(scenario merge_exclusive_container_indirect) -def main [ +def main [ 1:address:number-or-point <- copy 10/unsafe 1:address:number-or-point/lookup <- merge 0/number, 34 ] @@ -504,7 +505,7 @@ canonize(x); //: abbreviation for '/lookup': a prefix '*' :(scenario lookup_abbreviation) -def main [ +def main [ 1:address:number <- copy 10/unsafe # 10 reserved for refcount 11:number <- copy 34 diff --git a/html/036refcount.cc.html b/html/036refcount.cc.html index 2b42b63f..757a96fe 100644 --- a/html/036refcount.cc.html +++ b/html/036refcount.cc.html @@ -15,14 +15,16 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } .cSpecial { color: #008000; } -.traceContains { color: #008000; } -.SalientComment { color: #00ffff; } +.muRecipe { color: #ff8700; } +.Todo { color: #000000; background-color: #ffff00; padding-bottom: 1px; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } -.Todo { color: #000000; background-color: #ffff00; padding-bottom: 1px; } +.muData { color: #ffff00; } +.Identifier { color: #fcb165; } +.SalientComment { color: #00ffff; } --> @@ -38,7 +40,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color //: The top of the address layer has more on refcounts. :(scenario refcounts) -def main [ +def main [ 1:address:num <- copy 1000/unsafe 2:address:num <- copy 1:address:num 1:address:num <- copy 0 @@ -122,8 +124,8 @@ def main [ } :(scenario refcounts_reflexive) -def main [ - 1:address:num <- new number:type +def main [ + 1:address:num <- new number:type # idempotent copies leave refcount unchanged 1:address:num <- copy 1:address:num ] @@ -134,14 +136,14 @@ def main [ +mem: decrementing refcount of 1000: 2 -> 1 :(scenario refcounts_call) -def main [ - 1:address:num <- new number:type +def main [ + 1:address:num <- new number:type # passing in addresses to recipes increments refcount foo 1:address:num # return does NOT yet decrement refcount; memory must be explicitly managed - 1:address:num <- new number:type + 1:address:num <- new number:type ] -def foo [ +def foo [ 2:address:num <- next-ingredient ] +run: {1: ("address" "number")} <- new {number: "type"} @@ -157,13 +159,13 @@ def foo [ //: before the RUN switch, and write_memory after :(scenario refcounts_put) -container foo [ +container foo [ x:address:num ] -def main [ - 1:address:num <- new number:type - 2:address:foo <- new foo:type - *2:address:foo <- put *2:address:foo, x:offset, 1:address:num +def main [ + 1:address:num <- new number:type + 2:address:foo <- new foo:type + *2:address:foo <- put *2:address:foo, x:offset, 1:address:num ] +run: {1: ("address" "number")} <- new {number: "type"} +mem: incrementing refcount of 1000: 0 -> 1 @@ -180,8 +182,8 @@ element.set_value( update_any_refcounts(element, ingredients.at(2)); :(scenario refcounts_put_index) -def main [ - 1:address:num <- new number:type +def main [ + 1:address:num <- new number:type 2:address:array:address:num <- new {(address number): type}, 3 *2:address:array:address:num <- put-index *2:address:array:address:num, 0, 1:address:num ] @@ -197,14 +199,14 @@ def main [ update_any_refcounts(element, value); :(scenario refcounts_maybe_convert) -exclusive-container foo [ +exclusive-container foo [ x:num p:address:num ] -def main [ - 1:address:num <- new number:type +def main [ + 1:address:num <- new number:type 2:foo <- merge 1/p, 1:address:num - 4:address:num, 5:bool <- maybe-convert 2:foo, 1:variant/p + 4:address:num, 5:bool <- maybe-convert 2:foo, 1:variant/p ] +run: {1: ("address" "number")} <- new {number: "type"} +mem: incrementing refcount of 1000: 0 -> 1 @@ -225,13 +227,13 @@ update_any_refcounts(product//:: manage refcounts in instructions that copy multiple locations at a time :(scenario refcounts_copy_nested) -container foo [ +container foo [ x:address:num # address inside container ] -def main [ - 1:address:num <- new number:type - 2:address:foo <- new foo:type - *2:address:foo <- put *2:address:foo, x:offset, 1:address:num +def main [ + 1:address:num <- new number:type + 2:address:foo <- new foo:type + *2:address:foo <- put *2:address:foo, x:offset, 1:address:num 3:foo <- copy *2:address:foo ] +transform: compute address offsets for container foo @@ -752,17 +754,17 @@ Transform.push_back(} :(scenario refcounts_put_container) -container foo [ +container foo [ a:bar # contains an address ] -container bar [ +container bar [ x:address:num ] -def main [ - 1:address:num <- new number:type +def main [ + 1:address:num <- new number:type 2:bar <- merge 1:address:num - 3:address:foo <- new foo:type - *3:address:foo <- put *3:address:foo, a:offset, 2:bar + 3:address:foo <- new foo:type + *3:address:foo <- put *3:address:foo, a:offset, 2:bar ] +run: {1: ("address" "number")} <- new {number: "type"} +mem: incrementing refcount of 1000: 0 -> 1 @@ -773,13 +775,13 @@ def main [ +mem: incrementing refcount of 1000: 2 -> 3 :(scenario refcounts_put_index_array) -container bar [ +container bar [ x:address:num ] -def main [ - 1:address:num <- new number:type +def main [ + 1:address:num <- new number:type 2:bar <- merge 1:address:num - 3:address:array:bar <- new bar:type, 3 + 3:address:array:bar <- new bar:type, 3 *3:address:array:bar <- put-index *3:address:array:bar, 0, 2:bar ] +run: {1: ("address" "number")} <- new {number: "type"} @@ -791,18 +793,18 @@ def main [ +mem: incrementing refcount of 1000: 2 -> 3 :(scenario refcounts_maybe_convert_container) -exclusive-container foo [ +exclusive-container foo [ a:num b:bar # contains an address ] -container bar [ +container bar [ x:address:num ] -def main [ - 1:address:num <- new number:type +def main [ + 1:address:num <- new number:type 2:bar <- merge 1:address:num 3:foo <- merge 1/b, 2:bar - 5:bar, 6:bool <- maybe-convert 3:foo, 1:variant/b + 5:bar, 6:bool <- maybe-convert 3:foo, 1:variant/b ] +run: {1: ("address" "number")} <- new {number: "type"} +mem: incrementing refcount of 1000: 0 -> 1 @@ -814,24 +816,24 @@ def main [ +mem: incrementing refcount of 1000: 3 -> 4 :(scenario refcounts_copy_doubly_nested) -container foo [ +container foo [ a:bar # no addresses b:curr # contains addresses ] -container bar [ +container bar [ x:num y:num ] -container curr [ +container curr [ x:num y:address:num # address inside container inside container ] -def main [ - 1:address:num <- new number:type - 2:address:curr <- new curr:type - *2:address:curr <- put *2:address:curr, 1:offset/y, 1:address:num - 3:address:foo <- new foo:type - *3:address:foo <- put *3:address:foo, 1:offset/b, *2:address:curr +def main [ + 1:address:num <- new number:type + 2:address:curr <- new curr:type + *2:address:curr <- put *2:address:curr, 1:offset/y, 1:address:num + 3:address:foo <- new foo:type + *3:address:foo <- put *3:address:foo, 1:offset/b, *2:address:curr 4:foo <- copy *3:address:foo ] +transform: compute address offsets for container foo @@ -850,17 +852,17 @@ def main [ +mem: incrementing refcount of 1000: 3 -> 4 :(scenario refcounts_copy_exclusive_container_within_container) -container foo [ +container foo [ a:num b:bar ] -exclusive-container bar [ +exclusive-container bar [ x:num y:num z:address:num ] -def main [ - 1:address:num <- new number:type +def main [ + 1:address:num <- new number:type 2:bar <- merge 0/x, 34 3:foo <- merge 12, 2:bar 5:bar <- merge 1/y, 35 @@ -880,17 +882,17 @@ def main [ +mem: incrementing refcount of 1000: 3 -> 4 :(scenario refcounts_copy_container_within_exclusive_container) -exclusive-container foo [ +exclusive-container foo [ a:num b:bar ] -container bar [ +container bar [ x:num y:num z:address:num ] -def main [ - 1:address:num <- new number:type +def main [ + 1:address:num <- new number:type 2:foo <- merge 0/a, 34 6:foo <- merge 0/a, 35 10:bar <- merge 2/x, 15/y, 1:address:num @@ -908,16 +910,16 @@ def main [ +mem: incrementing refcount of 1000: 3 -> 4 :(scenario refcounts_copy_exclusive_container_within_exclusive_container) -exclusive-container foo [ +exclusive-container foo [ a:num b:bar ] -exclusive-container bar [ +exclusive-container bar [ x:num y:address:num ] -def main [ - 1:address:num <- new number:type +def main [ + 1:address:num <- new number:type 10:foo <- merge 1/b, 1/y, 1:address:num 20:foo <- copy 10:foo ] @@ -930,13 +932,13 @@ def main [ +mem: incrementing refcount of 1000: 2 -> 3 :(scenario refcounts_copy_array_within_container) -container foo [ +container foo [ x:address:array:num ] -def main [ - 1:address:array:num <- new number:type, 3 +def main [ + 1:address:array:num <- new number:type, 3 2:foo <- merge 1:address:array:num - 3:address:array:num <- new number:type, 5 + 3:address:array:num <- new number:type, 5 2:foo <- merge 3:address:array:num ] +run: {1: ("address" "array" "number")} <- new {number: "type"}, {3: "literal"} @@ -947,19 +949,19 @@ def main [ +mem: decrementing refcount of 1000: 2 -> 1 :(scenario refcounts_handle_exclusive_containers_with_different_tags) -container foo1 [ +container foo1 [ x:address:num y:num ] -container foo2 [ +container foo2 [ x:num y:address:num ] -exclusive-container bar [ +exclusive-container bar [ a:foo1 b:foo2 ] -def main [ +def main [ 1:address:num <- copy 12000/unsafe # pretend allocation *1:address:num <- copy 34 2:bar <- merge 0/foo1, 1:address:num, 97 diff --git a/html/037abandon.cc.html b/html/037abandon.cc.html index 6984c154..3c1d2c2f 100644 --- a/html/037abandon.cc.html +++ b/html/037abandon.cc.html @@ -15,12 +15,14 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } .cSpecial { color: #008000; } -.traceContains { color: #008000; } +.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.CommentedCode { color: #6c6c6c; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.muData { color: #ffff00; } +.CommentedCode { color: #6c6c6c; } .Identifier { color: #fcb165; } --> @@ -37,11 +39,11 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color //: The top of the address layer has the complete life cycle of memory. :(scenario new_reclaim) -def main [ - 1:address:num <- new number:type +def main [ + 1:address:num <- new number:type 2:num <- copy 1:address:num # because 1 will get reset during abandon below 1:address:num <- copy 0 # abandon - 3:address:num <- new number:type # must be same size as abandoned memory to reuse + 3:address:num <- new number:type # must be same size as abandoned memory to reuse 4:num <- copy 3:address:num 5:bool <- equal 2:num, 4:num ] @@ -109,11 +111,11 @@ map<int, } :(scenario new_differing_size_no_reclaim) -def main [ - 1:address:num <- new number:type +def main [ + 1:address:num <- new number:type 2:num <- copy 1:address:num 1:address:num <- copy 0 # abandon - 3:address:array:num <- new number:type, 2 # different size + 3:address:array:num <- new number:type, 2 # different size 4:num <- copy 3:address:array:num 5:bool <- equal 2:num, 4:num ] @@ -121,11 +123,11 @@ def main [ +mem: storing 0 in location 5 :(scenario new_reclaim_array) -def main [ - 1:address:array:num <- new number:type, 2 +def main [ + 1:address:array:num <- new number:type, 2 2:num <- copy 1:address:array:num 1:address:array:num <- copy 0 # abandon - 3:address:array:num <- new number:type, 2 # same size + 3:address:array:num <- new number:type, 2 # same size 4:num <- copy 3:address:array:num 5:bool <- equal 2:num, 4:num ] @@ -133,10 +135,10 @@ def main [ +mem: storing 1 in location 5 :(scenario abandon_on_overwrite) -def main [ - 1:address:num <- new number:type +def main [ + 1:address:num <- new number:type # over-writing one allocation with another - 1:address:num <- new number:type + 1:address:num <- new number:type 1:address:num <- copy 0 ] +run: {1: ("address" "number")} <- new {number: "type"} @@ -145,13 +147,13 @@ def main [ +mem: automatically abandoning 1000 :(scenario abandon_after_call) -def main [ - 1:address:num <- new number:type +def main [ + 1:address:num <- new number:type # passing in addresses to recipes increments refcount foo 1:address:num 1:address:num <- copy 0 ] -def foo [ +def foo [ 2:address:num <- next-ingredient # return does NOT yet decrement refcount; memory must be explicitly managed 2:address:num <- copy 0 @@ -169,13 +171,13 @@ def foo [ +mem: automatically abandoning 1000 :(scenario abandon_on_overwrite_array) -def main [ +def main [ 1:num <- copy 30 # allocate an array - 10:address:array:num <- new number:type, 20 + 10:address:array:num <- new number:type, 20 11:num <- copy 10:address:array:num # doesn't increment refcount # allocate another array in its place, implicitly freeing the previous allocation - 10:address:array:num <- new number:type, 25 + 10:address:array:num <- new number:type, 25 ] +run: {10: ("address" "array" "number")} <- new {number: "type"}, {25: "literal"} # abandoned array is of old size (20, not 25) @@ -183,13 +185,13 @@ def main [ :(scenario refcounts_abandon_address_in_container) # container containing an address -container foo [ +container foo [ x:address:num ] -def main [ - 1:address:num <- new number:type - 2:address:foo <- new foo:type - *2:address:foo <- put *2:address:foo, x:offset, 1:address:num +def main [ + 1:address:num <- new number:type + 2:address:foo <- new foo:type + *2:address:foo <- put *2:address:foo, x:offset, 1:address:num 1:address:num <- copy 0 2:address:foo <- copy 0 ] @@ -212,8 +214,8 @@ def main [ # todo: move past dilated reagent :(scenario refcounts_abandon_address_in_array) -def main [ - 1:address:num <- new number:type +def main [ + 1:address:num <- new number:type 2:address:array:address:num <- new {(address number): type}, 3 *2:address:array:address:num <- put-index *2:address:array:address:num, 1, 1:address:num 1:address:num <- copy 0 @@ -232,12 +234,12 @@ def main [ :(scenario refcounts_abandon_address_in_container_in_array) # container containing an address -container foo [ +container foo [ x:address:num ] -def main [ - 1:address:num <- new number:type - 2:address:array:foo <- new foo:type, 3 +def main [ + 1:address:num <- new number:type + 2:address:array:foo <- new foo:type, 3 3:foo <- merge 1:address:num *2:address:array:foo <- put-index *2:address:array:foo, 1, 3:foo 1:address:num <- copy 0 diff --git a/html/038new_text.cc.html b/html/038new_text.cc.html index 81b50bde..4b024918 100644 --- a/html/038new_text.cc.html +++ b/html/038new_text.cc.html @@ -14,13 +14,14 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background- body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } -.traceContains { color: #008000; } +.CommentedCode { color: #6c6c6c; } +.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } -.CommentedCode { color: #6c6c6c; } +.Identifier { color: #fcb165; } --> @@ -39,7 +40,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color put(Type_abbreviations, "text", new_type_tree("address:array:character")); :(scenario new_string) -def main [ +def main [ 1:text <- new [abc def] 2:char <- index *1:text, 5 ] @@ -47,7 +48,7 @@ def main [ +mem: storing 101 in location 2 :(scenario new_string_handles_unicode) -def main [ +def main [ 1:text <- new [a«c] 2:num <- length *1:text 3:char <- index *1:text, 1 @@ -99,7 +100,7 @@ def main [ //: stash recognizes strings :(scenario stash_string) -def main [ +def main [ 1:text <- new [abc] stash [foo:], 1:text ] @@ -112,21 +113,21 @@ def main [ } :(scenario unicode_string) -def main [ +def main [ 1:text <- new [♠] stash [foo:], 1:text ] +app: foo: ♠ :(scenario stash_space_after_string) -def main [ +def main [ 1:text <- new [abc] stash 1:text, [foo] ] +app: abc foo :(scenario stash_string_as_array) -def main [ +def main [ 1:text <- new [abc] stash *1:text ] @@ -139,8 +140,8 @@ def main [ //: Allocate more to routine when initializing a literal string :(scenario new_string_overflow) % Initial_memory_per_routine = 3; -def main [ - 1:address:num/raw <- new number:type +def main [ + 1:address:num/raw <- new number:type 2:text/raw <- new [a] # not enough room in initial page, if you take the refcount and array length into account ] +new: routine allocated memory from 1000 to 1003 diff --git a/html/040brace.cc.html b/html/040brace.cc.html index 8ce5fff1..edfa2020 100644 --- a/html/040brace.cc.html +++ b/html/040brace.cc.html @@ -14,8 +14,9 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background- body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } -.cSpecial { color: #008000; } .traceContains { color: #008000; } +.muRecipe { color: #ff8700; } +.cSpecial { color: #008000; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } @@ -56,7 +57,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color :(scenarios transform) :(scenario brace_conversion) -def main [ +def main [ { break 1:num <- copy 0 @@ -136,14 +137,14 @@ Transform.push_back(if (inst.old_name.find("-if") != string::npos || inst.old_name.find("-unless") != string::npos) { // conditional branches check arg 1 if (SIZE(inst.ingredients) > 1 && is_literal(inst.ingredients.at(1))) { - trace(9992, "transform") << inst.name << ' ' << inst.ingredients.at(1).name << ":offset" << end(); + trace(9992, "transform") << inst.name << ' ' << inst.ingredients.at(1).name << ":offset" << end(); continue; } } else { // unconditional branches check arg 0 if (!inst.ingredients.empty() && is_literal(inst.ingredients.at(0))) { - trace(9992, "transform") << "jump " << inst.ingredients.at(0).name << ":offset" << end(); + trace(9992, "transform") << "jump " << inst.ingredients.at(0).name << ":offset" << end(); continue; } } @@ -160,9 +161,9 @@ Transform.push_back(.ingredients.push_back(target); // log computed target if (inst.name == "jump") - trace(9992, "transform") << "jump " << no_scientific(target.value) << ":offset" << end(); + trace(9992, "transform") << "jump " << no_scientific(target.value) << ":offset" << end(); else - trace(9992, "transform") << inst.name << ' ' << inst.ingredients.at(0).name << ", " << no_scientific(target.value) << ":offset" << end(); + trace(9992, "transform") << inst.name << ' ' << inst.ingredients.at(0).name << ", " << no_scientific(target.value) << ":offset" << end(); } } @@ -180,7 +181,7 @@ Transform.push_back(} :(scenario loop) -def main [ +def main [ 1:num <- copy 0 2:num <- copy 0 { @@ -195,7 +196,7 @@ def main [ +transform: jump -2:offset :(scenario break_empty_block) -def main [ +def main [ 1:num <- copy 0 { break @@ -206,7 +207,7 @@ def main [ +transform: jump 0:offset :(scenario break_cascading) -def main [ +def main [ 1:num <- copy 0 { break @@ -221,7 +222,7 @@ def main [ +transform: jump 0:offset :(scenario break_cascading_2) -def main [ +def main [ 1:num <- copy 0 2:num <- copy 0 { @@ -240,7 +241,7 @@ def main [ +transform: jump 0:offset :(scenario break_if) -def main [ +def main [ 1:num <- copy 0 2:num <- copy 0 { @@ -259,7 +260,7 @@ def main [ +transform: jump 0:offset :(scenario break_nested) -def main [ +def main [ 1:num <- copy 0 { 2:num <- copy 0 @@ -273,7 +274,7 @@ def main [ +transform: jump 4:offset :(scenario break_nested_degenerate) -def main [ +def main [ 1:num <- copy 0 { 2:num <- copy 0 @@ -286,7 +287,7 @@ def main [ +transform: jump 3:offset :(scenario break_nested_degenerate_2) -def main [ +def main [ 1:num <- copy 0 { 2:num <- copy 0 @@ -299,16 +300,16 @@ def main [ :(scenario break_label) % Hide_errors = true; -def main [ +def main [ 1:num <- copy 0 { - break +foo:offset + break +foo:offset } ] +transform: jump +foo:offset :(scenario break_unless) -def main [ +def main [ 1:num <- copy 0 2:num <- copy 0 { @@ -323,7 +324,7 @@ def main [ +transform: copy ... :(scenario loop_unless) -def main [ +def main [ 1:num <- copy 0 2:num <- copy 0 { @@ -338,7 +339,7 @@ def main [ +transform: copy ... :(scenario loop_nested) -def main [ +def main [ 1:num <- copy 0 { 2:num <- copy 0 @@ -353,7 +354,7 @@ def main [ +transform: jump-if 4, -5:offset :(scenario loop_label) -def main [ +def main [ 1:num <- copy 0 +foo 2:num <- copy 0 @@ -365,7 +366,7 @@ def main [ //: test how things actually run :(scenarios run) :(scenario brace_conversion_and_run) -def test-factorial [ +def test-factorial [ 1:num <- copy 5 2:num <- copy 1 { @@ -382,14 +383,14 @@ def test-factorial [ :(scenario break_outside_braces_fails) % Hide_errors = true; -def main [ +def main [ break ] +error: 'break' needs a '{' before :(scenario break_conditional_without_ingredient_fails) % Hide_errors = true; -def main [ +def main [ { break-if } @@ -399,20 +400,20 @@ def main [ //: Using break we can now implement conditional returns. :(scenario return_if) -def main [ +def main [ 1:num <- test1 ] -def test1 [ +def test1 [ return-if 0, 34 return 35 ] +mem: storing 35 in location 1 :(scenario return_if_2) -def main [ +def main [ 1:num <- test1 ] -def test1 [ +def test1 [ return-if 1, 34 return 35 ] diff --git a/html/041jump_target.cc.html b/html/041jump_target.cc.html index 766bd7da..23cda500 100644 --- a/html/041jump_target.cc.html +++ b/html/041jump_target.cc.html @@ -16,6 +16,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color .Constant { color: #00a0a0; } .traceAbsent { color: #c00000; } .cSpecial { color: #008000; } +.muRecipe { color: #ff8700; } .traceContains { color: #008000; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } @@ -43,8 +44,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color //: iteration of some containing loop nest. :(scenario jump_to_label) -def main [ - jump +target:label +def main [ + jump +target:label 1:num <- copy 0 +target ] @@ -127,10 +128,10 @@ Transform.push_back(} :(scenario break_to_label) -def main [ +def main [ { { - break +target:label + break +target:label 1:num <- copy 0 } } @@ -139,10 +140,10 @@ def main [ -mem: storing 0 in location 1 :(scenario jump_if_to_label) -def main [ +def main [ { { - jump-if 1, +target:label + jump-if 1, +target:label 1:num <- copy 0 } } @@ -151,10 +152,10 @@ def main [ -mem: storing 0 in location 1 :(scenario loop_unless_to_label) -def main [ +def main [ { { - loop-unless 0, +target:label # loop/break with a label don't care about braces + loop-unless 0, +target:label # loop/break with a label don't care about braces 1:num <- copy 0 } } @@ -163,12 +164,12 @@ def main [ -mem: storing 0 in location 1 :(scenario jump_runs_code_after_label) -def main [ +def main [ # first a few lines of padding to exercise the offset computation 1:num <- copy 0 2:num <- copy 0 3:num <- copy 0 - jump +target:label + jump +target:label 4:num <- copy 0 +target 5:num <- copy 0 @@ -178,21 +179,21 @@ def main [ :(scenario jump_fails_without_target) % Hide_errors = true; -def main [ +def main [ jump ] +error: main: 'jump' expects an ingredient but got none :(scenario jump_fails_without_target_2) % Hide_errors = true; -def main [ +def main [ jump-if 1/true ] +error: main: 'jump-if' expects 2 ingredients but got 1 :(scenario recipe_fails_on_duplicate_jump_target) % Hide_errors = true; -def main [ +def main [ +label 1:num <- copy 0 +label @@ -202,12 +203,12 @@ def main [ :(scenario jump_ignores_nontarget_label) % Hide_errors = true; -def main [ +def main [ # first a few lines of padding to exercise the offset computation 1:num <- copy 0 2:num <- copy 0 3:num <- copy 0 - jump $target:label + jump $target:label 4:num <- copy 0 $target 5:num <- copy 0 diff --git a/html/042name.cc.html b/html/042name.cc.html index 829cc216..a397562f 100644 --- a/html/042name.cc.html +++ b/html/042name.cc.html @@ -16,13 +16,14 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color .Constant { color: #00a0a0; } .traceAbsent { color: #c00000; } .cSpecial { color: #008000; } -.traceContains { color: #008000; } +.muRecipe { color: #ff8700; } .SalientComment { color: #00ffff; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.CommentedCode { color: #6c6c6c; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.CommentedCode { color: #6c6c6c; } .Identifier { color: #fcb165; } --> @@ -40,7 +41,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color //: convenience. :(scenario transform_names) -def main [ +def main [ x:num <- copy 0 ] +name: assign x 1 @@ -49,7 +50,7 @@ def main [ :(scenarios transform) :(scenario transform_names_fails_on_use_before_define) % Hide_errors = true; -def main [ +def main [ x:num <- copy y:num ] +error: main: use before set: 'y' @@ -191,7 +192,7 @@ type_ordinal skip_addresses(type_tree* type} :(scenario transform_names_supports_containers) -def main [ +def main [ x:point <- merge 34, 35 y:num <- copy 3 ] @@ -200,7 +201,7 @@ def main [ +name: assign y 3 :(scenario transform_names_supports_static_arrays) -def main [ +def main [ x:@:num:3 <- create-array y:num <- copy 3 ] @@ -210,7 +211,7 @@ def main [ :(scenario transform_names_passes_dummy) # _ is just a dummy result that never gets consumed -def main [ +def main [ _, x:num <- copy 0, 1 ] +name: assign x 1 @@ -220,7 +221,7 @@ def main [ :(scenarios run) :(scenario transform_names_passes_raw) % Hide_errors = true; -def main [ +def main [ x:num/raw <- copy 0 ] -name: assign x 1 @@ -229,28 +230,28 @@ def main [ :(scenarios transform) :(scenario transform_names_fails_when_mixing_names_and_numeric_locations) % Hide_errors = true; -def main [ +def main [ x:num <- copy 1:num ] +error: main: mixing variable names and numeric addresses :(scenario transform_names_fails_when_mixing_names_and_numeric_locations_2) % Hide_errors = true; -def main [ +def main [ x:num <- copy 1 1:num <- copy x:num ] +error: main: mixing variable names and numeric addresses :(scenario transform_names_does_not_fail_when_mixing_names_and_raw_locations) -def main [ +def main [ x:num <- copy 1:num/raw ] -error: main: mixing variable names and numeric addresses $error: 0 :(scenario transform_names_does_not_fail_when_mixing_names_and_literals) -def main [ +def main [ x:num <- copy 1 ] -error: main: mixing variable names and numeric addresses @@ -260,10 +261,10 @@ $error: 0 //: (get-location is implemented later) :(scenario transform_names_transforms_container_elements) -def main [ +def main [ p:&:point <- copy 0 - a:num <- get *p:&:point, y:offset - b:num <- get *p:&:point, x:offset + a:num <- get *p:&:point, y:offset + b:num <- get *p:&:point, x:offset ] +name: element y of type point is at offset 1 +name: element x of type point is at offset 0 @@ -293,7 +294,7 @@ def main [ //: this test is actually illegal so can't call run :(scenarios transform) :(scenario transform_names_handles_containers) -def main [ +def main [ a:point <- copy 0/unsafe b:num <- copy 0/unsafe ] @@ -304,11 +305,11 @@ def main [ :(scenarios run) :(scenario transform_names_handles_exclusive_containers) -def main [ +def main [ 12:num <- copy 1 13:num <- copy 35 14:num <- copy 36 - 20:point, 22:bool <- maybe-convert 12:number-or-point/unsafe, p:variant + 20:point, 22:bool <- maybe-convert 12:number-or-point/unsafe, p:variant ] +name: variant p of type number-or-point has tag 1 +mem: storing 1 in location 22 diff --git a/html/043space.cc.html b/html/043space.cc.html index 036f7def..1c862968 100644 --- a/html/043space.cc.html +++ b/html/043space.cc.html @@ -16,13 +16,15 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color .Constant { color: #00a0a0; } .traceAbsent { color: #c00000; } .cSpecial { color: #008000; } -.traceContains { color: #008000; } +.muRecipe { color: #ff8700; } .SalientComment { color: #00ffff; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.muData { color: #ffff00; } +.Identifier { color: #fcb165; } --> @@ -47,7 +49,7 @@ put(Type_abbreviations,:(scenario set_default_space) # if default-space is 10, and if an array of 5 locals lies from location 12 to 16 (inclusive), # then local 0 is really location 12, local 1 is really location 13, and so on. -def main [ +def main [ # pretend address:array:location; in practice we'll use new 10:num <- copy 0 # refcount 11:num <- copy 5 # length @@ -57,7 +59,7 @@ def main [ +mem: storing 23 in location 13 :(scenario lookup_sidesteps_default_space) -def main [ +def main [ # pretend pointer from outside (2000 reserved for refcount) 2001:num <- copy 34 # pretend address:array:location; in practice we'll use new @@ -73,7 +75,7 @@ def main [ //:: first disable name conversion for 'default-space' :(scenario convert_names_passes_default_space) % Hide_errors = true; -def main [ +def main [ default-space:num, x:num <- copy 0, 1 ] +name: assign x 1 @@ -136,7 +138,7 @@ absolutize(x); } :(scenario get_default_space) -def main [ +def main [ default-space:space <- copy 10/unsafe 1:space/raw <- copy default-space:space ] @@ -152,7 +154,7 @@ def main [ //:: fix 'get' :(scenario lookup_sidesteps_default_space_in_get) -def main [ +def main [ # pretend pointer to container from outside (2000 reserved for refcount) 2001:num <- copy 34 2002:num <- copy 35 @@ -162,7 +164,7 @@ def main [ # actual start of this recipe default-space:space <- copy 1000/unsafe 1:&:point <- copy 2000/unsafe - 9:num/raw <- get *1:&:point, 1:offset + 9:num/raw <- get *1:&:point, 1:offset ] +mem: storing 35 in location 9 @@ -172,7 +174,7 @@ element.properties.//:: fix 'index' :(scenario lookup_sidesteps_default_space_in_index) -def main [ +def main [ # pretend pointer to array from outside (2000 reserved for refcount) 2001:num <- copy 2 # length 2002:num <- copy 34 @@ -194,7 +196,7 @@ element.properties.//:: allocate in a default space with names :(scenario new_default_space) -def main [ +def main [ new-default-space x:num <- copy 0 y:num <- copy 3 @@ -233,12 +235,12 @@ def main [ //:: default-space when the routine exits :(scenario local_scope) -def main [ +def main [ 1:& <- foo 2:& <- foo 3:bool <- equal 1:&, 2:& ] -def foo [ +def foo [ local-scope x:num <- copy 34 return default-space:space @@ -247,7 +249,7 @@ def foo [ +mem: storing 1 in location 3 :(scenario local_scope_frees_up_addresses) -def main [ +def main [ local-scope x:text <- new [abc] ] @@ -342,21 +344,21 @@ Update_refcounts_in_write_memory = trueif (!curr.ingredients.empty()) raise << to_original_string(curr) << " can't take any ingredients\n" << end(); curr.name = "new"; - curr.ingredients.push_back(reagent("location:type")); - curr.ingredients.push_back(reagent("number-of-locals:literal")); + curr.ingredients.push_back(reagent("location:type")); + curr.ingredients.push_back(reagent("number-of-locals:literal")); if (!curr.products.empty()) raise << "new-default-space can't take any results\n" << end(); curr.products.push_back(reagent("default-space:space")); } :(scenario local_scope_frees_up_addresses_inside_containers) -container foo [ +container foo [ x:num y:&:num ] -def main [ +def main [ local-scope - x:&:num <- new number:type + x:&:num <- new number:type y:foo <- merge 34, x:&:num # x and y are both cleared when main returns ] @@ -367,24 +369,24 @@ def main [ +mem: automatically abandoning 1006 :(scenario local_scope_returns_addresses_inside_containers) -container foo [ +container foo [ x:num y:&:num ] -def f [ +def f [ local-scope - x:&:num <- new number:type + x:&:num <- new number:type *x:&:num <- copy 12 y:foo <- merge 34, x:&:num # since y is 'escaping' f, it should not be cleared return y:foo ] -def main [ +def main [ 1:foo <- f - 3:num <- get 1:foo, x:offset - 4:&:num <- get 1:foo, y:offset + 3:num <- get 1:foo, x:offset + 4:&:num <- get 1:foo, y:offset 5:num <- copy *4:&:num - 1:foo <- put 1:foo, y:offset, 0 + 1:foo <- put 1:foo, y:offset, 0 4:&:num <- copy 0 ] +mem: storing 34 in location 1 @@ -403,12 +405,12 @@ def main [ +mem: automatically abandoning 1006 :(scenario local_scope_claims_return_values_when_not_saved) -def f [ +def f [ local-scope - x:&:num <- new number:type + x:&:num <- new number:type reply x:&:num ] -def main [ +def main [ f # doesn't save result ] # x reclaimed diff --git a/html/044space_surround.cc.html b/html/044space_surround.cc.html index bd9f07ef..70ef4d46 100644 --- a/html/044space_surround.cc.html +++ b/html/044space_surround.cc.html @@ -15,12 +15,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } .cSpecial { color: #008000; } -.traceContains { color: #008000; } +.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.Identifier { color: #fcb165; } --> @@ -40,7 +41,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color :(scenario surrounding_space) # location 1 in space 1 refers to the space surrounding the default space, here 20. -def main [ +def main [ # pretend address:array:location; in practice we'll use new 10:num <- copy 0 # refcount 11:num <- copy 5 # length @@ -53,7 +54,7 @@ def main [ 1:num <- copy 32 1:num/space:1 <- copy 33 ] -def dummy [ # just for the /names: property above +def dummy [ # just for the /names: property above ] # chain space: 10 + (refcount and length) 2 +mem: storing 20 in location 12 @@ -94,7 +95,7 @@ def dummy [ # just for the /names: property above } :(scenario permit_space_as_variable_name) -def main [ +def main [ space:num <- copy 0 ] diff --git a/html/045closure_name.cc.html b/html/045closure_name.cc.html index c4f9a0ef..a51ebcbc 100644 --- a/html/045closure_name.cc.html +++ b/html/045closure_name.cc.html @@ -14,8 +14,9 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background- body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } -.cSpecial { color: #008000; } .traceContains { color: #008000; } +.muRecipe { color: #ff8700; } +.cSpecial { color: #008000; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } @@ -39,20 +40,20 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color //: surrounding space of the surrounding space, etc. :(scenario closure) -def main [ - default-space:space <- new location:type, 30 +def main [ + default-space:space <- new location:type, 30 1:space/names:new-counter <- new-counter 2:num/raw <- increment-counter 1:space/names:new-counter 3:num/raw <- increment-counter 1:space/names:new-counter ] -def new-counter [ - default-space:space <- new location:type, 30 +def new-counter [ + default-space:space <- new location:type, 30 x:num <- copy 23 y:num <- copy 3 # variable that will be incremented return default-space:space ] -def increment-counter [ - default-space:space <- new location:type, 30 +def increment-counter [ + default-space:space <- new location:type, 30 0:space/names:new-counter <- next-ingredient # outer space must be created by 'new-counter' above y:num/space:1 <- add y:num/space:1, 1 # increment y:num <- copy 234 # dummy @@ -175,7 +176,7 @@ recipe_ordinal lookup_surrounding_recipe(:(scenario missing_surrounding_space) % Hide_errors = true; -def f [ +def f [ local-scope x:num/space:1 <- copy 34 ] @@ -184,19 +185,19 @@ def f [ //: extra test for try_reclaim_locals() from previous layers :(scenario local_scope_ignores_nonlocal_spaces) -def new-scope [ +def new-scope [ new-default-space - x:&:num <- new number:type + x:&:num <- new number:type *x:&:num <- copy 34 return default-space:space ] -def use-scope [ +def use-scope [ local-scope outer:space <- next-ingredient 0:space/names:new-scope <- copy outer:space return *x:&:num/space:1 ] -def main [ +def main [ 1:space/raw <- new-scope 2:num/raw <- use-scope 1:space/raw ] diff --git a/html/046global.cc.html b/html/046global.cc.html index df8ba426..4bae44f9 100644 --- a/html/046global.cc.html +++ b/html/046global.cc.html @@ -15,12 +15,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } .cSpecial { color: #008000; } -.traceContains { color: #008000; } +.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.Identifier { color: #fcb165; } --> @@ -44,7 +45,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color //: entirely. :(scenario global_space) -def main [ +def main [ # pretend address:array:location; in practice we'll use new 10:num <- copy 0 # refcount 11:num <- copy 5 # length @@ -55,7 +56,7 @@ def main [ global-space:space <- copy 20/unsafe default-space:space <- copy 10/unsafe 1:num <- copy 23 - 1:num/space:global <- copy 24 + 1:num/space:global <- copy 24 ] # store to default space: 10 + (skip refcount and length) 2 + (index) 1 +mem: storing 23 in location 13 @@ -96,10 +97,10 @@ global_space = 0; //: don't want to make them too comfortable to use. :(scenario global_space_with_names) -def main [ - global-space:space <- new location:type, 10 +def main [ + global-space:space <- new location:type, 10 x:num <- copy 23 - 1:num/space:global <- copy 24 + 1:num/space:global <- copy 24 ] # don't complain about mixing numeric addresses and names $error: 0 diff --git a/html/047check_type_by_name.cc.html b/html/047check_type_by_name.cc.html index 433b67aa..c5199c12 100644 --- a/html/047check_type_by_name.cc.html +++ b/html/047check_type_by_name.cc.html @@ -15,12 +15,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } .cSpecial { color: #008000; } -.traceContains { color: #008000; } +.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.Identifier { color: #fcb165; } --> @@ -42,7 +43,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color :(scenario transform_fails_on_reusing_name_with_different_type) % Hide_errors = true; -def main [ +def main [ x:num <- copy 1 x:bool <- copy 1 ] @@ -101,7 +102,7 @@ Transform.push_back(} :(scenario transform_fills_in_missing_types) -def main [ +def main [ x:num <- copy 1 y:num <- add x, 1 ] @@ -109,7 +110,7 @@ def main [ +mem: storing 2 in location 2 :(scenario transform_fills_in_missing_types_in_product) -def main [ +def main [ x:num <- copy 1 x <- copy 2 ] @@ -117,7 +118,7 @@ def main [ +mem: storing 2 in location 1 :(scenario transform_fills_in_missing_types_in_product_and_ingredient) -def main [ +def main [ x:num <- copy 1 x <- add x, 1 ] @@ -126,7 +127,7 @@ def main [ :(scenario transform_fails_on_missing_types_in_first_mention) % Hide_errors = true; -def main [ +def main [ x <- copy 1 x:num <- copy 2 ] @@ -134,24 +135,24 @@ def main [ :(scenario typo_in_address_type_fails) % Hide_errors = true; -def main [ - y:&:charcter <- new character:type +def main [ + y:&:charcter <- new character:type *y <- copy 67 ] +error: main: unknown type charcter in 'y:&:charcter <- new character:type' :(scenario array_type_without_size_fails) % Hide_errors = true; -def main [ +def main [ x:@:num <- merge 2, 12, 13 ] +error: main can't determine the size of array variable 'x'. Either allocate it separately and make the type of 'x' an address, or specify the length of the array in the type of 'x'. :(scenarios transform) :(scenario transform_checks_types_of_identical_reagents_in_multiple_spaces) -def foo [ # dummy +def foo [ # dummy ] -def main [ +def main [ local-scope 0:space/names:foo <- copy 0 # specify surrounding space x:bool <- copy 1/true diff --git a/html/050scenario.cc.html b/html/050scenario.cc.html index 2a1e847e..a4217e06 100644 --- a/html/050scenario.cc.html +++ b/html/050scenario.cc.html @@ -13,17 +13,19 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.Constant { color: #00a0a0; } -.traceAbsent { color: #c00000; } -.cSpecial { color: #008000; } -.traceContains { color: #008000; } .SalientComment { color: #00ffff; } -.Comment { color: #9090ff; } +.CommentedCode { color: #6c6c6c; } +.muRecipe { color: #ff8700; } +.muScenario { color: #00af00; } +.traceContains { color: #008000; } .Delimiter { color: #800080; } +.Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.cSpecial { color: #008000; } +.traceAbsent { color: #c00000; } +.Comment { color: #9090ff; } +.Constant { color: #00a0a0; } .Special { color: #c00000; } .Identifier { color: #fcb165; } -.Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } -.CommentedCode { color: #6c6c6c; } --> @@ -42,7 +44,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color //: handy to check the values of specific variables :(scenarios run_mu_scenario) :(scenario scenario_block) -scenario foo [ +scenario foo [ run [ 1:num <- copy 13 ] @@ -53,7 +55,7 @@ scenario foo [ # checks are inside scenario :(scenario scenario_multiple_blocks) -scenario foo [ +scenario foo [ run [ 1:num <- copy 13 ] @@ -71,7 +73,7 @@ scenario foo [ # checks are inside scenario :(scenario scenario_check_memory_and_trace) -scenario foo [ +scenario foo [ run [ 1:num <- copy 13 trace 1, [a], [a b c] @@ -112,7 +114,7 @@ vector<scenario> Scenarios; } :(code) -scenario parse_scenario(istream& in) { +scenario parse_scenario(istream& in) { scenario result; result.name = next_word(in); skip_whitespace_and_comments(in); @@ -132,14 +134,14 @@ scenario parse_scenario(istream& in} :(scenario read_scenario_with_bracket_in_comment) -scenario foo [ +scenario foo [ # ']' in comment 1:num <- copy 0 ] +run: {1: "number"} <- copy {0: "literal"} :(scenario read_scenario_with_bracket_in_comment_in_nested_string) -scenario foo [ +scenario foo [ 1:text <- new [# not a comment] ] +run: {1: ("address" "array" "character")} <- new {"# not a comment": "literal-string"} @@ -279,10 +281,10 @@ Name[r]["__maybe_make_raw_test__"] = Res :(scenario forbid_redefining_scenario_even_if_forced) % Hide_errors = true; % Disable_redefine_checks = true; -def scenario-foo [ +def scenario-foo [ 1:num <- copy 34 ] -def scenario-foo [ +def scenario-foo [ 1:num <- copy 35 ] +error: redefining recipe scenario-foo @@ -297,7 +299,7 @@ def scenario-foo [ //: tested from any setup or teardown :(scenario run) -def main [ +def main [ run [ 1:num <- copy 13 ] @@ -314,7 +316,7 @@ def main [ } :(scenario run_multiple) -def main [ +def main [ run [ 1:num <- copy 13 ] @@ -336,7 +338,7 @@ Scenario_testing_scenario = false:(scenario memory_check) % Scenario_testing_scenario = true; % Hide_errors = true; -def main [ +def main [ memory-should-contain [ 1 <- 13 ] @@ -458,7 +460,7 @@ put(Recipe_ordinal,:(scenario memory_check_multiple) % Scenario_testing_scenario = true; % Hide_errors = true; -def main [ +def main [ memory-should-contain [ 1 <- 0 1 <- 0 @@ -469,7 +471,7 @@ def main [ :(scenario memory_check_string_length) % Scenario_testing_scenario = true; % Hide_errors = true; -def main [ +def main [ 1:num <- copy 3 2:num <- copy 97 # 'a' 3:num <- copy 98 # 'b' @@ -481,7 +483,7 @@ def main [ +error: expected location '1' to contain length 2 of string [ab] but saw 3 :(scenario memory_check_string) -def main [ +def main [ 1:num <- copy 3 2:num <- copy 97 # 'a' 3:num <- copy 98 # 'b' @@ -498,7 +500,7 @@ def main [ :(scenario memory_invalid_string_check) % Scenario_testing_scenario = true; % Hide_errors = true; -def main [ +def main [ memory-should-contain [ 1 <- [abc] ] @@ -508,7 +510,7 @@ def main [ :(scenario memory_check_with_comment) % Scenario_testing_scenario = true; % Hide_errors = true; -def main [ +def main [ memory-should-contain [ 1 <- 34 # comment ] @@ -524,7 +526,7 @@ def main [ :(scenario trace_check_fails) % Scenario_testing_scenario = true; % Hide_errors = true; -def main [ +def main [ trace-should-contain [ a: b a: d @@ -593,7 +595,7 @@ vector<trace_line> parse_trace(:(scenario trace_check_fails_in_nonfirst_line) % Scenario_testing_scenario = true; % Hide_errors = true; -def main [ +def main [ run [ trace 1, [a], [b] ] @@ -606,7 +608,7 @@ def main [ :(scenario trace_check_passes_silently) % Scenario_testing_scenario = true; -def main [ +def main [ run [ trace 1, [a], [b] ] @@ -624,7 +626,7 @@ $error: 0 :(scenario trace_negative_check_fails) % Scenario_testing_scenario = true; % Hide_errors = true; -def main [ +def main [ run [ trace 1, [a], [b] ] @@ -667,7 +669,7 @@ put(Recipe_ordinal,:(scenario trace_negative_check_passes_silently) % Scenario_testing_scenario = true; -def main [ +def main [ trace-should-not-contain [ a: b ] @@ -678,7 +680,7 @@ $error: 0 :(scenario trace_negative_check_fails_on_any_unexpected_line) % Scenario_testing_scenario = true; % Hide_errors = true; -def main [ +def main [ run [ trace 1, [a], [d] ] @@ -690,7 +692,7 @@ def main [ +error: unexpected [d] in trace with label 'a' :(scenario trace_count_check) -def main [ +def main [ run [ trace 1, [a], [foo] ] @@ -742,7 +744,7 @@ put(Recipe_ordinal,:(scenario trace_count_check_2) % Scenario_testing_scenario = true; % Hide_errors = true; -def main [ +def main [ run [ trace 1, [a], [foo] ] @@ -759,7 +761,7 @@ def main [ :(scenario recipe_name_with_underscore) % Hide_errors = true; -def foo_bar [ +def foo_bar [ ] +error: foo_bar: don't create recipes with '_' in the name diff --git a/html/051scenario_test.mu.html b/html/051scenario_test.mu.html index 951c5858..2b1151be 100644 --- a/html/051scenario_test.mu.html +++ b/html/051scenario_test.mu.html @@ -13,10 +13,10 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muScenario { color: #00af00; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } +.muScenario { color: #00af00; } --> diff --git a/html/052tangle.cc.html b/html/052tangle.cc.html index f3c04e19..b3106faa 100644 --- a/html/052tangle.cc.html +++ b/html/052tangle.cc.html @@ -16,12 +16,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color .Constant { color: #00a0a0; } .traceAbsent { color: #c00000; } .cSpecial { color: #008000; } -.traceContains { color: #008000; } +.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.Identifier { color: #fcb165; } --> @@ -42,12 +43,12 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color //: todo: switch recipe.steps to a more efficient data structure. :(scenario tangle_before) -def main [ +def main [ 1:num <- copy 0 <label1> 3:num <- copy 0 ] -before <label1> [ +before <label1> [ 2:num <- copy 0 ] +mem: storing 0 in location 1 @@ -198,15 +199,15 @@ check_insert_fragments(); } :(scenario tangle_before_and_after) -def main [ +def main [ 1:num <- copy 0 <label1> 4:num <- copy 0 ] -before <label1> [ +before <label1> [ 2:num <- copy 0 ] -after <label1> [ +after <label1> [ 3:num <- copy 0 ] +mem: storing 0 in location 1 @@ -219,33 +220,33 @@ $mem: 4 :(scenario tangle_ignores_jump_target) % Hide_errors = true; -def main [ +def main [ 1:num <- copy 0 +label1 4:num <- copy 0 ] -before +label1 [ +before +label1 [ 2:num <- copy 0 ] +error: can't tangle before label +label1 :(scenario tangle_keeps_labels_separate) -def main [ +def main [ 1:num <- copy 0 <label1> <label2> 6:num <- copy 0 ] -before <label1> [ +before <label1> [ 2:num <- copy 0 ] -after <label1> [ +after <label1> [ 3:num <- copy 0 ] -before <label2> [ +before <label2> [ 4:num <- copy 0 ] -after <label2> [ +after <label2> [ 5:num <- copy 0 ] +mem: storing 0 in location 1 @@ -261,21 +262,21 @@ after <label2> [ $mem: 6 :(scenario tangle_stacks_multiple_fragments) -def main [ +def main [ 1:num <- copy 0 <label1> 6:num <- copy 0 ] -before <label1> [ +before <label1> [ 2:num <- copy 0 ] -after <label1> [ +after <label1> [ 3:num <- copy 0 ] -before <label1> [ +before <label1> [ 4:num <- copy 0 ] -after <label1> [ +after <label1> [ 5:num <- copy 0 ] +mem: storing 0 in location 1 @@ -291,16 +292,16 @@ after <label1> [ $mem: 6 :(scenario tangle_supports_fragments_with_multiple_instructions) -def main [ +def main [ 1:num <- copy 0 <label1> 6:num <- copy 0 ] -before <label1> [ +before <label1> [ 2:num <- copy 0 3:num <- copy 0 ] -after <label1> [ +after <label1> [ 4:num <- copy 0 5:num <- copy 0 ] @@ -315,21 +316,21 @@ after <label1> [ $mem: 6 :(scenario tangle_tangles_into_all_labels_with_same_name) -def main [ +def main [ 1:num <- copy 10 <label1> 4:num <- copy 10 recipe2 ] -def recipe2 [ +def recipe2 [ 1:num <- copy 11 <label1> 4:num <- copy 11 ] -before <label1> [ +before <label1> [ 2:num <- copy 12 ] -after <label1> [ +after <label1> [ 3:num <- copy 12 ] +mem: storing 10 in location 1 @@ -347,16 +348,16 @@ after <label1> [ $mem: 8 :(scenario tangle_tangles_into_all_labels_with_same_name_2) -def main [ +def main [ 1:num <- copy 10 <label1> <label1> 4:num <- copy 10 ] -before <label1> [ +before <label1> [ 2:num <- copy 12 ] -after <label1> [ +after <label1> [ 3:num <- copy 12 ] +mem: storing 10 in location 1 @@ -371,19 +372,19 @@ after <label1> [ $mem: 6 :(scenario tangle_tangles_into_all_labels_with_same_name_3) -def main [ +def main [ 1:num <- copy 10 <label1> <foo> 4:num <- copy 10 ] -before <label1> [ +before <label1> [ 2:num <- copy 12 ] -after <label1> [ +after <label1> [ 3:num <- copy 12 ] -after <foo> [ +after <foo> [ <label1> ] +mem: storing 10 in location 1 @@ -398,13 +399,13 @@ after <foo> [ $mem: 6 :(scenario tangle_handles_jump_target_inside_fragment) -def main [ +def main [ 1:num <- copy 10 <label1> 4:num <- copy 10 ] -before <label1> [ - jump +label2:label +before <label1> [ + jump +label2:label 2:num <- copy 12 +label2 3:num <- copy 12 @@ -419,14 +420,14 @@ before <label1> [ $mem: 3 :(scenario tangle_renames_jump_target) -def main [ +def main [ 1:num <- copy 10 <label1> +label2 4:num <- copy 10 ] -before <label1> [ - jump +label2:label +before <label1> [ + jump +label2:label 2:num <- copy 12 +label2 # renamed 3:num <- copy 12 @@ -441,14 +442,14 @@ before <label1> [ $mem: 3 :(scenario tangle_jump_to_base_recipe) -def main [ +def main [ 1:num <- copy 10 <label1> +label2 4:num <- copy 10 ] -before <label1> [ - jump +label2:label +before <label1> [ + jump +label2:label 2:num <- copy 12 3:num <- copy 12 ] diff --git a/html/053recipe_header.cc.html b/html/053recipe_header.cc.html index f3beba5b..8be8212d 100644 --- a/html/053recipe_header.cc.html +++ b/html/053recipe_header.cc.html @@ -15,15 +15,16 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } .traceAbsent { color: #c00000; } -.cSpecial { color: #008000; } .traceContains { color: #008000; } -.SalientComment { color: #00ffff; } +.muRecipe { color: #ff8700; } +.cSpecial { color: #008000; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } .Identifier { color: #fcb165; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } .Error { color: #ffffff; background-color: #ff6060; padding-bottom: 1px; } +.SalientComment { color: #00ffff; } --> @@ -39,10 +40,10 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color //: number of ingredients and yields some fixed number of products. :(scenario recipe_with_header) -def main [ +def main [ 1:num/raw <- add2 3, 5 ] -def add2 x:num, y:num -> z:num [ +def add2 x:num, y:num -> z:num [ local-scope load-ingredients z:num <- add x, y @@ -87,10 +88,10 @@ has_header = false; } :(scenario recipe_handles_stray_comma) -def main [ +def main [ 1:num/raw <- add2 3, 5 ] -def add2 x:num, y:num -> z:num, [ +def add2 x:num, y:num -> z:num, [ local-scope load-ingredients z:num <- add x, y @@ -99,32 +100,32 @@ def add2 x:num, y:num -&g +mem: storing 8 in location 1 :(scenario recipe_handles_stray_comma_2) -def main [ +def main [ foo ] -def foo, [ +def foo, [ 1:num/raw <- add 2, 2 ] -def bar [ +def bar [ 1:num/raw <- add 2, 3 ] +mem: storing 4 in location 1 :(scenario recipe_handles_wrong_arrow) % Hide_errors = true; -def foo a:num <- b:num [ +def foo a:num <- b:num [ ] +error: recipe foo should say '->' and not '<-' :(scenario recipe_handles_missing_bracket) % Hide_errors = true; -def main +def main ] +error: main: recipe body must begin with '[' :(scenario recipe_handles_missing_bracket_2) % Hide_errors = true; -def main +def main local-scope { } @@ -135,7 +136,7 @@ def main :(scenario recipe_handles_missing_bracket_3) % Hide_errors = true; -def main # comment +def main # comment local-scope { } @@ -155,7 +156,7 @@ out << "products://: If a recipe never mentions any ingredients or products, assume it has a header. :(scenario recipe_without_ingredients_or_products_has_header) -def test [ +def test [ 1:num <- copy 34 ] +parse: recipe test has a header @@ -182,12 +183,12 @@ def test [ //: Support type abbreviations in headers. :(scenario type_abbreviations_in_recipe_headers) -def main [ +def main [ local-scope a:text <- foo 1:char/raw <- index *a, 0 ] -def foo -> a:text [ # 'text' is an abbreviation +def foo -> a:text [ # 'text' is an abbreviation local-scope load-ingredients a <- new [abc] @@ -253,10 +254,10 @@ put(Recipe_ordinal,:(scenario show_clear_error_on_bad_call) % Hide_errors = true; -def main [ +def main [ 1:num <- foo 34 ] -def foo x:point -> y:num [ +def foo x:point -> y:num [ local-scope load-ingredients return 35 @@ -265,10 +266,10 @@ def foo x:point -> y:num [ :(scenario show_clear_error_on_bad_call_2) % Hide_errors = true; -def main [ +def main [ 1:point <- foo 34 ] -def foo x:num -> y:num [ +def foo x:num -> y:num [ local-scope load-ingredients return x @@ -305,7 +306,7 @@ Transform.push_back(:(scenarios transform) :(scenario recipe_headers_are_checked) % Hide_errors = true; -def add2 x:num, y:num -> z:num [ +def add2 x:num, y:num -> z:num [ local-scope load-ingredients z:&:num <- copy 0/unsafe @@ -337,7 +338,7 @@ Transform.push_back(:(scenario recipe_headers_are_checked_2) % Hide_errors = true; -def add2 x:num, y:num [ +def add2 x:num, y:num [ local-scope load-ingredients z:&:num <- copy 0/unsafe @@ -347,7 +348,7 @@ def add2 x:num, y:num [ :(scenario recipe_headers_check_for_duplicate_names) % Hide_errors = true; -def add2 x:num, x:num -> z:num [ +def add2 x:num, x:num -> z:num [ local-scope load-ingredients return z @@ -377,10 +378,10 @@ Transform.push_back(:(scenarios run) :(scenario deduce_instruction_types_from_recipe_header) -def main [ +def main [ 1:num/raw <- add2 3, 5 ] -def add2 x:num, y:num -> z:num [ +def add2 x:num, y:num -> z:num [ local-scope load-ingredients z <- add x, y # no type for z @@ -434,10 +435,10 @@ Transform.push_back(//: in the header. :(scenario return_based_on_header) -def main [ +def main [ 1:num/raw <- add2 3, 5 ] -def add2 x:num, y:num -> z:num [ +def add2 x:num, y:num -> z:num [ local-scope load-ingredients z <- add x, y @@ -485,10 +486,10 @@ Transform.push_back(} :(scenario explicit_reply_ignores_header) -def main [ +def main [ 1:num/raw, 2:num/raw <- add2 3, 5 ] -def add2 a:num, b:num -> y:num, z:num [ +def add2 a:num, b:num -> y:num, z:num [ local-scope load-ingredients y <- add a, b @@ -499,10 +500,10 @@ def add2 a:num, b:num -&g +mem: storing -2 in location 2 :(scenario return_on_fallthrough_based_on_header) -def main [ +def main [ 1:num/raw <- add2 3, 5 ] -def add2 x:num, y:num -> z:num [ +def add2 x:num, y:num -> z:num [ local-scope load-ingredients z <- add x, y @@ -511,10 +512,10 @@ def add2 x:num, y:num -&g +mem: storing 8 in location 1 :(scenario return_on_fallthrough_already_exists) -def main [ +def main [ 1:num/raw <- add2 3, 5 ] -def add2 x:num, y:num -> z:num [ +def add2 x:num, y:num -> z:num [ local-scope load-ingredients z <- add x, y # no type for z @@ -525,10 +526,10 @@ def add2 x:num, y:num -&g +mem: storing 8 in location 1 :(scenario return_after_conditional_reply_based_on_header) -def main [ +def main [ 1:num/raw <- add2 3, 5 ] -def add2 x:num, y:num -> z:num [ +def add2 x:num, y:num -> z:num [ local-scope load-ingredients z <- add x, y # no type for z @@ -538,12 +539,12 @@ def add2 x:num, y:num -&g :(scenario recipe_headers_perform_same_ingredient_check) % Hide_errors = true; -def main [ +def main [ 1:num <- copy 34 2:num <- copy 34 3:num <- add2 1:num, 2:num ] -def add2 x:num, y:num -> x:num [ +def add2 x:num, y:num -> x:num [ local-scope load-ingredients ] diff --git a/html/054static_dispatch.cc.html b/html/054static_dispatch.cc.html index cfcbde40..2e0c7318 100644 --- a/html/054static_dispatch.cc.html +++ b/html/054static_dispatch.cc.html @@ -16,12 +16,14 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color .Constant { color: #00a0a0; } .traceAbsent { color: #c00000; } .cSpecial { color: #008000; } -.traceContains { color: #008000; } +.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.muData { color: #ffff00; } +.Identifier { color: #fcb165; } --> @@ -38,13 +40,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color //: names like 'print' or 'length' in many mutually extensible ways. :(scenario static_dispatch) -def main [ +def main [ 7:num/raw <- test 3 ] -def test a:num -> z:num [ +def test a:num -> z:num [ z <- copy 1 ] -def test a:num, b:num -> z:num [ +def test a:num, b:num -> z:num [ z <- copy 2 ] +mem: storing 1 in location 7 @@ -153,13 +155,13 @@ string next_unused_recipe_name(//: call with the most suitable variant. :(scenario static_dispatch_picks_most_similar_variant) -def main [ +def main [ 7:num/raw <- test 3, 4, 5 ] -def test a:num -> z:num [ +def test a:num -> z:num [ z <- copy 1 ] -def test a:num, b:num -> z:num [ +def test a:num, b:num -> z:num [ z <- copy 2 ] +mem: storing 2 in location 7 @@ -420,10 +422,10 @@ vector<recipe_ordinal> matching_variants(} :(scenario static_dispatch_disabled_in_recipe_without_variants) -def main [ +def main [ 1:num <- test 3 ] -def test [ +def test [ 2:num <- next-ingredient # ensure no header return 34 ] @@ -431,26 +433,26 @@ def test [ :(scenario static_dispatch_disabled_on_headerless_definition) % Hide_errors = true; -def test a:num -> z:num [ +def test a:num -> z:num [ z <- copy 1 ] -def test [ +def test [ return 34 ] +error: redefining recipe test :(scenario static_dispatch_disabled_on_headerless_definition_2) % Hide_errors = true; -def test [ +def test [ return 34 ] -def test a:num -> z:num [ +def test a:num -> z:num [ z <- copy 1 ] +error: redefining recipe test :(scenario static_dispatch_on_primitive_names) -def main [ +def main [ 1:num <- copy 34 2:num <- copy 34 3:bool <- equal 1:num, 2:num @@ -459,7 +461,7 @@ def main [ 6:bool <- equal 4:bool, 5:bool ] # temporarily hardcode number equality to always fail -def equal x:num, y:num -> z:bool [ +def equal x:num, y:num -> z:bool [ local-scope load-ingredients z <- copy 0/false @@ -470,15 +472,15 @@ def equal x:num, y:num -& +mem: storing 1 in location 6 :(scenario static_dispatch_works_with_dummy_results_for_containers) -def main [ +def main [ _ <- test 3, 4 ] -def test a:num -> z:point [ +def test a:num -> z:point [ local-scope load-ingredients z <- merge a, 0 ] -def test a:num, b:num -> z:point [ +def test a:num, b:num -> z:point [ local-scope load-ingredients z <- merge a, b @@ -486,55 +488,55 @@ def test a:num, b:num -&g $error: 0 :(scenario static_dispatch_works_with_compound_type_containing_container_defined_after_first_use) -def main [ - x:&:foo <- new foo:type +def main [ + x:&:foo <- new foo:type test x ] -container foo [ +container foo [ x:num ] -def test a:&:foo -> z:num [ +def test a:&:foo -> z:num [ local-scope load-ingredients - z:num <- get *a, x:offset + z:num <- get *a, x:offset ] $error: 0 :(scenario static_dispatch_works_with_compound_type_containing_container_defined_after_second_use) -def main [ - x:&:foo <- new foo:type +def main [ + x:&:foo <- new foo:type test x ] -def test a:&:foo -> z:num [ +def test a:&:foo -> z:num [ local-scope load-ingredients - z:num <- get *a, x:offset + z:num <- get *a, x:offset ] -container foo [ +container foo [ x:num ] $error: 0 :(scenario static_dispatch_prefers_literals_to_be_numbers_rather_than_addresses) -def main [ +def main [ 1:num <- foo 0 ] -def foo x:&:num -> y:num [ +def foo x:&:num -> y:num [ return 34 ] -def foo x:num -> y:num [ +def foo x:num -> y:num [ return 35 ] +mem: storing 35 in location 1 :(scenario static_dispatch_on_non_literal_character_ignores_variant_with_numbers) % Hide_errors = true; -def main [ +def main [ local-scope x:char <- copy 10/newline 1:num/raw <- foo x ] -def foo x:num -> y:num [ +def foo x:num -> y:num [ load-ingredients return 34 ] @@ -542,15 +544,15 @@ def foo x:num -> y:num [ -mem: storing 34 in location 1 :(scenario static_dispatch_dispatches_literal_to_boolean_before_character) -def main [ +def main [ 1:num/raw <- foo 0 # valid literal for boolean ] -def foo x:char -> y:num [ +def foo x:char -> y:num [ local-scope load-ingredients return 34 ] -def foo x:bool -> y:num [ +def foo x:bool -> y:num [ local-scope load-ingredients return 35 @@ -559,15 +561,15 @@ def foo x:bool -> +mem: storing 35 in location 1 :(scenario static_dispatch_dispatches_literal_to_character_when_out_of_boolean_range) -def main [ +def main [ 1:num/raw <- foo 97 # not a valid literal for boolean ] -def foo x:char -> y:num [ +def foo x:char -> y:num [ local-scope load-ingredients return 34 ] -def foo x:bool -> y:num [ +def foo x:bool -> y:num [ local-scope load-ingredients return 35 @@ -576,15 +578,15 @@ def foo x:bool -> +mem: storing 34 in location 1 :(scenario static_dispatch_dispatches_literal_to_number_if_at_all_possible) -def main [ +def main [ 1:num/raw <- foo 97 ] -def foo x:char -> y:num [ +def foo x:char -> y:num [ local-scope load-ingredients return 34 ] -def foo x:num -> y:num [ +def foo x:num -> y:num [ local-scope load-ingredients return 35 @@ -608,21 +610,21 @@ string header_label(const} :(scenario reload_variant_retains_other_variants) -def main [ +def main [ 1:num <- copy 34 2:num <- foo 1:num ] -def foo x:num -> y:num [ +def foo x:num -> y:num [ local-scope load-ingredients return 34 ] -def foo x:&:num -> y:num [ +def foo x:&:num -> y:num [ local-scope load-ingredients return 35 ] -def! foo x:&:num -> y:num [ +def! foo x:&:num -> y:num [ local-scope load-ingredients return 36 @@ -632,15 +634,15 @@ $error: 0 :(scenario dispatch_errors_come_after_unknown_name_errors) % Hide_errors = true; -def main [ +def main [ y:num <- foo x ] -def foo a:num -> b:num [ +def foo a:num -> b:num [ local-scope load-ingredients return 34 ] -def foo a:bool -> b:num [ +def foo a:bool -> b:num [ local-scope load-ingredients return 35 @@ -649,16 +651,16 @@ def foo a:bool -> +error: main: failed to find a matching call for 'y:num <- foo x' :(scenario override_methods_with_type_abbreviations) -def main [ +def main [ local-scope s:text <- new [abc] 1:num/raw <- foo s ] -def foo a:address:array:character -> result:number [ +def foo a:address:array:character -> result:number [ return 34 ] # identical to previous variant once you take type abbreviations into account -def! foo a:text -> result:num [ +def! foo a:text -> result:num [ return 35 ] +mem: storing 35 in location 1 diff --git a/html/055shape_shifting_container.cc.html b/html/055shape_shifting_container.cc.html index 42065f9c..eaaae3ae 100644 --- a/html/055shape_shifting_container.cc.html +++ b/html/055shape_shifting_container.cc.html @@ -13,16 +13,18 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.Constant { color: #00a0a0; } +.muData { color: #ffff00; } .Special { color: #c00000; } +.muRecipe { color: #ff8700; } .traceContains { color: #008000; } -.cSpecial { color: #008000; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .SalientComment { color: #00ffff; } .Identifier { color: #fcb165; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } .CommentedCode { color: #6c6c6c; } +.Constant { color: #00a0a0; } +.cSpecial { color: #008000; } --> @@ -57,11 +59,11 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color if (!base_type->atom) base_type = base_type->left; :(scenario size_of_shape_shifting_container) -container foo:_t [ +container foo:_t [ x:_t y:num ] -def main [ +def main [ 1:foo:num <- merge 12, 13 3:foo:point <- merge 14, 15, 16 ] @@ -73,21 +75,21 @@ def main [ :(scenario size_of_shape_shifting_container_2) # multiple type ingredients -container foo:_a:_b [ +container foo:_a:_b [ x:_a y:_b ] -def main [ +def main [ 1:foo:num:bool <- merge 34, 1/true ] $error: 0 :(scenario size_of_shape_shifting_container_3) -container foo:_a:_b [ +container foo:_a:_b [ x:_a y:_b ] -def main [ +def main [ 1:text <- new [abc] # compound types for type ingredients {2: (foo number (address array character))} <- merge 34/x, 1:text/y @@ -95,42 +97,42 @@ def main [ $error: 0 :(scenario size_of_shape_shifting_container_4) -container foo:_a:_b [ +container foo:_a:_b [ x:_a y:_b ] -container bar:_a:_b [ +container bar:_a:_b [ # dilated element {data: (foo _a (address _b))} ] -def main [ +def main [ 1:text <- new [abc] 2:bar:num:@:char <- merge 34/x, 1:text/y ] $error: 0 :(scenario shape_shifting_container_extend) -container foo:_a [ +container foo:_a [ x:_a ] -container foo:_a [ +container foo:_a [ y:_a ] $error: 0 :(scenario shape_shifting_container_extend_error) % Hide_errors = true; -container foo:_a [ +container foo:_a [ x:_a ] -container foo:_b [ +container foo:_b [ y:_b ] +error: headers of container 'foo' must use identical type ingredients :(scenario type_ingredient_must_start_with_underscore) % Hide_errors = true; -container foo:t [ +container foo:t [ x:num ] +error: foo: type ingredient 't' must begin with an underscore @@ -236,11 +238,11 @@ map<string, type_ordinal> type_ingredient_n return; :(scenario size_of_shape_shifting_exclusive_container) -exclusive-container foo:_t [ +exclusive-container foo:_t [ x:_t y:num ] -def main [ +def main [ 1:foo:num <- merge 0/x, 34 3:foo:point <- merge 0/x, 15, 16 6:foo:point <- merge 1/y, 23 @@ -260,63 +262,63 @@ def main [ % CHECK_EQ(trace_count_prefix("mem", "storing"), 7); :(scenario get_on_shape_shifting_container) -container foo:_t [ +container foo:_t [ x:_t y:num ] -def main [ +def main [ 1:foo:point <- merge 14, 15, 16 - 2:num <- get 1:foo:point, y:offset + 2:num <- get 1:foo:point, y:offset ] +mem: storing 16 in location 2 :(scenario get_on_shape_shifting_container_2) -container foo:_t [ +container foo:_t [ x:_t y:num ] -def main [ +def main [ 1:foo:point <- merge 14, 15, 16 - 2:point <- get 1:foo:point, x:offset + 2:point <- get 1:foo:point, x:offset ] +mem: storing 14 in location 2 +mem: storing 15 in location 3 :(scenario get_on_shape_shifting_container_3) -container foo:_t [ +container foo:_t [ x:_t y:num ] -def main [ +def main [ 1:foo:&:point <- merge 34/unsafe, 48 - 3:&:point <- get 1:foo:&:point, x:offset + 3:&:point <- get 1:foo:&:point, x:offset ] +mem: storing 34 in location 3 :(scenario get_on_shape_shifting_container_inside_container) -container foo:_t [ +container foo:_t [ x:_t y:num ] -container bar [ +container bar [ x:foo:point y:num ] -def main [ +def main [ 1:bar <- merge 14, 15, 16, 17 - 2:num <- get 1:bar, 1:offset + 2:num <- get 1:bar, 1:offset ] +mem: storing 17 in location 2 :(scenario get_on_complex_shape_shifting_container) -container foo:_a:_b [ +container foo:_a:_b [ x:_a y:_b ] -def main [ +def main [ 1:text <- new [abc] {2: (foo number (address array character))} <- merge 34/x, 1:text/y - 3:text <- get {2: (foo number (address array character))}, y:offset + 3:text <- get {2: (foo number (address array character))}, y:offset 4:bool <- equal 1:text, 3:text ] +mem: storing 1 in location 4 @@ -507,13 +509,13 @@ assert(!contains_type_ingredient:(scenario get_on_shape_shifting_container_error) % Hide_errors = true; -container foo:_t [ +container foo:_t [ x:_t y:num ] -def main [ +def main [ 10:foo:point <- merge 14, 15, 16 - 1:num <- get 10:foo, 1:offset + 1:num <- get 10:foo, 1:offset ] +error: illegal type "foo" seems to be missing a type ingredient or three @@ -641,15 +643,15 @@ type_info& info = get(Type//:: 'merge' on shape-shifting containers :(scenario merge_check_shape_shifting_container_containing_exclusive_container) -container foo:_elem [ +container foo:_elem [ x:num y:_elem ] -exclusive-container bar [ +exclusive-container bar [ x:num y:num ] -def main [ +def main [ 1:foo:bar <- merge 23, 1/y, 34 ] +mem: storing 23 in location 1 @@ -659,29 +661,29 @@ $error: 0 :(scenario merge_check_shape_shifting_container_containing_exclusive_container_2) % Hide_errors = true; -container foo:_elem [ +container foo:_elem [ x:num y:_elem ] -exclusive-container bar [ +exclusive-container bar [ x:num y:num ] -def main [ +def main [ 1:foo:bar <- merge 23, 1/y, 34, 35 ] +error: main: too many ingredients in '1:foo:bar <- merge 23, 1/y, 34, 35' :(scenario merge_check_shape_shifting_exclusive_container_containing_container) -exclusive-container foo:_elem [ +exclusive-container foo:_elem [ x:num y:_elem ] -container bar [ +container bar [ x:num y:num ] -def main [ +def main [ 1:foo:bar <- merge 1/y, 23, 34 ] +mem: storing 1 in location 1 @@ -690,30 +692,30 @@ def main [ $error: 0 :(scenario merge_check_shape_shifting_exclusive_container_containing_container_2) -exclusive-container foo:_elem [ +exclusive-container foo:_elem [ x:num y:_elem ] -container bar [ +container bar [ x:num y:num ] -def main [ +def main [ 1:foo:bar <- merge 0/x, 23 ] $error: 0 :(scenario merge_check_shape_shifting_exclusive_container_containing_container_3) % Hide_errors = true; -exclusive-container foo:_elem [ +exclusive-container foo:_elem [ x:num y:_elem ] -container bar [ +container bar [ x:num y:num ] -def main [ +def main [ 1:foo:bar <- merge 1/y, 23 ] +error: main: too few ingredients in '1:foo:bar <- merge 1/y, 23' diff --git a/html/056shape_shifting_recipe.cc.html b/html/056shape_shifting_recipe.cc.html index 4bfbafc1..dc2c8797 100644 --- a/html/056shape_shifting_recipe.cc.html +++ b/html/056shape_shifting_recipe.cc.html @@ -13,17 +13,19 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.Constant { color: #00a0a0; } -.Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.SalientComment { color: #00ffff; } +.CommentedCode { color: #6c6c6c; } +.muRecipe { color: #ff8700; } +.muData { color: #ffff00; } .traceContains { color: #008000; } +.Delimiter { color: #800080; } +.Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } .cSpecial { color: #008000; } +.Comment { color: #9090ff; } +.Constant { color: #00a0a0; } .Special { color: #c00000; } -.Delimiter { color: #800080; } -.SalientComment { color: #00ffff; } .Identifier { color: #fcb165; } -.Comment { color: #9090ff; } .PreProc { color: #800080; } -.CommentedCode { color: #6c6c6c; } --> @@ -38,18 +40,18 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color //:: Like container definitions, recipes too can contain type parameters. :(scenario shape_shifting_recipe) -def main [ +def main [ 10:point <- merge 14, 15 11:point <- foo 10:point ] # non-matching variant -def foo a:num -> result:num [ +def foo a:num -> result:num [ local-scope load-ingredients result <- copy 34 ] # matching shape-shifting variant -def foo a:_t -> result:_t [ +def foo a:_t -> result:_t [ local-scope load-ingredients result <- copy a @@ -533,18 +535,18 @@ string inspect(const } :(scenario shape_shifting_recipe_2) -def main [ +def main [ 10:point <- merge 14, 15 11:point <- foo 10:point ] # non-matching shape-shifting variant -def foo a:_t, b:_t -> result:num [ +def foo a:_t, b:_t -> result:num [ local-scope load-ingredients result <- copy 34 ] # matching shape-shifting variant -def foo a:_t -> result:_t [ +def foo a:_t -> result:_t [ local-scope load-ingredients result <- copy a @@ -553,17 +555,17 @@ def foo a:_t -> result:_t [ +mem: storing 15 in location 12 :(scenario shape_shifting_recipe_nonroot) -def main [ +def main [ 10:foo:point <- merge 14, 15, 16 20:point/raw <- bar 10:foo:point ] # shape-shifting recipe with type ingredient following some other type -def bar a:foo:_t -> result:_t [ +def bar a:foo:_t -> result:_t [ local-scope load-ingredients - result <- get a, x:offset + result <- get a, x:offset ] -container foo:_t [ +container foo:_t [ x:_t y:num ] @@ -571,33 +573,33 @@ container foo:_t [ +mem: storing 15 in location 21 :(scenario shape_shifting_recipe_nested) -container c:_a:_b [ +container c:_a:_b [ a:_a b:_b ] -def main [ +def main [ s:text <- new [abc] {x: (c (address array character) number)} <- merge s, 34 foo x ] -def foo x:c:_bar:_baz [ +def foo x:c:_bar:_baz [ local-scope load-ingredients ] # no errors :(scenario shape_shifting_recipe_type_deduction_ignores_offsets) -def main [ +def main [ 10:foo:point <- merge 14, 15, 16 20:point/raw <- bar 10:foo:point ] -def bar a:foo:_t -> result:_t [ +def bar a:foo:_t -> result:_t [ local-scope load-ingredients x:num <- copy 1 - result <- get a, x:offset # shouldn't collide with other variable + result <- get a, x:offset # shouldn't collide with other variable ] -container foo:_t [ +container foo:_t [ x:_t y:num ] @@ -605,24 +607,24 @@ container foo:_t [ +mem: storing 15 in location 21 :(scenario shape_shifting_recipe_empty) -def main [ +def main [ foo 1 ] # shape-shifting recipe with no body -def foo a:_t [ +def foo a:_t [ ] # shouldn't crash :(scenario shape_shifting_recipe_handles_shape_shifting_new_ingredient) -def main [ +def main [ 1:&:foo:point <- bar 3 11:foo:point <- copy *1:&:foo:point ] -container foo:_t [ +container foo:_t [ x:_t y:num ] -def bar x:num -> result:&:foo:_t [ +def bar x:num -> result:&:foo:_t [ local-scope load-ingredients # new refers to _t in its ingredient *value* @@ -633,18 +635,18 @@ def bar x:num -> result:&:foo:_t [ +mem: storing 0 in location 13 :(scenario shape_shifting_recipe_handles_shape_shifting_new_ingredient_2) -def main [ +def main [ 1:&:foo:point <- bar 3 11:foo:point <- copy *1:&:foo:point ] -def bar x:num -> result:&:foo:_t [ +def bar x:num -> result:&:foo:_t [ local-scope load-ingredients # new refers to _t in its ingredient *value* result <- new {(foo _t) : type} ] # container defined after use -container foo:_t [ +container foo:_t [ x:_t y:num ] @@ -653,10 +655,10 @@ container foo:_t [ +mem: storing 0 in location 13 :(scenario shape_shifting_recipe_called_with_dummy) -def main [ +def main [ _ <- bar 34 ] -def bar x:_t -> result:&:_t [ +def bar x:_t -> result:&:_t [ local-scope load-ingredients result <- copy 0 @@ -691,13 +693,13 @@ $error: 0 } :(scenario shape_shifting_recipe_supports_compound_types) -def main [ - 1:&:point <- new point:type - *1:&:point <- put *1:&:point, y:offset, 34 +def main [ + 1:&:point <- new point:type + *1:&:point <- put *1:&:point, y:offset, 34 3:&:point <- bar 1:&:point # specialize _t to address:point 4:point <- copy *3:&:point ] -def bar a:_t -> result:_t [ +def bar a:_t -> result:_t [ local-scope load-ingredients result <- copy a @@ -706,26 +708,26 @@ def bar a:_t -> result:_t [ :(scenario shape_shifting_recipe_error) % Hide_errors = true; -def main [ +def main [ a:num <- copy 3 b:&:num <- foo a ] -def foo a:_t -> b:_t [ +def foo a:_t -> b:_t [ load-ingredients b <- copy a ] +error: main: no call found for 'b:&:num <- foo a' :(scenario specialize_inside_recipe_without_header) -def main [ +def main [ foo 3 ] -def foo [ +def foo [ local-scope x:num <- next-ingredient # ensure no header 1:num/raw <- bar x # call a shape-shifting recipe ] -def bar x:_elem -> y:_elem [ +def bar x:_elem -> y:_elem [ local-scope load-ingredients y <- add x, 1 @@ -733,12 +735,12 @@ def bar x:_elem -> y:_elem [ +mem: storing 4 in location 1 :(scenario specialize_with_literal) -def main [ +def main [ local-scope # permit literal to map to number 1:num/raw <- foo 3 ] -def foo x:_elem -> y:_elem [ +def foo x:_elem -> y:_elem [ local-scope load-ingredients y <- add x, 1 @@ -746,12 +748,12 @@ def foo x:_elem -> y:_elem [ +mem: storing 4 in location 1 :(scenario specialize_with_literal_2) -def main [ +def main [ local-scope # permit literal to map to character 1:char/raw <- foo 3 ] -def foo x:_elem -> y:_elem [ +def foo x:_elem -> y:_elem [ local-scope load-ingredients y <- add x, 1 @@ -759,12 +761,12 @@ def foo x:_elem -> y:_elem [ +mem: storing 4 in location 1 :(scenario specialize_with_literal_3) -def main [ +def main [ local-scope # permit '0' to map to address to shape-shifting type-ingredient 1:&:char/raw <- foo 0 ] -def foo x:&:_elem -> y:&:_elem [ +def foo x:&:_elem -> y:&:_elem [ local-scope load-ingredients y <- copy x @@ -774,12 +776,12 @@ $error: 0 :(scenario specialize_with_literal_4) % Hide_errors = true; -def main [ +def main [ local-scope # ambiguous call: what's the type of its ingredient?! foo 0 ] -def foo x:&:_elem -> y:&:_elem [ +def foo x:&:_elem -> y:&:_elem [ local-scope load-ingredients y <- copy x @@ -787,10 +789,10 @@ def foo x:&:_elem -> y:&:_elem [ +error: main: instruction 'foo' has no valid specialization :(scenario specialize_with_literal_5) -def main [ +def main [ foo 3, 4 # recipe mapping two variables to literals ] -def foo x:_elem, y:_elem [ +def foo x:_elem, y:_elem [ local-scope load-ingredients 1:num/raw <- add x, y @@ -799,28 +801,28 @@ def foo x:_elem, y:_elem [ :(scenario multiple_shape_shifting_variants) # try to call two different shape-shifting recipes with the same name -def main [ +def main [ e1:d1:num <- merge 3 e2:d2:num <- merge 4, 5 1:num/raw <- foo e1 2:num/raw <- foo e2 ] # the two shape-shifting definitions -def foo a:d1:_elem -> b:num [ +def foo a:d1:_elem -> b:num [ local-scope load-ingredients return 34 ] -def foo a:d2:_elem -> b:num [ +def foo a:d2:_elem -> b:num [ local-scope load-ingredients return 35 ] # the shape-shifting containers they use -container d1:_elem [ +container d1:_elem [ x:_elem ] -container d2:_elem [ +container d2:_elem [ x:num y:_elem ] @@ -829,26 +831,26 @@ container d2:_elem [ :(scenario multiple_shape_shifting_variants_2) # static dispatch between shape-shifting variants, _including pointer lookups_ -def main [ +def main [ e1:d1:num <- merge 3 e2:&:d2:num <- new {(d2 number): type} 1:num/raw <- foo e1 2:num/raw <- foo *e2 # different from previous scenario ] -def foo a:d1:_elem -> b:num [ +def foo a:d1:_elem -> b:num [ local-scope load-ingredients return 34 ] -def foo a:d2:_elem -> b:num [ +def foo a:d2:_elem -> b:num [ local-scope load-ingredients return 35 ] -container d1:_elem [ +container d1:_elem [ x:_elem ] -container d2:_elem [ +container d2:_elem [ x:num y:_elem ] @@ -857,17 +859,17 @@ container d2:_elem [ :(scenario missing_type_in_shape_shifting_recipe) % Hide_errors = true; -def main [ +def main [ a:d1:num <- merge 3 foo a ] -def foo a:d1:_elem -> b:num [ +def foo a:d1:_elem -> b:num [ local-scope load-ingredients copy e # no such variable return 34 ] -container d1:_elem [ +container d1:_elem [ x:_elem ] +error: foo: unknown type for 'e' in 'copy e' (check the name for typos) @@ -876,17 +878,17 @@ container d1:_elem [ :(scenario missing_type_in_shape_shifting_recipe_2) % Hide_errors = true; -def main [ +def main [ a:d1:num <- merge 3 foo a ] -def foo a:d1:_elem -> b:num [ +def foo a:d1:_elem -> b:num [ local-scope load-ingredients - get e, x:offset # unknown variable in a 'get', which does some extra checking + get e, x:offset # unknown variable in a 'get', which does some extra checking return 34 ] -container d1:_elem [ +container d1:_elem [ x:_elem ] +error: foo: unknown type for 'e' in 'get e, x:offset' (check the name for typos) @@ -895,11 +897,11 @@ container d1:_elem [ :(scenarios transform) :(scenario specialize_recursive_shape_shifting_recipe) -def main [ +def main [ 1:num <- copy 34 2:num <- foo 1:num ] -def foo x:_elem -> y:num [ +def foo x:_elem -> y:num [ local-scope load-ingredients { @@ -913,16 +915,16 @@ def foo x:_elem -> y:num [ :(scenarios run) :(scenario specialize_most_similar_variant) -def main [ - 1:&:num <- new number:type +def main [ + 1:&:num <- new number:type 2:num <- foo 1:&:num ] -def foo x:_elem -> y:num [ +def foo x:_elem -> y:num [ local-scope load-ingredients return 34 ] -def foo x:&:_elem -> y:num [ +def foo x:&:_elem -> y:num [ local-scope load-ingredients return 35 @@ -931,19 +933,19 @@ def foo x:&:_elem -> y:num [ :(scenario specialize_most_similar_variant_2) # version with headers padded with lots of unrelated concrete types -def main [ +def main [ 1:num <- copy 23 2:&:@:num <- copy 0 3:num <- foo 2:&:@:num, 1:num ] # variant with concrete type -def foo dummy:&:@:num, x:num -> y:num, dummy:&:@:num [ +def foo dummy:&:@:num, x:num -> y:num, dummy:&:@:num [ local-scope load-ingredients return 34 ] # shape-shifting variant -def foo dummy:&:@:num, x:_elem -> y:num, dummy:&:@:num [ +def foo dummy:&:@:num, x:_elem -> y:num, dummy:&:@:num [ local-scope load-ingredients return 35 @@ -952,29 +954,29 @@ def foo dummy:&:@:num, x:_elem +mem: storing 34 in location 3 :(scenario specialize_most_similar_variant_3) -def main [ +def main [ 1:text <- new [abc] foo 1:text ] -def foo x:text [ +def foo x:text [ 2:num <- copy 34 ] -def foo x:&:_elem [ +def foo x:&:_elem [ 2:num <- copy 35 ] # make sure the more precise version was used +mem: storing 34 in location 2 :(scenario specialize_literal_as_number) -def main [ +def main [ 1:num <- foo 23 ] -def foo x:_elem -> y:num [ +def foo x:_elem -> y:num [ local-scope load-ingredients return 34 ] -def foo x:char -> y:num [ +def foo x:char -> y:num [ local-scope load-ingredients return 35 @@ -983,17 +985,17 @@ def foo x:char -> :(scenario specialize_literal_as_number_2) # version calling with literal -def main [ +def main [ 1:num <- foo 0 ] # variant with concrete type -def foo x:num -> y:num [ +def foo x:num -> y:num [ local-scope load-ingredients return 34 ] # shape-shifting variant -def foo x:&:_elem -> y:num [ +def foo x:&:_elem -> y:num [ local-scope load-ingredients return 35 @@ -1002,17 +1004,17 @@ def foo x:&:_elem -> y:num [ +mem: storing 34 in location 1 :(scenario specialize_literal_as_address) -def main [ +def main [ 1:num <- foo 0 ] # variant with concrete address type -def foo x:&:num -> y:num [ +def foo x:&:num -> y:num [ local-scope load-ingredients return 34 ] # shape-shifting variant -def foo x:&:_elem -> y:num [ +def foo x:&:_elem -> y:num [ local-scope load-ingredients return 35 @@ -1023,13 +1025,13 @@ def foo x:&:_elem -> y:num [ :(scenario missing_type_during_specialization) % Hide_errors = true; # define a shape-shifting recipe -def foo a:_elem [ +def foo a:_elem [ ] # define a container with field 'z' -container foo2 [ +container foo2 [ z:num ] -def main [ +def main [ local-scope x:foo2 <- merge 34 y:num <- get x, z:offse # typo in 'offset' @@ -1043,13 +1045,13 @@ def main [ :(scenario missing_type_during_specialization2) % Hide_errors = true; # define a shape-shifting recipe -def foo a:_elem [ +def foo a:_elem [ ] # define a container with field 'z' -container foo2 [ +container foo2 [ z:num ] -def main [ +def main [ local-scope x:foo2 <- merge 34 y:num <- get x, z:offse # typo in 'offset' @@ -1062,17 +1064,17 @@ def main [ :(scenario tangle_shape_shifting_recipe) # shape-shifting recipe -def foo a:_elem [ +def foo a:_elem [ local-scope load-ingredients <label1> ] # tangle some code that refers to the type ingredient -after <label1> [ +after <label1> [ b:_elem <- copy a ] # trigger specialization -def main [ +def main [ local-scope foo 34 ] @@ -1080,17 +1082,17 @@ $error: 0 :(scenario tangle_shape_shifting_recipe_with_type_abbreviation) # shape-shifting recipe -def foo a:_elem [ +def foo a:_elem [ local-scope load-ingredients <label1> ] # tangle some code that refers to the type ingredient -after <label1> [ +after <label1> [ b:bool <- copy 0 # type abbreviation ] # trigger specialization -def main [ +def main [ local-scope foo 34 ] @@ -1098,10 +1100,10 @@ $error: 0 :(scenario shape_shifting_recipe_coexists_with_primitive) # recipe overloading a primitive with a generic type -def add a:&:foo:_elem [ +def add a:&:foo:_elem [ assert 0, [should not get here] ] -def main [ +def main [ # call primitive add with literal 0 add 0, 0 ] diff --git a/html/057immutable.cc.html b/html/057immutable.cc.html index 94d6d42f..e1e6faf2 100644 --- a/html/057immutable.cc.html +++ b/html/057immutable.cc.html @@ -15,13 +15,15 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } .cSpecial { color: #008000; } -.traceContains { color: #008000; } +.muRecipe { color: #ff8700; } +.Todo { color: #000000; background-color: #ffff00; padding-bottom: 1px; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } -.Todo { color: #000000; background-color: #ffff00; padding-bottom: 1px; } +.muData { color: #ffff00; } +.Identifier { color: #fcb165; } --> @@ -40,40 +42,40 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color :(scenario can_modify_ingredients_that_are_also_products) # mutable container -def main [ +def main [ local-scope p:point <- merge 34, 35 p <- foo p ] -def foo p:point -> p:point [ +def foo p:point -> p:point [ local-scope load-ingredients - p <- put p, x:offset, 34 + p <- put p, x:offset, 34 ] $error: 0 :(scenario can_modify_ingredients_that_are_also_products_2) -def main [ +def main [ local-scope - p:&:point <- new point:type + p:&:point <- new point:type p <- foo p ] # mutable address to container -def foo p:&:point -> p:&:point [ +def foo p:&:point -> p:&:point [ local-scope load-ingredients - *p <- put *p, x:offset, 34 + *p <- put *p, x:offset, 34 ] $error: 0 :(scenario can_modify_ingredients_that_are_also_products_3) -def main [ +def main [ local-scope - p:&:@:num <- new number:type, 3 + p:&:@:num <- new number:type, 3 p <- foo p ] # mutable address -def foo p:&:@:num -> p:&:@:num [ +def foo p:&:@:num -> p:&:@:num [ local-scope load-ingredients *p <- put-index *p, 0, 34 @@ -81,19 +83,19 @@ def foo p:&:@:num -> p:&:@:num [ $error: 0 :(scenario ignore_literal_ingredients_for_immutability_checks) -def main [ +def main [ local-scope - p:&:d1 <- new d1:type + p:&:d1 <- new d1:type q:num <- foo p ] -def foo p:&:d1 -> q:num [ +def foo p:&:d1 -> q:num [ local-scope load-ingredients - x:&:d1 <- new d1:type - *x <- put *x, p:offset, 34 # ignore this 'p' + x:&:d1 <- new d1:type + *x <- put *x, p:offset, 34 # ignore this 'p' reply 36 ] -container d1 [ +container d1 [ p:num q:num ] @@ -101,13 +103,13 @@ $error: 0 :(scenario cannot_modify_immutable_ingredients) % Hide_errors = true; -def main [ +def main [ local-scope - x:&:num <- new number:type + x:&:num <- new number:type foo x ] # immutable address to primitive -def foo x:&:num [ +def foo x:&:num [ local-scope load-ingredients *x <- copy 34 @@ -116,31 +118,31 @@ def foo x:&:num [ :(scenario cannot_modify_immutable_containers) % Hide_errors = true; -def main [ +def main [ local-scope x:point-number <- merge 34, 35, 36 foo x ] # immutable container -def foo x:point-number [ +def foo x:point-number [ local-scope load-ingredients # copy an element: ok - y:point <- get x, xy:offset + y:point <- get x, xy:offset # modify the element: boom # This could be ok if y contains no addresses, but we're not going to try to be that smart. # It also makes the rules easier to reason about. If it's just an ingredient, just don't try to change it. - y <- put y, x:offset, 37 + y <- put y, x:offset, 37 ] +error: foo: cannot modify 'y' in instruction 'y <- put y, x:offset, 37' because that would modify 'x' which is an ingredient of recipe foo but not also a product :(scenario can_modify_immutable_pointers) -def main [ +def main [ local-scope - x:&:num <- new number:type + x:&:num <- new number:type foo x ] -def foo x:&:num [ +def foo x:&:num [ local-scope load-ingredients # modify the address, not the payload @@ -150,16 +152,16 @@ $error: 0 :(scenario can_modify_immutable_pointers_but_not_their_payloads) % Hide_errors = true; -def main [ +def main [ local-scope - x:&:num <- new number:type + x:&:num <- new number:type foo x ] -def foo x:&:num [ +def foo x:&:num [ local-scope load-ingredients # modify address; ok - x <- new number:type + x <- new number:type # modify payload: boom # this could be ok, but we're not going to try to be that smart *x <- copy 34 @@ -168,17 +170,17 @@ def foo x:&:num [ :(scenario cannot_call_mutating_recipes_on_immutable_ingredients) % Hide_errors = true; -def main [ +def main [ local-scope - p:&:point <- new point:type + p:&:point <- new point:type foo p ] -def foo p:&:point [ +def foo p:&:point [ local-scope load-ingredients bar p ] -def bar p:&:point -> p:&:point [ +def bar p:&:point -> p:&:point [ local-scope load-ingredients # p could be modified here, but it doesn't have to be, it's already marked @@ -188,72 +190,72 @@ def bar p:&:point -> p:&:point [ :(scenario cannot_modify_copies_of_immutable_ingredients) % Hide_errors = true; -def main [ +def main [ local-scope - p:&:point <- new point:type + p:&:point <- new point:type foo p ] -def foo p:&:point [ +def foo p:&:point [ local-scope load-ingredients q:&:point <- copy p - *q <- put *q, x:offset, 34 + *q <- put *q, x:offset, 34 ] +error: foo: cannot modify 'q' in instruction '*q <- put *q, x:offset, 34' because that would modify p which is an ingredient of recipe foo but not also a product :(scenario can_modify_copies_of_mutable_ingredients) -def main [ +def main [ local-scope - p:&:point <- new point:type + p:&:point <- new point:type foo p ] -def foo p:&:point -> p:&:point [ +def foo p:&:point -> p:&:point [ local-scope load-ingredients q:&:point <- copy p - *q <- put *q, x:offset, 34 + *q <- put *q, x:offset, 34 ] $error: 0 :(scenario cannot_modify_address_inside_immutable_ingredients) % Hide_errors = true; -container foo [ +container foo [ x:&:@:num # contains an address ] -def main [ +def main [ # don't run anything ] -def foo a:&:foo [ +def foo a:&:foo [ local-scope load-ingredients - x:&:@:num <- get *a, x:offset # just a regular get of the container + x:&:@:num <- get *a, x:offset # just a regular get of the container *x <- put-index *x, 0, 34 # but then a put-index on the result ] +error: foo: cannot modify 'x' in instruction '*x <- put-index *x, 0, 34' because that would modify a which is an ingredient of recipe foo but not also a product :(scenario cannot_modify_address_inside_immutable_ingredients_2) -container foo [ +container foo [ x:&:@:num # contains an address ] -def main [ +def main [ # don't run anything ] -def foo a:&:foo [ +def foo a:&:foo [ local-scope load-ingredients b:foo <- merge 0 # modify b, completely unrelated to immutable ingredient a - x:&:@:num <- get b, x:offset + x:&:@:num <- get b, x:offset *x <- put-index *x, 0, 34 ] $error: 0 :(scenario cannot_modify_address_inside_immutable_ingredients_3) % Hide_errors = true; -def main [ +def main [ # don't run anything ] -def foo a:&:@:&:num [ +def foo a:&:@:&:num [ local-scope load-ingredients x:&:num <- index *a, 0 # just a regular index of the array @@ -262,10 +264,10 @@ def foo a:&:@:&:num [ +error: foo: cannot modify 'x' in instruction '*x <- copy 34' because that would modify a which is an ingredient of recipe foo but not also a product :(scenario cannot_modify_address_inside_immutable_ingredients_4) -def main [ +def main [ # don't run anything ] -def foo a:&:@:&:num [ +def foo a:&:@:&:num [ local-scope load-ingredients b:&:@:&:num <- new {(address number): type}, 3 @@ -276,10 +278,10 @@ def foo a:&:@:&:num [ $error: 0 :(scenario latter_ingredient_of_index_is_immutable) -def main [ +def main [ # don't run anything ] -def foo a:&:@:&:@:num, b:num -> a:&:@:&:@:num [ +def foo a:&:@:&:@:num, b:num -> a:&:@:&:@:num [ local-scope load-ingredients x:&:@:num <- index *a, b @@ -288,39 +290,39 @@ def foo a:&:@:&:@:num, b:num 0 :(scenario can_traverse_immutable_ingredients) -container test-list [ +container test-list [ next:&:test-list ] -def main [ +def main [ local-scope - p:&:test-list <- new test-list:type + p:&:test-list <- new test-list:type foo p ] -def foo p:&:test-list [ +def foo p:&:test-list [ local-scope load-ingredients p2:&:test-list <- bar p ] -def bar x:&:test-list -> y:&:test-list [ +def bar x:&:test-list -> y:&:test-list [ local-scope load-ingredients - y <- get *x, next:offset + y <- get *x, next:offset ] $error: 0 :(scenario treat_optional_ingredients_as_mutable) -def main [ - k:&:num <- new number:type +def main [ + k:&:num <- new number:type test k ] # recipe taking an immutable address ingredient -def test k:&:num [ +def test k:&:num [ local-scope load-ingredients foo k ] # ..calling a recipe with an optional address ingredient -def foo -> [ +def foo -> [ local-scope load-ingredients k:&:num, found?:bool <- next-ingredient @@ -330,17 +332,17 @@ $error: 0 :(scenario treat_optional_ingredients_as_mutable_2) % Hide_errors = true; -def main [ +def main [ local-scope - p:&:point <- new point:type + p:&:point <- new point:type foo p ] -def foo p:&:point [ +def foo p:&:point [ local-scope load-ingredients bar p ] -def bar [ +def bar [ local-scope load-ingredients p:&:point <- next-ingredient # optional ingredient; assumed to be mutable @@ -349,17 +351,17 @@ def bar [ //: when checking for immutable ingredients, remember to take space into account :(scenario check_space_of_reagents_in_immutability_checks) -def main [ +def main [ a:space <- new-closure - b:&:num <- new number:type + b:&:num <- new number:type run-closure b:&:num, a:space ] -def new-closure [ +def new-closure [ new-default-space - x:&:num <- new number:type + x:&:num <- new number:type return default-space ] -def run-closure x:&:num, s:space [ +def run-closure x:&:num, s:space [ local-scope load-ingredients 0:space/names:new-closure <- copy s @@ -447,25 +449,25 @@ set<int> scan_contained_in_product_indices:(scenarios transform) :(scenario immutability_infects_contained_in_variables) % Hide_errors = true; -container test-list [ +container test-list [ value:num next:&:test-list ] -def main [ +def main [ local-scope - p:&:test-list <- new test-list:type + p:&:test-list <- new test-list:type foo p ] -def foo p:&:test-list [ # p is immutable +def foo p:&:test-list [ # p is immutable local-scope load-ingredients p2:&:test-list <- test-next p # p2 is immutable - *p2 <- put *p2, value:offset, 34 + *p2 <- put *p2, value:offset, 34 ] -def test-next x:&:test-list -> y:&:test-list/contained-in:x [ +def test-next x:&:test-list -> y:&:test-list/contained-in:x [ local-scope load-ingredients - y <- get *x, next:offset + y <- get *x, next:offset ] +error: foo: cannot modify 'p2' in instruction '*p2 <- put *p2, value:offset, 34' because that would modify p which is an ingredient of recipe foo but not also a product @@ -567,30 +569,30 @@ set<int> ingredient_indices:(scenarios transform) :(scenario can_modify_contained_in_addresses) -container test-list [ +container test-list [ value:num next:&:test-list ] -def main [ +def main [ local-scope - p:&:test-list <- new test-list:type + p:&:test-list <- new test-list:type foo p ] -def foo p:&:test-list -> p:&:test-list [ +def foo p:&:test-list -> p:&:test-list [ local-scope load-ingredients p2:&:test-list <- test-next p p <- test-remove p2, p ] -def test-next x:&:test-list -> y:&:test-list [ +def test-next x:&:test-list -> y:&:test-list [ local-scope load-ingredients - y <- get *x, next:offset + y <- get *x, next:offset ] -def test-remove x:&:test-list/contained-in:from, from:&:test-list -> from:&:test-list [ +def test-remove x:&:test-list/contained-in:from, from:&:test-list -> from:&:test-list [ local-scope load-ingredients - *x <- put *x, value:offset, 34 # can modify x + *x <- put *x, value:offset, 34 # can modify x ] $error: 0 diff --git a/html/059to_text.mu.html b/html/059to_text.mu.html index 820a9b47..baeb650e 100644 --- a/html/059to_text.mu.html +++ b/html/059to_text.mu.html @@ -13,11 +13,11 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } -.muScenario { color: #00af00; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } +.muRecipe { color: #ff8700; } +.muScenario { color: #00af00; } --> diff --git a/html/060rewrite_literal_string.cc.html b/html/060rewrite_literal_string.cc.html index 980157d8..17c3a310 100644 --- a/html/060rewrite_literal_string.cc.html +++ b/html/060rewrite_literal_string.cc.html @@ -14,12 +14,13 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background- body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } -.traceContains { color: #008000; } +.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.Identifier { color: #fcb165; } --> @@ -34,10 +35,10 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color //: allow using literal strings anywhere that will accept immutable strings :(scenario passing_literals_to_recipes) -def main [ +def main [ 1:num/raw <- foo [abc] ] -def foo x:text -> n:num [ +def foo x:text -> n:num [ local-scope load-ingredients n <- length *x diff --git a/html/061text.mu.html b/html/061text.mu.html index 12a4c4e0..11271ed6 100644 --- a/html/061text.mu.html +++ b/html/061text.mu.html @@ -13,14 +13,14 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } -.muData { color: #ffff00; } -.muScenario { color: #00af00; } .Delimiter { color: #800080; } +.muControl { color: #c0a020; } +.muData { color: #ffff00; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } +.muScenario { color: #00af00; } --> @@ -1127,7 +1127,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color { empty?:bool <- equal len, 0 break-unless empty? - result <- new {(address array character): type}, 0 + result <- new {(address array character): type}, 0 return } # count #pieces we need room for @@ -1142,7 +1142,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color loop } # allocate space - result <- new {(address array character): type}, count + result <- new {(address array character): type}, count # repeatedly copy slices start..end until delimiter into result[curr-result] curr-result:num <- copy 0 start:num <- copy 0 diff --git a/html/062convert_ingredients_to_text.cc.html b/html/062convert_ingredients_to_text.cc.html index 2228229c..6fef4186 100644 --- a/html/062convert_ingredients_to_text.cc.html +++ b/html/062convert_ingredients_to_text.cc.html @@ -14,12 +14,14 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background- body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } -.traceContains { color: #008000; } +.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.CommentedCode { color: #6c6c6c; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.muData { color: #ffff00; } +.CommentedCode { color: #6c6c6c; } .Identifier { color: #fcb165; } --> @@ -36,7 +38,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color :(scenarios transform) :(scenario rewrite_stashes_to_text) -def main [ +def main [ local-scope n:num <- copy 34 stash n @@ -45,7 +47,7 @@ def main [ +transform: stash {stash_2_0: ("address" "array" "character")} :(scenario rewrite_traces_to_text) -def main [ +def main [ local-scope n:num <- copy 34 trace 2, [app], n @@ -57,16 +59,16 @@ def main [ //: passing addresses around :(scenario rewrite_stashes_of_arrays) -def main [ +def main [ local-scope - n:&:@:num <- new number:type, 3 + n:&:@:num <- new number:type, 3 stash *n ] +transform: {stash_2_0: ("address" "array" "character")} <- array-to-text-line {n: ("address" "array" "number")} +transform: stash {stash_2_0: ("address" "array" "character")} :(scenario ignore_stashes_of_static_arrays) -def main [ +def main [ local-scope n:@:num:3 <- create-array stash n @@ -74,10 +76,10 @@ def main [ +transform: stash {n: ("array" "number" "3")} :(scenario rewrite_stashes_of_recipe_header_products) -container foo [ +container foo [ x:num ] -def bar -> x:foo [ +def bar -> x:foo [ local-scope load-ingredients x <- merge 34 @@ -180,7 +182,7 @@ Transform.push_back(:(scenarios run) :(scenario append_other_types_to_text) -def main [ +def main [ local-scope n:num <- copy 11 c:character <- copy 111/o @@ -194,11 +196,11 @@ def main [ :(scenario rewrite_stash_continues_to_fall_back_to_default_implementation) # type without a to-text implementation -container foo [ +container foo [ x:num y:num ] -def main [ +def main [ local-scope x:foo <- merge 34, 35 stash x diff --git a/html/063array.mu.html b/html/063array.mu.html index 01ed3938..b0578215 100644 --- a/html/063array.mu.html +++ b/html/063array.mu.html @@ -13,13 +13,13 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muScenario { color: #00af00; } .Delimiter { color: #800080; } -.muRecipe { color: #ff8700; } +.muControl { color: #c0a020; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } +.muScenario { color: #00af00; } --> diff --git a/html/064list.mu.html b/html/064list.mu.html index a0b2d805..2fad0c10 100644 --- a/html/064list.mu.html +++ b/html/064list.mu.html @@ -13,14 +13,14 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } .muData { color: #ffff00; } -.muScenario { color: #00af00; } +.muControl { color: #c0a020; } .Delimiter { color: #800080; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } +.muScenario { color: #00af00; } --> @@ -45,7 +45,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color def push x:_elem, in:&:list:_elem -> result:&:list:_elem [ local-scope load-ingredients - result <- new {(list _elem): type} + result <- new {(list _elem): type} *result <- merge x, in ] @@ -95,7 +95,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color def insert x:_elem, in:&:list:_elem -> in:&:list:_elem [ local-scope load-ingredients - new-node:&:list:_elem <- new {(list _elem): type} + new-node:&:list:_elem <- new {(list _elem): type} *new-node <- put *new-node, value:offset, x next-node:&:list:_elem <- get *in, next:offset *in <- put *in, next:offset, new-node diff --git a/html/065duplex_list.mu.html b/html/065duplex_list.mu.html index 430e9f71..af84549a 100644 --- a/html/065duplex_list.mu.html +++ b/html/065duplex_list.mu.html @@ -13,14 +13,14 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } .muData { color: #ffff00; } -.muScenario { color: #00af00; } +.muControl { color: #c0a020; } .Delimiter { color: #800080; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } +.muScenario { color: #00af00; } --> @@ -44,7 +44,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color def push x:_elem, in:&:duplex-list:_elem -> in:&:duplex-list:_elem [ local-scope load-ingredients - result:&:duplex-list:_elem <- new {(duplex-list _elem): type} + result:&:duplex-list:_elem <- new {(duplex-list _elem): type} *result <- merge x, in, 0 { break-unless in @@ -121,7 +121,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color def insert x:_elem, in:&:duplex-list:_elem -> in:&:duplex-list:_elem [ local-scope load-ingredients - new-node:&:duplex-list:_elem <- new {(duplex-list _elem): type} + new-node:&:duplex-list:_elem <- new {(duplex-list _elem): type} *new-node <- put *new-node, value:offset, x # save old next before changing it next-node:&:duplex-list:_elem <- get *in, next:offset diff --git a/html/066stream.mu.html b/html/066stream.mu.html index 6f4f0752..c477233c 100644 --- a/html/066stream.mu.html +++ b/html/066stream.mu.html @@ -13,13 +13,13 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } .muData { color: #ffff00; } +.muControl { color: #c0a020; } .Delimiter { color: #800080; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } --> @@ -40,7 +40,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color def new-stream s:&:@:_elem -> result:&:stream:_elem [ local-scope load-ingredients - result <- new {(stream _elem): type} + result <- new {(stream _elem): type} *result <- put *result, index:offset, 0 *result <- put *result, data:offset, s ] diff --git a/html/068random.mu.html b/html/068random.mu.html index 84ca32c8..52707f10 100644 --- a/html/068random.mu.html +++ b/html/068random.mu.html @@ -13,13 +13,13 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } -.muScenario { color: #00af00; } .Delimiter { color: #800080; } +.muControl { color: #c0a020; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } +.muScenario { color: #00af00; } --> diff --git a/html/069hash.cc.html b/html/069hash.cc.html index 1b4a1b15..c71609da 100644 --- a/html/069hash.cc.html +++ b/html/069hash.cc.html @@ -15,12 +15,14 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } .Special { color: #c00000; } +.muRecipe { color: #ff8700; } .traceContains { color: #008000; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .cSpecial { color: #008000; } .Identifier { color: #fcb165; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.muData { color: #ffff00; } .CommentedCode { color: #6c6c6c; } --> @@ -163,11 +165,11 @@ put(Recipe_ordinal,} :(scenario hash_container_checks_all_elements) -container foo [ +container foo [ x:num y:char ] -def main [ +def main [ 1:foo <- merge 34, 97/a 3:num <- hash 1:foo return-unless 3:num @@ -180,15 +182,15 @@ def main [ +mem: storing 0 in location 7 :(scenario hash_exclusive_container_checks_all_elements) -exclusive-container foo [ +exclusive-container foo [ x:bar y:num ] -container bar [ +container bar [ a:num b:num ] -def main [ +def main [ 1:foo <- merge 0/x, 34, 35 4:num <- hash 1:foo return-unless 4:num @@ -201,11 +203,11 @@ def main [ +mem: storing 0 in location 9 :(scenario hash_can_ignore_container_elements) -container foo [ +container foo [ x:num y:char/ignore-for-hash ] -def main [ +def main [ 1:foo <- merge 34, 97/a 3:num <- hash 1:foo return-unless 3:num @@ -221,7 +223,7 @@ def main [ //: current implementation works like we think it does. :(scenario hash_of_zero_address) -def main [ +def main [ 1:&:num <- copy 0 2:num <- hash 1:&:num ] @@ -230,7 +232,7 @@ def main [ //: This is probably too aggressive, but we need some way to avoid depending //: on the precise bit pattern of a floating-point number. :(scenario hash_of_numbers_ignores_fractional_part) -def main [ +def main [ 1:num <- hash 1.5 2:num <- hash 1 3:bool <- equal 1:num, 2:num @@ -238,7 +240,7 @@ def main [ +mem: storing 1 in location 3 :(scenario hash_of_array_same_as_string) -def main [ +def main [ 10:num <- copy 3 11:num <- copy 97 12:num <- copy 98 @@ -253,11 +255,11 @@ def main [ +mem: storing 1 in location 5 :(scenario hash_ignores_address_value) -def main [ - 1:&:num <- new number:type +def main [ + 1:&:num <- new number:type *1:&:num <- copy 34 2:num <- hash 1:&:num - 3:&:num <- new number:type + 3:&:num <- new number:type *3:&:num <- copy 34 4:num <- hash 3:&:num 5:bool <- equal 2:num, 4:num @@ -266,8 +268,8 @@ def main [ +mem: storing 1 in location 5 :(scenario hash_ignores_address_refcount) -def main [ - 1:&:num <- new number:type +def main [ + 1:&:num <- new number:type *1:&:num <- copy 34 2:num <- hash 1:&:num return-unless 2:num @@ -281,15 +283,15 @@ def main [ +mem: storing 1 in location 5 :(scenario hash_container_depends_only_on_elements) -container foo [ +container foo [ x:num y:char ] -container bar [ +container bar [ x:num y:char ] -def main [ +def main [ 1:foo <- merge 34, 97/a 3:num <- hash 1:foo return-unless 3:num @@ -302,18 +304,18 @@ def main [ +mem: storing 1 in location 7 :(scenario hash_container_depends_only_on_elements_2) -container foo [ +container foo [ x:num y:char z:&:num ] -def main [ - 1:&:num <- new number:type +def main [ + 1:&:num <- new number:type *1:&:num <- copy 34 2:foo <- merge 34, 97/a, 1:&:num 5:num <- hash 2:foo return-unless 5:num - 6:&:num <- new number:type + 6:&:num <- new number:type *6:&:num <- copy 34 7:foo <- merge 34, 97/a, 6:&:num 10:num <- hash 7:foo @@ -324,16 +326,16 @@ def main [ +mem: storing 1 in location 11 :(scenario hash_container_depends_only_on_elements_3) -container foo [ +container foo [ x:num y:char z:bar ] -container bar [ +container bar [ x:num y:num ] -def main [ +def main [ 1:foo <- merge 34, 97/a, 47, 48 6:num <- hash 1:foo return-unless 6:num @@ -346,15 +348,15 @@ def main [ +mem: storing 1 in location 13 :(scenario hash_exclusive_container_ignores_tag) -exclusive-container foo [ +exclusive-container foo [ x:bar y:num ] -container bar [ +container bar [ a:num b:num ] -def main [ +def main [ 1:foo <- merge 0/x, 34, 35 4:num <- hash 1:foo return-unless 4:num @@ -371,7 +373,7 @@ def main [ //: version around and check that the new one is consistent with it. :(scenario hash_matches_old_version) -def main [ +def main [ 1:text <- new [abc] 2:num <- hash 1:text 3:num <- hash_old 1:text diff --git a/html/070table.mu.html b/html/070table.mu.html index 42dae611..b144969e 100644 --- a/html/070table.mu.html +++ b/html/070table.mu.html @@ -13,14 +13,14 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muScenario { color: #00af00; } -.muData { color: #ffff00; } .Delimiter { color: #800080; } -.muRecipe { color: #ff8700; } +.muControl { color: #c0a020; } +.muData { color: #ffff00; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } +.muScenario { color: #00af00; } --> @@ -75,8 +75,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color def new-table capacity:num -> result:&:table:_key:_value [ local-scope load-ingredients - result <- new {(table _key _value): type} - data:&:@:table_row:_key:_value <- new {(table_row _key _value): type}, capacity + result <- new {(table _key _value): type} + data:&:@:table_row:_key:_value <- new {(table_row _key _value): type}, capacity *result <- merge 0/length, capacity, data ] diff --git a/html/071recipe.cc.html b/html/071recipe.cc.html index fd4b234a..f661b770 100644 --- a/html/071recipe.cc.html +++ b/html/071recipe.cc.html @@ -15,13 +15,14 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } .cSpecial { color: #008000; } -.traceContains { color: #008000; } +.muRecipe { color: #ff8700; } .SalientComment { color: #00ffff; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.Identifier { color: #fcb165; } --> @@ -40,10 +41,10 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color //: todo: support storing shape-shifting recipes into recipe variables and calling them :(scenario call_literal_recipe) -def main [ +def main [ 1:num <- call f, 34 ] -def f x:num -> y:num [ +def f x:num -> y:num [ local-scope load-ingredients y <- copy x @@ -51,11 +52,11 @@ def f x:num -> y:num [ +mem: storing 34 in location 1 :(scenario call_variable) -def main [ - {1: (recipe number -> number)} <- copy f - 2:num <- call {1: (recipe number -> number)}, 34 +def main [ + {1: (recipe number -> number)} <- copy f + 2:num <- call {1: (recipe number -> number)}, 34 ] -def f x:num -> y:num [ +def f x:num -> y:num [ local-scope load-ingredients y <- copy x @@ -113,7 +114,7 @@ get_or_insert(Type,//: assume variable types override recipe literals. :(scenario error_on_recipe_literal_used_as_a_variable) % Hide_errors = true; -def main [ +def main [ local-scope a:bool <- equal break 0 break:bool <- copy 0 @@ -160,10 +161,10 @@ put(Recipe_ordinal,:(scenario call_check_literal_recipe) % Hide_errors = true; -def main [ +def main [ 1:num <- call f, 34 ] -def f x:point -> y:point [ +def f x:point -> y:point [ local-scope load-ingredients y <- copy x @@ -173,11 +174,11 @@ def f x:point -> y:point [ :(scenario call_check_variable_recipe) % Hide_errors = true; -def main [ - {1: (recipe point -> point)} <- copy f - 2:num <- call {1: (recipe point -> point)}, 34 +def main [ + {1: (recipe point -> point)} <- copy f + 2:num <- call {1: (recipe point -> point)}, 34 ] -def f x:point -> y:point [ +def f x:point -> y:point [ local-scope load-ingredients y <- copy x @@ -211,7 +212,7 @@ Transform.push_back(} } -recipe from_reagent(const reagent& r) { +recipe from_reagent(const reagent& r) { assert(r.type); recipe result_header; // will contain only ingredients and products, nothing else result_header.has_header = true; @@ -289,12 +290,12 @@ reagent next_recipe_reagent( :(scenario copy_typecheck_recipe_variable) % Hide_errors = true; -def main [ +def main [ 3:num <- copy 34 # abc def - {1: (recipe number -> number)} <- copy f # store literal in a matching variable - {2: (recipe boolean -> boolean)} <- copy {1: (recipe number -> number)} # mismatch between recipe variables + {1: (recipe number -> number)} <- copy f # store literal in a matching variable + {2: (recipe boolean -> boolean)} <- copy {1: (recipe number -> number)} # mismatch between recipe variables ] -def f x:num -> y:num [ +def f x:num -> y:num [ local-scope load-ingredients y <- copy x @@ -303,10 +304,10 @@ def f x:num -> y:num [ :(scenario copy_typecheck_recipe_variable_2) % Hide_errors = true; -def main [ - {1: (recipe number -> number)} <- copy f # mismatch with a recipe literal +def main [ + {1: (recipe number -> number)} <- copy f # mismatch with a recipe literal ] -def f x:bool -> y:bool [ +def f x:bool -> y:bool [ local-scope load-ingredients y <- copy x @@ -333,12 +334,12 @@ def f x:bool -> y: } :(scenario call_variable_compound_ingredient) -def main [ - {1: (recipe (address number) -> number)} <- copy f +def main [ + {1: (recipe (address number) -> number)} <- copy f 2:&:num <- copy 0 - 3:num <- call {1: (recipe (address number) -> number)}, 2:&:num + 3:num <- call {1: (recipe (address number) -> number)}, 2:&:num ] -def f x:&:num -> y:num [ +def f x:&:num -> y:num [ local-scope load-ingredients y <- copy x @@ -348,10 +349,10 @@ $error: 0 //: make sure we don't accidentally break on a function literal :(scenario jump_forbidden_on_recipe_literals) % Hide_errors = true; -def foo [ +def foo [ local-scope ] -def main [ +def main [ local-scope { break-if foo diff --git a/html/072scheduler.cc.html b/html/072scheduler.cc.html index 1d2681fa..648f22b7 100644 --- a/html/072scheduler.cc.html +++ b/html/072scheduler.cc.html @@ -16,14 +16,15 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color .Constant { color: #00a0a0; } .traceAbsent { color: #c00000; } .cSpecial { color: #008000; } -.traceContains { color: #008000; } +.CommentedCode { color: #6c6c6c; } +.muRecipe { color: #ff8700; } .SalientComment { color: #00ffff; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } -.CommentedCode { color: #6c6c6c; } +.Identifier { color: #fcb165; } --> @@ -39,14 +40,14 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color //: guarantees on how the operations in each are interleaved with each other. :(scenario scheduler) -def f1 [ +def f1 [ start-running f2 # wait for f2 to run { jump-unless 1:num, -1 } ] -def f2 [ +def f2 [ 1:num <- copy 1 ] +schedule: f1 @@ -232,7 +233,7 @@ put(Recipe_ordinal,:(scenario scheduler_runs_single_routine) % Scheduling_interval = 1; -def f1 [ +def f1 [ 1:num <- copy 0 2:num <- copy 0 ] @@ -243,12 +244,12 @@ def f1 [ :(scenario scheduler_interleaves_routines) % Scheduling_interval = 1; -def f1 [ +def f1 [ start-running f2 1:num <- copy 0 2:num <- copy 0 ] -def f2 [ +def f2 [ 3:num <- copy 0 4:num <- copy 0 ] @@ -264,14 +265,14 @@ def f2 [ +run: {2: "number"} <- copy {0: "literal"} :(scenario start_running_takes_ingredients) -def f1 [ +def f1 [ start-running f2, 3 # wait for f2 to run { jump-unless 1:num, -1 } ] -def f2 [ +def f2 [ 1:num <- next-ingredient 2:num <- add 1:num, 1 ] @@ -281,21 +282,21 @@ def f2 [ :(scenario start_running_immediately_updates_refcounts_of_ingredients) % Scheduling_interval = 1; -def main [ +def main [ local-scope create-new-routine # padding to make sure we run new-routine before returning dummy:num <- copy 0 dummy:num <- copy 0 ] -def create-new-routine [ +def create-new-routine [ local-scope - n:&:num <- new number:type + n:&:num <- new number:type *n <- copy 34 start-running new-routine, n # refcount of n decremented ] -def new-routine n:&:num [ +def new-routine n:&:num [ local-scope load-ingredients 1:num/raw <- copy *n @@ -318,11 +319,11 @@ increment_any_refcounts(ingredient} :(scenario next_ingredient_never_leaks_refcounts) -def create-space n:&:num -> default-space:space [ - default-space <- new location:type, 2 +def create-space n:&:num -> default-space:space [ + default-space <- new location:type, 2 load-ingredients ] -def use-space [ +def use-space [ local-scope 0:space/names:create-space <- next-ingredient n:&:num/space:1 <- next-ingredient # should decrement refcount @@ -330,7 +331,7 @@ def use-space [ n2:num <- add *n/space:1, 1 reply n2 ] -def main [ +def main [ local-scope n:&:num <- copy 12000/unsafe # pretend allocation with a known address *n <- copy 23 @@ -345,10 +346,10 @@ def main [ //: back to testing 'start-running' :(scenario start_running_returns_routine_id) -def f1 [ +def f1 [ 1:num <- start-running f2 ] -def f2 [ +def f2 [ 12:num <- copy 44 ] +mem: storing 2 in location 1 @@ -362,7 +363,7 @@ def f2 [ % Routines.push_back(new routine(f2)); % Routines.back()->state = COMPLETED; // f2 not meant to run # must have at least one routine without escaping -def f3 [ +def f3 [ 3:num <- copy 0 ] # by interleaving '+' lines with '-' lines, we allow f1 and f3 to run in any order @@ -376,7 +377,7 @@ def f3 [ :(scenario scheduler_starts_at_middle_of_routines) % Routines.push_back(new routine(COPY)); % Routines.back()->state = COMPLETED; -def f1 [ +def f1 [ 1:num <- copy 0 2:num <- copy 0 ] @@ -388,12 +389,12 @@ def f1 [ :(scenario scheduler_terminates_routines_after_errors) % Hide_errors = true; % Scheduling_interval = 2; -def f1 [ +def f1 [ start-running f2 1:num <- copy 0 2:num <- copy 0 ] -def f2 [ +def f2 [ # divide by 0 twice 3:num <- divide-with-remainder 4, 0 4:num <- divide-with-remainder 4, 0 @@ -410,11 +411,11 @@ def f2 [ //:: Routines are marked completed when their parent completes. :(scenario scheduler_kills_orphans) -def main [ +def main [ start-running f1 # f1 never actually runs because its parent completes without waiting for it ] -def f1 [ +def f1 [ 1:num <- copy 0 ] -schedule: f1 @@ -442,13 +443,13 @@ def f1 [ :(scenario routine_state_test) % Scheduling_interval = 2; -def f1 [ +def f1 [ 1:num/child-id <- start-running f2 12:num <- copy 0 # race condition since we don't care about location 12 # thanks to Scheduling_interval, f2's one instruction runs in between here and completes 2:num/state <- routine-state 1:num/child-id ] -def f2 [ +def f2 [ 12:num <- copy 0 # trying to run a second instruction marks routine as completed ] @@ -536,16 +537,16 @@ put(Recipe_ordinal,:(scenario routine_discontinues_past_limit) % Scheduling_interval = 2; -def f1 [ +def f1 [ 1:num/child-id <- start-running f2 limit-time 1:num/child-id, 10 # padding loop just to make sure f2 has time to completed 2:num <- copy 20 2:num <- subtract 2:num, 1 - jump-if 2:num, -2:offset + jump-if 2:num, -2:offset ] -def f2 [ - jump -1:offset # run forever +def f2 [ + jump -1:offset # run forever $print [should never get here], 10/newline ] # f2 terminates @@ -660,14 +661,14 @@ put(Recipe_ordinal,} :(scenario number_of_instructions) -def f1 [ +def f1 [ 10:num/child-id <- start-running f2 { loop-unless 20:num } 11:num <- number-of-instructions 10:num ] -def f2 [ +def f2 [ # 2 instructions worth of work 1:num <- copy 34 20:num <- copy 1 @@ -678,14 +679,14 @@ def f2 [ :(scenario number_of_instructions_across_multiple_scheduling_intervals) % Scheduling_interval = 1; -def f1 [ +def f1 [ 10:num/child-id <- start-running f2 { loop-unless 20:num } 11:num <- number-of-instructions 10:num ] -def f2 [ +def f2 [ # 4 instructions worth of work 1:num <- copy 34 2:num <- copy 1 @@ -699,16 +700,16 @@ def f2 [ //:: make sure that each routine gets a different alloc to start :(scenario new_concurrent) -def f1 [ +def f1 [ start-running f2 - 1:&:num/raw <- new number:type + 1:&:num/raw <- new number:type # wait for f2 to complete { loop-unless 4:num/raw } ] -def f2 [ - 2:&:num/raw <- new number:type +def f2 [ + 2:&:num/raw <- new number:type # hack: assumes scheduler implementation 3:bool/raw <- equal 1:&:num/raw, 2:&:num/raw # signal f2 complete diff --git a/html/073wait.cc.html b/html/073wait.cc.html index 74c5ce2f..ffc27bb9 100644 --- a/html/073wait.cc.html +++ b/html/073wait.cc.html @@ -15,14 +15,16 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } .cSpecial { color: #008000; } -.traceContains { color: #008000; } -.SalientComment { color: #00ffff; } +.muRecipe { color: #ff8700; } +.CommentedCode { color: #6c6c6c; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } -.CommentedCode { color: #6c6c6c; } +.muData { color: #ffff00; } +.Identifier { color: #fcb165; } +.SalientComment { color: #00ffff; } --> @@ -40,7 +42,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color //: operate. :(scenario wait_for_location) -def f1 [ +def f1 [ 10:num <- copy 34 start-running f2 20:location <- copy 10/unsafe @@ -48,7 +50,7 @@ def f1 [ # wait for f2 to run and reset location 1 30:num <- copy 10:num ] -def f2 [ +def f2 [ 10:location <- copy 0/unsafe ] +schedule: f1 @@ -175,10 +177,10 @@ put(Recipe_ordinal,//: containers within containers yet. :(scenario get_location) -def main [ +def main [ 12:num <- copy 34 13:num <- copy 35 - 15:location <- get-location 12:point, 1:offset + 15:location <- get-location 12:point, 1:offset ] +mem: storing 13 in location 15 @@ -258,63 +260,63 @@ put(Recipe_ordinal,:(scenario get_location_out_of_bounds) % Hide_errors = true; -def main [ +def main [ 12:num <- copy 34 13:num <- copy 35 14:num <- copy 36 - get-location 12:point-number/raw, 2:offset # point-number occupies 3 locations but has only 2 fields; out of bounds + get-location 12:point-number/raw, 2:offset # point-number occupies 3 locations but has only 2 fields; out of bounds ] +error: main: invalid offset 2 for 'point-number' :(scenario get_location_out_of_bounds_2) % Hide_errors = true; -def main [ +def main [ 12:num <- copy 34 13:num <- copy 35 14:num <- copy 36 - get-location 12:point-number/raw, -1:offset + get-location 12:point-number/raw, -1:offset ] +error: main: invalid offset -1 for 'point-number' :(scenario get_location_product_type_mismatch) % Hide_errors = true; -container boolbool [ +container boolbool [ x:bool y:bool ] -def main [ +def main [ 12:bool <- copy 1 13:bool <- copy 0 - 15:bool <- get-location 12:boolbool, 1:offset + 15:bool <- get-location 12:boolbool, 1:offset ] +error: main: 'get-location 12:boolbool, 1:offset' should write to type location but '15' has type 'boolean' :(scenario get_location_indirect) # 'get-location' can read from container address -def main [ +def main [ 1:num <- copy 10 # 10 reserved for refcount 11:num <- copy 34 12:num <- copy 35 - 4:location <- get-location 1:&:point/lookup, 0:offset + 4:location <- get-location 1:&:point/lookup, 0:offset ] +mem: storing 11 in location 4 :(scenario get_location_indirect_2) -def main [ +def main [ 1:num <- copy 10 # 10 reserved for refcount 11:num <- copy 34 12:num <- copy 35 4:&:num <- copy 20/unsafe - 4:&:location/lookup <- get-location 1:&:point/lookup, 0:offset + 4:&:location/lookup <- get-location 1:&:point/lookup, 0:offset ] +mem: storing 11 in location 21 //: allow waiting on a routine to complete :(scenario wait_for_routine) -def f1 [ +def f1 [ # add a few routines to run 1:num/routine <- start-running f2 2:num/routine <- start-running f3 @@ -322,12 +324,12 @@ def f1 [ # now wait for f2 to *complete* and modify location 13 before using its value 20:num <- copy 13:num ] -def f2 [ +def f2 [ 10:num <- copy 0 # just padding switch # simulate a block; routine f1 shouldn't restart at this point 13:num <- copy 34 ] -def f3 [ +def f3 [ # padding routine just to help simulate the block in f2 using 'switch' 11:num <- copy 0 12:num <- copy 0 @@ -458,13 +460,13 @@ put(Recipe_ordinal,//: (just for tests; use wait_for_routine above wherever possible) :(scenario wait_for_routine_to_block) -def f1 [ +def f1 [ 1:num/routine <- start-running f2 wait-for-routine-to-block 1:num/routine # now wait for f2 to run and modify location 10 before using its value 11:num <- copy 10:num ] -def f2 [ +def f2 [ 10:num <- copy 34 ] +schedule: f1 @@ -596,7 +598,7 @@ put(Recipe_ordinal,:(scenario cannot_restart_completed_routine) % Scheduling_interval = 1; -def main [ +def main [ local-scope r:num/routine-id <- start-running f x:num <- copy 0 # wait for f to be scheduled @@ -604,14 +606,14 @@ def main [ restart r # should have no effect x:num <- copy 0 # give f time to be scheduled (though it shouldn't be) ] -def f [ +def f [ 1:num/raw <- copy 1 ] # shouldn't crash :(scenario restart_blocked_routine) % Scheduling_interval = 1; -def main [ +def main [ local-scope r:num/routine-id <- start-running f wait-for-routine-to-block r # get past the block in f below @@ -619,7 +621,7 @@ def main [ wait-for-routine-to-block r # should run f to completion ] # function with one block -def f [ +def f [ current-routine-is-blocked # 8 instructions of padding, many more than 'main' above 1:num <- add 1:num, 1 diff --git a/html/074deep_copy.cc.html b/html/074deep_copy.cc.html index bd40721c..1085c615 100644 --- a/html/074deep_copy.cc.html +++ b/html/074deep_copy.cc.html @@ -15,12 +15,14 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } .cSpecial { color: #008000; } -.traceContains { color: #008000; } +.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.muData { color: #ffff00; } +.Identifier { color: #fcb165; } --> @@ -45,7 +47,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color // to new cycles in the product. :(scenario deep_copy_number) -def main [ +def main [ local-scope x:num <- copy 34 y:num <- deep-copy x @@ -55,11 +57,11 @@ def main [ +mem: storing 1 in location 10 :(scenario deep_copy_container_without_address) -container foo [ +container foo [ x:num y:num ] -def main [ +def main [ local-scope a:foo <- merge 34, 35 b:foo <- deep-copy a @@ -70,7 +72,7 @@ def main [ :(scenario deep_copy_address) % Memory_allocated_until = 200; -def main [ +def main [ # avoid all memory allocations except the implicit ones inside deep-copy, so # that the result is deterministic 1:&:num <- copy 100/unsafe # pretend allocation @@ -92,7 +94,7 @@ def main [ :(scenario deep_copy_address_to_container) % Memory_allocated_until = 200; -def main [ +def main [ # avoid all memory allocations except the implicit ones inside deep-copy, so # that the result is deterministic 1:&:point <- copy 100/unsafe # pretend allocation @@ -108,7 +110,7 @@ def main [ :(scenario deep_copy_address_to_address) % Memory_allocated_until = 200; -def main [ +def main [ # avoid all memory allocations except the implicit ones inside deep-copy, so # that the result is deterministic 1:&:&:num <- copy 100/unsafe # pretend allocation @@ -128,7 +130,7 @@ def main [ :(scenario deep_copy_array) % Memory_allocated_until = 200; -def main [ +def main [ # avoid all memory allocations except the implicit ones inside deep-copy, so # that the result is deterministic 100:num <- copy 1 # pretend refcount @@ -152,18 +154,18 @@ def main [ +mem: storing 1 in location 11 :(scenario deep_copy_container_with_address) -container foo [ +container foo [ x:num y:&:num ] -def main [ +def main [ local-scope - y0:&:num <- new number:type + y0:&:num <- new number:type *y0 <- copy 35 a:foo <- merge 34, y0 b:foo <- deep-copy a 10:bool/raw <- equal a, b - y1:&:num <- get b, y:offset + y1:&:num <- get b, y:offset 11:bool/raw <- equal y0, y1 12:num/raw <- copy *y1 ] @@ -174,18 +176,18 @@ def main [ +mem: storing 35 in location 12 :(scenario deep_copy_exclusive_container_with_address) -exclusive-container foo [ +exclusive-container foo [ x:num y:&:num ] -def main [ +def main [ local-scope - y0:&:num <- new number:type + y0:&:num <- new number:type *y0 <- copy 34 a:foo <- merge 1/y, y0 b:foo <- deep-copy a 10:bool/raw <- equal a, b - y1:&:num, z:bool <- maybe-convert b, y:variant + y1:&:num, z:bool <- maybe-convert b, y:variant 11:bool/raw <- equal y0, y1 12:num/raw <- copy *y1 ] @@ -196,23 +198,23 @@ def main [ +mem: storing 34 in location 12 :(scenario deep_copy_exclusive_container_with_container_with_address) -exclusive-container foo [ +exclusive-container foo [ x:num y:bar # inline ] -container bar [ +container bar [ x:&:num ] -def main [ +def main [ local-scope - y0:&:num <- new number:type + y0:&:num <- new number:type *y0 <- copy 34 a:bar <- merge y0 b:foo <- merge 1/y, a c:foo <- deep-copy b 10:bool/raw <- equal b, c - d:bar, z:bool <- maybe-convert c, y:variant - y1:&:num <- get d, x:offset + d:bar, z:bool <- maybe-convert c, y:variant + y1:&:num <- get d, x:offset 11:bool/raw <- equal y0, y1 12:num/raw <- copy *y1 ] @@ -335,81 +337,81 @@ vector<double> deep_copy//: moar tests, just because I can't believe it all works :(scenario deep_copy_stress_test_1) -container foo1 [ +container foo1 [ p:&:num ] -container foo2 [ +container foo2 [ p:&:foo1 ] -exclusive-container foo3 [ +exclusive-container foo3 [ p:&:foo1 q:&:foo2 ] -def main [ +def main [ local-scope - x:&:num <- new number:type + x:&:num <- new number:type *x <- copy 34 - a:&:foo1 <- new foo1:type + a:&:foo1 <- new foo1:type *a <- merge x - b:&:foo2 <- new foo2:type + b:&:foo2 <- new foo2:type *b <- merge a c:foo3 <- merge 1/q, b d:foo3 <- deep-copy c - e:&:foo2, z:bool <- maybe-convert d, q:variant - f:&:foo1 <- get *e, p:offset - g:&:num <- get *f, p:offset + e:&:foo2, z:bool <- maybe-convert d, q:variant + f:&:foo1 <- get *e, p:offset + g:&:num <- get *f, p:offset 1:num/raw <- copy *g ] +mem: storing 34 in location 1 :(scenario deep_copy_stress_test_2) -container foo1 [ +container foo1 [ p:&:num ] -container foo2 [ +container foo2 [ p:&:foo1 ] -exclusive-container foo3 [ +exclusive-container foo3 [ p:&:foo1 q:&:foo2 ] -container foo4 [ +container foo4 [ p:num q:&:foo3 ] -def main [ +def main [ local-scope - x:&:num <- new number:type + x:&:num <- new number:type *x <- copy 34 - a:&:foo1 <- new foo1:type + a:&:foo1 <- new foo1:type *a <- merge x - b:&:foo2 <- new foo2:type + b:&:foo2 <- new foo2:type *b <- merge a - c:&:foo3 <- new foo3:type + c:&:foo3 <- new foo3:type *c <- merge 1/q, b d:foo4 <- merge 35, c e:foo4 <- deep-copy d - f:&:foo3 <- get e, q:offset - g:&:foo2, z:bool <- maybe-convert *f, q:variant - h:&:foo1 <- get *g, p:offset - y:&:num <- get *h, p:offset + f:&:foo3 <- get e, q:offset + g:&:foo2, z:bool <- maybe-convert *f, q:variant + h:&:foo1 <- get *g, p:offset + y:&:num <- get *h, p:offset 1:num/raw <- copy *y ] +mem: storing 34 in location 1 :(scenario deep_copy_cycles) -container foo [ +container foo [ p:num q:&:foo ] -def main [ +def main [ local-scope - x:&:foo <- new foo:type - *x <- put *x, p:offset, 34 - *x <- put *x, q:offset, x # create a cycle + x:&:foo <- new foo:type + *x <- put *x, p:offset, 34 + *x <- put *x, q:offset, x # create a cycle y:&:foo <- deep-copy x - 1:num/raw <- get *y, p:offset - y2:&:foo <- get *y, q:offset + 1:num/raw <- get *y, p:offset + y2:&:foo <- get *y, q:offset stash y [vs] y2 2:bool/raw <- equal y, y2 # is it still a cycle? 3:bool/raw <- equal x, y # is it the same cycle? diff --git a/html/075channel.mu.html b/html/075channel.mu.html index e02135ef..862329f8 100644 --- a/html/075channel.mu.html +++ b/html/075channel.mu.html @@ -13,16 +13,16 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muScenario { color: #00af00; } .muData { color: #ffff00; } -.SalientComment { color: #00ffff; } +.muControl { color: #c0a020; } .Delimiter { color: #800080; } -.muRecipe { color: #ff8700; } +.SalientComment { color: #00ffff; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } .CommentedCode { color: #6c6c6c; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } +.muScenario { color: #00af00; } --> @@ -83,15 +83,15 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color def new-channel capacity:num -> in:&:source:_elem, out:&:sink:_elem [ local-scope load-ingredients - result:&:channel:_elem <- new {(channel _elem): type} + result:&:channel:_elem <- new {(channel _elem): type} *result <- put *result, first-full:offset, 0 *result <- put *result, first-free:offset, 0 capacity <- add capacity, 1 # unused slot for 'full?' below data:&:@:_elem <- new _elem:type, capacity *result <- put *result, data:offset, data - in <- new {(source _elem): type} + in <- new {(source _elem): type} *in <- put *in, chan:offset, result - out <- new {(sink _elem): type} + out <- new {(sink _elem): type} *out <- put *out, chan:offset, result ] diff --git a/html/081print.mu.html b/html/081print.mu.html index 74318453..e4dffe1e 100644 --- a/html/081print.mu.html +++ b/html/081print.mu.html @@ -13,15 +13,15 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } .muData { color: #ffff00; } -.muScenario { color: #00af00; } +.muControl { color: #c0a020; } .Delimiter { color: #800080; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } .CommentedCode { color: #6c6c6c; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } +.muScenario { color: #00af00; } --> diff --git a/html/082scenario_screen.cc.html b/html/082scenario_screen.cc.html index 54d80832..a4daf46a 100644 --- a/html/082scenario_screen.cc.html +++ b/html/082scenario_screen.cc.html @@ -17,11 +17,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color .traceAbsent { color: #c00000; } .cSpecial { color: #008000; } .traceContains { color: #008000; } +.muScenario { color: #00af00; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } .Identifier { color: #fcb165; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.muRecipe { color: #ff8700; } --> @@ -46,7 +48,7 @@ recipes_taking_literal_strings.insert:(scenarios run_mu_scenario) :(scenario screen_in_scenario) -scenario screen-in-scenario [ +scenario screen-in-scenario [ local-scope assume-screen 5/width, 3/height run [ @@ -63,7 +65,7 @@ scenario screen-in-scenario [ # checks are inside scenario :(scenario screen_in_scenario_unicode) -scenario screen-in-scenario-unicode-color [ +scenario screen-in-scenario-unicode-color [ local-scope assume-screen 5/width, 3/height run [ @@ -83,7 +85,7 @@ scenario screen-in-scenario-unicode-color [ :(scenario screen_in_scenario_color) # screen-should-contain can check unicode characters in the fake screen -scenario screen-in-scenario-color [ +scenario screen-in-scenario-color [ local-scope assume-screen 5/width, 3/height run [ @@ -120,7 +122,7 @@ scenario screen-in-scenario-color [ :(scenario screen_in_scenario_error) % Scenario_testing_scenario = true; % Hide_errors = true; -scenario screen-in-scenario-error [ +scenario screen-in-scenario-error [ local-scope assume-screen 5/width, 3/height run [ @@ -140,7 +142,7 @@ scenario screen-in-scenario-error [ % Scenario_testing_scenario = true; % Hide_errors = true; # screen-should-contain can check unicode characters in the fake screen -scenario screen-in-scenario-color [ +scenario screen-in-scenario-color [ local-scope assume-screen 5/width, 3/height run [ @@ -159,7 +161,7 @@ scenario screen-in-scenario-color [ :(scenarios run) :(scenario convert_names_does_not_fail_when_mixing_special_names_and_numeric_locations) % Scenario_testing_scenario = true; -def main [ +def main [ screen:num <- copy 1:num ] -error: mixing variable names and numeric addresses in main @@ -210,7 +212,7 @@ Name[r]["screen"] = SCREEN:(scenario assume_screen_shows_up_in_errors) % Hide_errors = true; -scenario error-in-assume-screen [ +scenario error-in-assume-screen [ assume-screen width, 5 ] +error: scenario_error-in-assume-screen: missing type for 'width' in 'assume-screen width, 5' diff --git a/html/083scenario_screen_test.mu.html b/html/083scenario_screen_test.mu.html index 81fb48ec..26383209 100644 --- a/html/083scenario_screen_test.mu.html +++ b/html/083scenario_screen_test.mu.html @@ -13,10 +13,10 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muScenario { color: #00af00; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } +.muScenario { color: #00af00; } --> diff --git a/html/084console.mu.html b/html/084console.mu.html index 221a3eb8..3af59b06 100644 --- a/html/084console.mu.html +++ b/html/084console.mu.html @@ -13,13 +13,13 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } .muData { color: #ffff00; } +.muControl { color: #c0a020; } .Delimiter { color: #800080; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } --> @@ -43,7 +43,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] container touch-event [ - type:num + type:num row:num column:num ] diff --git a/html/085scenario_console.cc.html b/html/085scenario_console.cc.html index 85303787..b51a7422 100644 --- a/html/085scenario_console.cc.html +++ b/html/085scenario_console.cc.html @@ -15,6 +15,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } .cSpecial { color: #008000; } +.muScenario { color: #00af00; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } @@ -43,7 +44,7 @@ recipes_taking_literal_strings.insert:(scenarios run_mu_scenario) :(scenario keyboard_in_scenario) -scenario keyboard-in-scenario [ +scenario keyboard-in-scenario [ assume-console [ type [abc] ] @@ -221,7 +222,7 @@ initialize_key_names(); } :(scenario events_in_scenario) -scenario events-in-scenario [ +scenario events-in-scenario [ assume-console [ type [abc] left-click 0, 1 diff --git a/html/086scenario_console_test.mu.html b/html/086scenario_console_test.mu.html index a12c99ef..477eda9d 100644 --- a/html/086scenario_console_test.mu.html +++ b/html/086scenario_console_test.mu.html @@ -13,11 +13,10 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muScenario { color: #00af00; } -.muData { color: #ffff00; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } +.muScenario { color: #00af00; } --> @@ -35,7 +34,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color scenario read-key-in-mu [ assume-console [ - type [abc] + type [abc] ] run [ 1:char, console:&:console, 2:bool <- read-key console:&:console diff --git a/html/088file.mu.html b/html/088file.mu.html index 091f18c4..ef8987a2 100644 --- a/html/088file.mu.html +++ b/html/088file.mu.html @@ -13,13 +13,13 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } .muData { color: #ffff00; } +.muControl { color: #c0a020; } .Delimiter { color: #800080; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } --> diff --git a/html/089scenario_filesystem.cc.html b/html/089scenario_filesystem.cc.html index 2d13d5ca..2f10c895 100644 --- a/html/089scenario_filesystem.cc.html +++ b/html/089scenario_filesystem.cc.html @@ -15,6 +15,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } .cSpecial { color: #008000; } +.muScenario { color: #00af00; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } @@ -39,7 +40,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color :(scenarios run_mu_scenario) :(scenario simple_filesystem) -scenario assume-filesystem [ +scenario assume-filesystem [ local-scope assume-filesystem [ # file 'a' containing two lines of data @@ -53,21 +54,21 @@ scenario assume-filesystem [ |xyz| ] ] - data:&:@:file-mapping <- get *filesystem:&:filesystem, data:offset + data:&:@:file-mapping <- get *filesystem:&:filesystem, data:offset file1:file-mapping <- index *data, 0 - file1-name:text <- get file1, name:offset + file1-name:text <- get file1, name:offset 10:@:char/raw <- copy *file1-name - file1-contents:text <- get file1, contents:offset + file1-contents:text <- get file1, contents:offset 100:@:char/raw <- copy *file1-contents file2:file-mapping <- index *data, 1 - file2-name:text <- get file2, name:offset + file2-name:text <- get file2, name:offset 30:@:char/raw <- copy *file2-name - file2-contents:text <- get file2, contents:offset + file2-contents:text <- get file2, contents:offset 40:@:char/raw <- copy *file2-contents file3:file-mapping <- index *data, 2 - file3-name:text <- get file3, name:offset + file3-name:text <- get file3, name:offset 50:@:char/raw <- copy *file3-name - file3-contents:text <- get file3, contents:offset + file3-contents:text <- get file3, contents:offset 60:@:char/raw <- copy *file3-contents memory-should-contain [ 10:array:character <- [a] @@ -83,7 +84,7 @@ de f ] :(scenario escaping_file_contents) -scenario assume-filesystem [ +scenario assume-filesystem [ local-scope assume-filesystem [ # file 'a' containing a '|' @@ -92,11 +93,11 @@ scenario assume-filesystem [ |x\\\\|yz| ] ] - data:&:@:file-mapping <- get *filesystem:&:filesystem, data:offset + data:&:@:file-mapping <- get *filesystem:&:filesystem, data:offset file1:file-mapping <- index *data, 0 - file1-name:text <- get file1, name:offset + file1-name:text <- get file1, name:offset 10:@:char/raw <- copy *file1-name - file1-contents:text <- get file1, contents:offset + file1-contents:text <- get file1, contents:offset 20:@:char/raw <- copy *file1-contents memory-should-contain [ 10:array:character <- [a] diff --git a/html/090scenario_filesystem_test.mu.html b/html/090scenario_filesystem_test.mu.html index 0832ab96..361b71c2 100644 --- a/html/090scenario_filesystem_test.mu.html +++ b/html/090scenario_filesystem_test.mu.html @@ -13,13 +13,13 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muScenario { color: #00af00; } .Delimiter { color: #800080; } -.muRecipe { color: #ff8700; } +.muControl { color: #c0a020; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } +.muScenario { color: #00af00; } --> diff --git a/html/101run_sandboxed.cc.html b/html/101run_sandboxed.cc.html index 563c6d3a..f2883e6f 100644 --- a/html/101run_sandboxed.cc.html +++ b/html/101run_sandboxed.cc.html @@ -15,13 +15,14 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } .cSpecial { color: #008000; } -.traceContains { color: #008000; } +.CommentedCode { color: #6c6c6c; } +.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } -.CommentedCode { color: #6c6c6c; } +.Identifier { color: #fcb165; } --> @@ -37,7 +38,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color //: return some result in string form. :(scenario run_interactive_code) -def main [ +def main [ 1:num/raw <- copy 0 2:text <- new [1:num/raw <- copy 34] run-sandboxed 2:text @@ -46,7 +47,7 @@ def main [ +mem: storing 34 in location 3 :(scenario run_interactive_empty) -def main [ +def main [ 1:text <- copy 0/unsafe 2:text <- run-sandboxed 1:text ] @@ -253,7 +254,7 @@ load(string( if (s == "interactive") return ""; :(scenario run_interactive_comments) -def main [ +def main [ 1:text <- new [# ab add 2, 2] 2:text <- run-sandboxed 1:text @@ -349,7 +350,7 @@ put(Recipe_ordinal,} :(scenario "run_interactive_converts_result_to_text") -def main [ +def main [ # try to interactively add 2 and 2 1:text <- new [add 2, 2] 2:text <- run-sandboxed 1:text @@ -359,7 +360,7 @@ def main [ +mem: storing 52 in location 11 :(scenario "run_interactive_returns_text") -def main [ +def main [ # try to interactively add 2 and 2 1:text <- new [ x:text <- new [a] @@ -374,10 +375,10 @@ def main [ +mem: storing 98 in location 12 :(scenario "run_interactive_returns_errors") -def main [ +def main [ # run a command that generates an error 1:text <- new [x:num <- copy 34 -get x:num, foo:offset] +get x:num, foo:offset] 2:text, 3:text <- run-sandboxed 1:text 10:@:char <- copy 3:text/lookup ] @@ -389,7 +390,7 @@ get x:num, foo:offset] # ... :(scenario run_interactive_with_comment) -def main [ +def main [ # 2 instructions, with a comment after the first 1:&:@:num <- new [a:num <- copy 0 # abc b:num <- copy 0 @@ -529,10 +530,10 @@ put(Recipe_ordinal,} :(scenario reload_continues_past_error) -def main [ +def main [ local-scope x:text <- new [recipe foo [ - get 1234:num, foo:offset + get 1234:num, foo:offset ]] reload x 1:num/raw <- copy 34 @@ -541,7 +542,7 @@ def main [ :(scenario reload_can_repeatedly_load_container_definitions) # define a container and try to create it (merge requires knowing container size) -def main [ +def main [ local-scope x:text <- new [ container foo [ diff --git a/html/channel.mu.html b/html/channel.mu.html index f03f05d2..0e0bdffb 100644 --- a/html/channel.mu.html +++ b/html/channel.mu.html @@ -13,12 +13,12 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } .Delimiter { color: #800080; } +.muControl { color: #c0a020; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } --> diff --git a/html/chessboard.mu.html b/html/chessboard.mu.html index 8a382806..8e15aa53 100644 --- a/html/chessboard.mu.html +++ b/html/chessboard.mu.html @@ -13,16 +13,16 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } .muData { color: #ffff00; } -.muScenario { color: #00af00; } -.Delimiter { color: #800080; } +.muControl { color: #c0a020; } .Special { color: #c00000; } +.Delimiter { color: #800080; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .SalientComment { color: #00ffff; } .CommentedCode { color: #6c6c6c; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } +.muScenario { color: #00af00; } --> @@ -60,7 +60,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-screen 120/width, 20/height # initialize keyboard to type in a move assume-console [ - type [a2-a4 + type [a2-a4 ] ] run [ @@ -146,7 +146,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color correct-length?:boolean <- equal len, 64 assert correct-length?, [chessboard had incorrect size] # board is an array of pointers to files; file is an array of characters - board <- new {(address array character): type}, 8 + board <- new {(address array character): type}, 8 col:num <- copy 0 { done?:boolean <- equal col, 8 diff --git a/html/console.mu.html b/html/console.mu.html index 3dcfef93..82b2d70f 100644 --- a/html/console.mu.html +++ b/html/console.mu.html @@ -13,12 +13,12 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } .Delimiter { color: #800080; } +.muControl { color: #c0a020; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } --> diff --git a/html/counters.mu.html b/html/counters.mu.html index e1936ded..eab79e04 100644 --- a/html/counters.mu.html +++ b/html/counters.mu.html @@ -13,10 +13,10 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } +.muRecipe { color: #ff8700; } --> diff --git a/html/display.mu.html b/html/display.mu.html index 45db818f..75ccd75d 100644 --- a/html/display.mu.html +++ b/html/display.mu.html @@ -13,10 +13,10 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } +.muRecipe { color: #ff8700; } --> diff --git a/html/edit/001-editor.mu.html b/html/edit/001-editor.mu.html index 38865350..35adc47e 100644 --- a/html/edit/001-editor.mu.html +++ b/html/edit/001-editor.mu.html @@ -13,15 +13,15 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } .muData { color: #ffff00; } -.muScenario { color: #00af00; } -.Delimiter { color: #800080; } +.muControl { color: #c0a020; } .Special { color: #c00000; } +.Delimiter { color: #800080; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .SalientComment { color: #00ffff; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } +.muScenario { color: #00af00; } --> diff --git a/html/edit/002-typing.mu.html b/html/edit/002-typing.mu.html index 3c35ec6f..e8d68e3f 100644 --- a/html/edit/002-typing.mu.html +++ b/html/edit/002-typing.mu.html @@ -13,15 +13,15 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } -.Special { color: #c00000; } -.muScenario { color: #00af00; } .Delimiter { color: #800080; } +.muControl { color: #c0a020; } +.Special { color: #c00000; } +.muData { color: #ffff00; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .SalientComment { color: #00ffff; } -.muData { color: #ffff00; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } +.muScenario { color: #00af00; } --> @@ -481,7 +481,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color editor-render screen, e $clear-trace assume-console [ - type [abc] + type [abc] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -503,9 +503,9 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color $clear-trace # type two letters at different places assume-console [ - type [0] + type [0] left-click 1, 2 - type [d] + type [d] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -527,7 +527,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color $clear-trace assume-console [ left-click 1, 5 # right of last line - type [d] + type [d] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -551,7 +551,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color $clear-trace assume-console [ left-click 1, 5 # right of non-last line - type [e] + type [e] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -574,7 +574,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color $clear-trace assume-console [ left-click 3, 5 # below all text - type [d] + type [d] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -598,7 +598,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color $clear-trace assume-console [ left-click 3, 5 # below all text - type [e] + type [e] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -623,7 +623,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color $clear-trace assume-console [ left-click 3, 5 # below all text - type [ef] + type [ef] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -644,7 +644,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color e:&:editor <- new-editor [ab], screen:&:screen, 0/left, 5/right editor-render screen, e assume-console [ - type [01] + type [01] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -666,7 +666,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color editor-render screen, e # type a letter assume-console [ - type [e] + type [e] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -681,7 +681,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] # type a second letter assume-console [ - type [f] + type [f] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -707,7 +707,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color # type more text at the start assume-console [ left-click 3, 0 - type [abc] + type [abc] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -786,7 +786,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color e:&:editor <- new-editor [abcde], screen:&:screen, 0/left, 5/right assume-console [ left-click 1, 3 # right before the wrap icon - type [f] + type [f] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -821,7 +821,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] assume-console [ left-click 1, 4 # at end of first line - type [de] # trigger wrap + type [de] # trigger wrap ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -841,7 +841,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color e:&:editor <- new-editor [abcde], screen:&:screen, 2/left, 7/right assume-console [ left-click 1, 5 # line is full; no wrap icon yet - type [01] + type [01] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -876,7 +876,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-screen 10/width, 5/height e:&:editor <- new-editor [abc], screen:&:screen, 0/left, 10/right assume-console [ - type [0 + type [0 1] ] run [ @@ -982,7 +982,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-screen 10/width, 5/height e:&:editor <- new-editor [abc], screen:&:screen, 1/left, 10/right assume-console [ - type [0 + type [0 1] ] run [ @@ -1034,7 +1034,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color # position cursor after 'cd' and hit 'newline' assume-console [ left-click 2, 8 - type [ + type [ ] ] run [ diff --git a/html/edit/003-shortcuts.mu.html b/html/edit/003-shortcuts.mu.html index e3085a78..f909a4c7 100644 --- a/html/edit/003-shortcuts.mu.html +++ b/html/edit/003-shortcuts.mu.html @@ -13,15 +13,14 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muScenario { color: #00af00; } -.Special { color: #c00000; } .Delimiter { color: #800080; } -.muRecipe { color: #ff8700; } +.muControl { color: #c0a020; } +.Special { color: #c00000; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .SalientComment { color: #00ffff; } -.muData { color: #ffff00; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } +.muScenario { color: #00af00; } --> @@ -437,7 +436,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color $clear-trace assume-console [ press right-arrow - type [0] + type [0] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -547,7 +546,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color check-trace-count-for-label 0, [print-character] # type something and ensure it goes where it should assume-console [ - type [0] + type [0] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -574,7 +573,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color press right-arrow press right-arrow press right-arrow # next line - type [0] + type [0] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -695,7 +694,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-console [ left-click 1, 3 press right-arrow - type [0] + type [0] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -724,7 +723,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-console [ left-click 1, 2 press left-arrow - type [0] + type [0] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -798,7 +797,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-console [ left-click 3, 0 press left-arrow - type [0] + type [0] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -826,7 +825,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-console [ left-click 1, 0 press left-arrow - type [0] + type [0] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -856,7 +855,7 @@ d] assume-console [ left-click 3, 0 press left-arrow - type [0] + type [0] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -995,7 +994,7 @@ d] ] check-trace-count-for-label 0, [print-character] assume-console [ - type [0] + type [0] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -1112,7 +1111,7 @@ d] ] check-trace-count-for-label 0, [print-character] assume-console [ - type [0] + type [0] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -1149,7 +1148,7 @@ d] ] check-trace-count-for-label 0, [print-character] assume-console [ - type [0] + type [0] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -1189,7 +1188,7 @@ d] ] check-trace-count-for-label 0, [print-character] assume-console [ - type [0] + type [0] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -1229,7 +1228,7 @@ d] ] check-trace-count-for-label 0, [print-character] assume-console [ - type [0] + type [0] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -1334,7 +1333,7 @@ d] ] check-trace-count-for-label 0, [print-character] assume-console [ - type [0] + type [0] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -1531,7 +1530,7 @@ d] check-trace-count-for-label 0, [print-character] # editor inserts future characters at cursor assume-console [ - type [z] + type [z] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -2159,7 +2158,7 @@ d] # position cursor at end, type a character assume-console [ left-click 3, 4 - type [g] + type [g] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -2189,7 +2188,7 @@ d] e:&:editor <- new-editor s, screen:&:screen, 0/left, 5/right assume-console [ left-click 3, 4 - type [ + type [ ] ] run [ @@ -2299,7 +2298,7 @@ d] 4 <- 2 ] assume-console [ - type [0] + type [0] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -2328,7 +2327,7 @@ d] ] check-trace-count-for-label 0, [print-character] assume-console [ - type [1] + type [1] ] run [ editor-event-loop screen:&:screen, console:&:console, e diff --git a/html/edit/004-programming-environment.mu.html b/html/edit/004-programming-environment.mu.html index 5b97c018..6e6ba954 100644 --- a/html/edit/004-programming-environment.mu.html +++ b/html/edit/004-programming-environment.mu.html @@ -13,15 +13,15 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } +.muData { color: #ffff00; } +.muControl { color: #c0a020; } .Special { color: #c00000; } -.muScenario { color: #00af00; } .Delimiter { color: #800080; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .SalientComment { color: #00ffff; } -.muData { color: #ffff00; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } +.muScenario { color: #00af00; } --> @@ -118,7 +118,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color break-unless is-touch? # ignore all but 'left-click' events for now # todo: test this - touch-type:num <- get t, type:offset + touch-type:num <- get t, type:offset is-left-click?:bool <- equal touch-type, 65513/mouse-left loop-unless is-left-click?, +next-event:label click-row:num <- get t, row:offset @@ -362,9 +362,9 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color # type one letter in each of them assume-console [ left-click 1, 1 - type [0] + type [0] left-click 1, 17 - type [1] + type [1] ] run [ event-loop screen:&:screen, console:&:console, env @@ -436,7 +436,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] # now try typing a letter assume-console [ - type [z] + type [z] ] run [ event-loop screen:&:screen, console:&:console, env @@ -487,7 +487,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] ] -def render-all screen:&:screen, env:&:environment, {render-editor: (recipe (address screen) (address editor) -> number number (address screen) (address editor))} -> screen:&:screen, env:&:environment [ +def render-all screen:&:screen, env:&:environment, {render-editor: (recipe (address screen) (address editor) -> number number (address screen) (address editor))} -> screen:&:screen, env:&:environment [ local-scope load-ingredients trace 10, [app], [render all] @@ -519,7 +519,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color show-screen screen ] -def render-recipes screen:&:screen, env:&:environment, {render-editor: (recipe (address screen) (address editor) -> number number (address screen) (address editor))} -> screen:&:screen, env:&:environment [ +def render-recipes screen:&:screen, env:&:environment, {render-editor: (recipe (address screen) (address editor) -> number number (address screen) (address editor))} -> screen:&:screen, env:&:environment [ local-scope load-ingredients trace 11, [app], [render recipes] @@ -538,7 +538,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] # replaced in a later layer -def render-sandbox-side screen:&:screen, env:&:environment, {render-editor: (recipe (address screen) (address editor) -> number number (address screen) (address editor))} -> screen:&:screen, env:&:environment [ +def render-sandbox-side screen:&:screen, env:&:environment, {render-editor: (recipe (address screen) (address editor) -> number number (address screen) (address editor))} -> screen:&:screen, env:&:environment [ local-scope load-ingredients current-sandbox:&:editor <- get *env, current-sandbox:offset diff --git a/html/edit/005-sandbox.mu.html b/html/edit/005-sandbox.mu.html index 5afc8a83..8f328e91 100644 --- a/html/edit/005-sandbox.mu.html +++ b/html/edit/005-sandbox.mu.html @@ -13,15 +13,15 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } +.muData { color: #ffff00; } +.muControl { color: #c0a020; } .Special { color: #c00000; } -.muScenario { color: #00af00; } .Delimiter { color: #800080; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .SalientComment { color: #00ffff; } -.muData { color: #ffff00; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } +.muScenario { color: #00af00; } --> @@ -134,7 +134,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color # run another command assume-console [ left-click 1, 80 - type [add 2, 2] + type [add 2, 2] press F4 ] run [ @@ -268,7 +268,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color } ] -def! render-sandbox-side screen:&:screen, env:&:environment, {render-editor: (recipe (address screen) (address editor) -> number number (address screen) (address editor))} -> screen:&:screen, env:&:environment [ +def! render-sandbox-side screen:&:screen, env:&:environment, {render-editor: (recipe (address screen) (address editor) -> number number (address screen) (address editor))} -> screen:&:screen, env:&:environment [ local-scope load-ingredients trace 11, [app], [render sandbox side] @@ -582,7 +582,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-console [ left-click 4, 28 # one past the value of the second arg press backspace - type [3] + type [3] press F4 ] run [ @@ -659,7 +659,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color e:&:editor <- new-editor [abc], screen:&:screen, 0/left, 10/right assume-console [ left-click 1, 2 - type [def] + type [def] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -1002,9 +1002,9 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color # create 2 sandboxes assume-console [ press ctrl-n - type [add 2, 2] + type [add 2, 2] press F4 - type [add 1, 1] + type [add 1, 1] press F4 ] event-loop screen:&:screen, console:&:console, env @@ -1153,7 +1153,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color # create a sandbox assume-console [ press ctrl-n - type [add 1, 1] + type [add 1, 1] press F4 ] event-loop screen:&:screen, console:&:console, env diff --git a/html/edit/006-sandbox-copy.mu.html b/html/edit/006-sandbox-copy.mu.html index 4ed88981..c7f0d656 100644 --- a/html/edit/006-sandbox-copy.mu.html +++ b/html/edit/006-sandbox-copy.mu.html @@ -13,15 +13,14 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muScenario { color: #00af00; } -.Special { color: #c00000; } .Delimiter { color: #800080; } -.muRecipe { color: #ff8700; } +.muControl { color: #c0a020; } +.Special { color: #c00000; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .SalientComment { color: #00ffff; } -.muData { color: #ffff00; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } +.muScenario { color: #00af00; } --> @@ -81,7 +80,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] # cursor should be in the right place assume-console [ - type [0] + type [0] ] run [ event-loop screen:&:screen, console:&:console, env @@ -143,7 +142,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] # cursor should be in the right place assume-console [ - type [0] + type [0] ] run [ event-loop screen:&:screen, console:&:console, env @@ -283,7 +282,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color # type something into the sandbox editor, then click on the 'copy' button assume-console [ left-click 2, 70 # put cursor in sandbox editor - type [0] # type something + type [0] # type something left-click 3, 70 # click 'copy' button ] run [ @@ -302,7 +301,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] # cursor should be in the right place assume-console [ - type [1] + type [1] ] run [ event-loop screen:&:screen, console:&:console, env diff --git a/html/edit/007-sandbox-delete.mu.html b/html/edit/007-sandbox-delete.mu.html index 931df954..285e063e 100644 --- a/html/edit/007-sandbox-delete.mu.html +++ b/html/edit/007-sandbox-delete.mu.html @@ -13,15 +13,14 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muScenario { color: #00af00; } -.Special { color: #c00000; } .Delimiter { color: #800080; } -.muRecipe { color: #ff8700; } +.muControl { color: #c0a020; } +.Special { color: #c00000; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .SalientComment { color: #00ffff; } -.muData { color: #ffff00; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } +.muScenario { color: #00af00; } --> @@ -43,9 +42,9 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color # run a few commands assume-console [ left-click 1, 80 - type [divide-with-remainder 11, 3] + type [divide-with-remainder 11, 3] press F4 - type [add 2, 2] + type [add 2, 2] press F4 ] event-loop screen:&:screen, console:&:console, env @@ -191,9 +190,9 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color # create 2 sandboxes and scroll to second assume-console [ press ctrl-n - type [add 2, 2] + type [add 2, 2] press F4 - type [add 1, 1] + type [add 1, 1] press F4 press page-down ] @@ -236,9 +235,9 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color # create 2 sandboxes and scroll to second assume-console [ press ctrl-n - type [add 2, 2] + type [add 2, 2] press F4 - type [add 1, 1] + type [add 1, 1] press F4 press page-down ] @@ -281,9 +280,9 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color # create 2 sandboxes and scroll to second assume-console [ press ctrl-n - type [add 2, 2] + type [add 2, 2] press F4 - type [add 1, 1] + type [add 1, 1] press F4 press page-down press page-down @@ -328,9 +327,9 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color # create 2 sandboxes assume-console [ press ctrl-n - type [add 2, 2] + type [add 2, 2] press F4 - type [add 1, 1] + type [add 1, 1] press F4 ] event-loop screen:&:screen, console:&:console, env diff --git a/html/edit/008-sandbox-edit.mu.html b/html/edit/008-sandbox-edit.mu.html index 9be5a9a1..b3f3751a 100644 --- a/html/edit/008-sandbox-edit.mu.html +++ b/html/edit/008-sandbox-edit.mu.html @@ -13,15 +13,14 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muScenario { color: #00af00; } -.Special { color: #c00000; } .Delimiter { color: #800080; } -.muRecipe { color: #ff8700; } +.muControl { color: #c0a020; } +.Special { color: #c00000; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .SalientComment { color: #00ffff; } -.muData { color: #ffff00; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } +.muScenario { color: #00af00; } --> @@ -79,7 +78,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] # cursor should be in the right place assume-console [ - type [0] + type [0] ] run [ event-loop screen:&:screen, console:&:console, env @@ -139,7 +138,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] # cursor should be in the right place assume-console [ - type [0] + type [0] ] run [ event-loop screen:&:screen, console:&:console, env @@ -261,9 +260,9 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color # create 2 sandboxes and scroll to second assume-console [ press ctrl-n - type [add 2, 2] + type [add 2, 2] press F4 - type [add 1, 1] + type [add 1, 1] press F4 press page-down press page-down @@ -308,9 +307,9 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color # create 2 sandboxes assume-console [ press ctrl-n - type [add 2, 2] + type [add 2, 2] press F4 - type [add 1, 1] + type [add 1, 1] press F4 ] event-loop screen:&:screen, console:&:console, env diff --git a/html/edit/009-sandbox-test.mu.html b/html/edit/009-sandbox-test.mu.html index b9095f7e..a2124cd4 100644 --- a/html/edit/009-sandbox-test.mu.html +++ b/html/edit/009-sandbox-test.mu.html @@ -13,15 +13,15 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muScenario { color: #00af00; } +.muData { color: #ffff00; } +.muControl { color: #c0a020; } .Special { color: #c00000; } .Delimiter { color: #800080; } -.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .SalientComment { color: #00ffff; } -.muData { color: #ffff00; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } +.muScenario { color: #00af00; } --> @@ -100,7 +100,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-console [ left-click 3, 11 # cursor to end of line press backspace - type [3] + type [3] press F4 ] run [ diff --git a/html/edit/010-sandbox-trace.mu.html b/html/edit/010-sandbox-trace.mu.html index 0bff823b..599f69b3 100644 --- a/html/edit/010-sandbox-trace.mu.html +++ b/html/edit/010-sandbox-trace.mu.html @@ -13,15 +13,15 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muScenario { color: #00af00; } +.muData { color: #ffff00; } +.muControl { color: #c0a020; } .Special { color: #c00000; } .Delimiter { color: #800080; } -.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .SalientComment { color: #00ffff; } -.muData { color: #ffff00; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } +.muScenario { color: #00af00; } --> diff --git a/html/edit/011-errors.mu.html b/html/edit/011-errors.mu.html index d9228d0e..be2a087f 100644 --- a/html/edit/011-errors.mu.html +++ b/html/edit/011-errors.mu.html @@ -13,15 +13,15 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } .muData { color: #ffff00; } -.muScenario { color: #00af00; } -.Delimiter { color: #800080; } +.muControl { color: #c0a020; } .Special { color: #c00000; } +.Delimiter { color: #800080; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .SalientComment { color: #00ffff; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } +.muScenario { color: #00af00; } --> @@ -197,10 +197,10 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-console [ left-click 3, 80 # create invalid sandbox 1 - type [get foo, x:offset] + type [get foo, x:offset] press F4 # create invalid sandbox 0 - type [get foo, x:offset] + type [get foo, x:offset] press F4 ] run [ @@ -220,13 +220,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-console [ left-click 3, 80 # create invalid sandbox 2 - type [get foo, x:offset] + type [get foo, x:offset] press F4 # create invalid sandbox 1 - type [get foo, x:offset] + type [get foo, x:offset] press F4 # create valid sandbox 0 - type [add 2, 2] + type [add 2, 2] press F4 ] run [ @@ -252,7 +252,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-console [ left-click 3, 58 press ctrl-k - type [add 2, 2] # valid code + type [add 2, 2] # valid code press F4 # update sandbox ] run [ diff --git a/html/edit/012-editor-undo.mu.html b/html/edit/012-editor-undo.mu.html index be0db050..38ab0f2d 100644 --- a/html/edit/012-editor-undo.mu.html +++ b/html/edit/012-editor-undo.mu.html @@ -13,15 +13,15 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } .muData { color: #ffff00; } -.muScenario { color: #00af00; } -.Delimiter { color: #800080; } +.muControl { color: #c0a020; } .Special { color: #c00000; } +.Delimiter { color: #800080; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .SalientComment { color: #00ffff; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } +.muScenario { color: #00af00; } --> @@ -140,7 +140,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color e:&:editor <- new-editor [], screen:&:screen, 0/left, 10/right editor-render screen, e assume-console [ - type [0] + type [0] ] editor-event-loop screen:&:screen, console:&:console, e # undo @@ -159,7 +159,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] # cursor should be in the right place assume-console [ - type [1] + type [1] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -203,7 +203,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color insert-from:&:duplex-list:char <- next cursor-before insert-to:&:duplex-list:char <- next insert-from op:&:operation <- new operation:type - *op <- merge 0/insert-operation, save-row/before, save-column/before, top-before, cursor-row/after, cursor-column/after, top-after, insert-from, insert-to, 1/coalesce + *op <- merge 0/insert-operation, save-row/before, save-column/before, top-before, cursor-row/after, cursor-column/after, top-after, insert-from, insert-to, 1/coalesce editor <- add-operation editor, op +done-adding-insert-operation ] @@ -224,7 +224,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color before-cursor:&:duplex-list:char <- get *editor, before-cursor:offset insert-to:&:duplex-list:char <- next before-cursor op:&:operation <- new operation:type - *op <- merge 0/insert-operation, cursor-row-before, cursor-column-before, top-before, cursor-row/after, cursor-column/after, top-after, insert-from, insert-to, 0/never-coalesce + *op <- merge 0/insert-operation, cursor-row-before, cursor-column-before, top-before, cursor-row/after, cursor-column/after, top-after, insert-from, insert-to, 0/never-coalesce editor <- add-operation editor, op ] @@ -270,7 +270,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color e:&:editor <- new-editor [], screen:&:screen, 0/left, 10/right editor-render screen, e assume-console [ - type [012] + type [012] ] editor-event-loop screen:&:screen, console:&:console, e # undo @@ -297,7 +297,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color editor-render screen, e # type some characters assume-console [ - type [012] + type [012] ] editor-event-loop screen:&:screen, console:&:console, e screen-should-contain [ @@ -322,7 +322,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] # cursor should be in the right place assume-console [ - type [3] + type [3] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -383,7 +383,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] # cursor should be at end of line assume-console [ - type [1] + type [1] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -405,7 +405,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color e:&:editor <- new-editor [a], screen:&:screen, 0/left, 10/right editor-render screen, e assume-console [ - type [012] + type [012] press ctrl-z ] editor-event-loop screen:&:screen, console:&:console, e @@ -431,7 +431,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] # cursor should be in the right place assume-console [ - type [3] + type [3] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -469,7 +469,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color e:&:editor <- new-editor [], screen:&:screen, 0/left, 10/right editor-render screen, e assume-console [ - type [012] + type [012] press ctrl-z ] editor-event-loop screen:&:screen, console:&:console, e @@ -495,7 +495,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] # cursor should be in the right place assume-console [ - type [3] + type [3] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -518,13 +518,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color e:&:editor <- new-editor contents, screen:&:screen, 0/left, 10/right editor-render screen, e assume-console [ - type [1] + type [1] press ctrl-z ] editor-event-loop screen:&:screen, console:&:console, e # do some more work assume-console [ - type [0] + type [0] ] editor-event-loop screen:&:screen, console:&:console, e screen-should-contain [ @@ -560,12 +560,12 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color # insert some text and tabs, hit enter, some more text and tabs assume-console [ press tab - type [ab] + type [ab] press tab - type [cd] + type [cd] press enter press tab - type [efg] + type [efg] ] editor-event-loop screen:&:screen, console:&:console, e screen-should-contain [ @@ -738,7 +738,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] # cursor should be in the right place assume-console [ - type [1] + type [1] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -780,7 +780,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color break +done-adding-move-operation:label } 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 + *op <- merge 1/move-operation, cursor-row-before, cursor-column-before, top-before, cursor-row/after, cursor-column/after, top-after, undo-coalesce-tag editor <- add-operation editor, op +done-adding-move-operation ] @@ -850,7 +850,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] # cursor should be in the right place assume-console [ - type [1] + type [1] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -894,7 +894,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] # cursor should be in the right place assume-console [ - type [1] + type [1] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -945,7 +945,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] # cursor should be in the right place assume-console [ - type [1] + type [1] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -990,7 +990,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] # cursor should be in the right place assume-console [ - type [1] + type [1] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -1173,7 +1173,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] # cursor should be in the right place assume-console [ - type [1] + type [1] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -1218,7 +1218,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] # cursor should be in the right place assume-console [ - type [1] + type [1] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -1263,7 +1263,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] # cursor should be in the right place assume-console [ - type [1] + type [1] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -1308,7 +1308,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] # cursor should be in the right place assume-console [ - type [1] + type [1] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -1407,7 +1407,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] # cursor should be in the right place assume-console [ - type [1] + type [1] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -1442,9 +1442,9 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color e:&:editor <- new-editor [], screen:&:screen, 0/left, 10/right editor-render screen, e assume-console [ - type [abc] + type [abc] left-click 1, 1 - type [d] + type [d] ] editor-event-loop screen:&:screen, console:&:console, e 3:num/raw <- get *e, cursor-row:offset @@ -1592,7 +1592,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color editor-render screen, e # insert some text and hit backspace assume-console [ - type [abc] + type [abc] press backspace press backspace ] @@ -1683,7 +1683,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color # if not, create a new operation op:&:operation <- new operation:type deleted-until:&:duplex-list:char <- next before-cursor - *op <- merge 2/delete-operation, save-row/before, save-column/before, top-before, cursor-row/after, cursor-column/after, top-after, backspaced-cell/deleted, before-cursor/delete-from, deleted-until, 1/coalesce-backspace + *op <- merge 2/delete-operation, save-row/before, save-column/before, top-before, cursor-row/after, cursor-column/after, top-after, backspaced-cell/deleted, before-cursor/delete-from, deleted-until, 1/coalesce-backspace editor <- add-operation editor, op +done-adding-backspace-operation } @@ -1737,7 +1737,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color editor-render screen, e # insert some text and hit delete and backspace a few times assume-console [ - type [abcdef] + type [abcdef] left-click 1, 2 press delete press backspace @@ -1910,7 +1910,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color # if not, create a new operation op:&:operation <- new operation:type deleted-until:&:duplex-list:char <- next before-cursor - *op <- merge 2/delete-operation, save-row/before, save-column/before, top-before, cursor-row/after, cursor-column/after, top-after, deleted-cell/deleted, before-cursor/delete-from, deleted-until, 2/coalesce-delete + *op <- merge 2/delete-operation, save-row/before, save-column/before, top-before, cursor-row/after, cursor-column/after, top-after, deleted-cell/deleted, before-cursor/delete-from, deleted-until, 2/coalesce-delete editor <- add-operation editor, op +done-adding-delete-operation } @@ -1988,7 +1988,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] # cursor should be in the right place assume-console [ - type [1] + type [1] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -2013,7 +2013,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color cursor-column:num <- get *editor, cursor-column:offset deleted-until:&:duplex-list:char <- next before-cursor op:&:operation <- new operation:type - *op <- merge 2/delete-operation, save-row/before, save-column/before, top-before, cursor-row/after, cursor-column/after, top-after, deleted-cells/deleted, before-cursor/delete-from, deleted-until, 0/never-coalesce + *op <- merge 2/delete-operation, save-row/before, save-column/before, top-before, cursor-row/after, cursor-column/after, top-after, deleted-cells/deleted, before-cursor/delete-from, deleted-until, 0/never-coalesce editor <- add-operation editor, op +done-adding-delete-operation } @@ -2091,7 +2091,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] # cursor should be in the right place assume-console [ - type [1] + type [1] ] run [ editor-event-loop screen:&:screen, console:&:console, e @@ -2117,7 +2117,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color deleted-until:&:duplex-list:char <- next before-cursor cursor-row:num <- get *editor, cursor-row:offset cursor-column:num <- get *editor, cursor-column:offset - *op <- merge 2/delete-operation, save-row/before, save-column/before, top-before, cursor-row/after, cursor-column/after, top-after, deleted-cells/deleted, before-cursor/delete-from, deleted-until, 0/never-coalesce + *op <- merge 2/delete-operation, save-row/before, save-column/before, top-before, cursor-row/after, cursor-column/after, top-after, deleted-cells/deleted, before-cursor/delete-from, deleted-until, 0/never-coalesce editor <- add-operation editor, op +done-adding-delete-operation } @@ -2131,7 +2131,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color editor-render screen, e # insert some text and hit delete and backspace a few times assume-console [ - type [abc] + type [abc] press ctrl-u press ctrl-z ] diff --git a/html/example1.mu.html b/html/example1.mu.html index 66a965cd..3d4d40eb 100644 --- a/html/example1.mu.html +++ b/html/example1.mu.html @@ -13,9 +13,9 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } .Constant { color: #00a0a0; } .Special { color: #c00000; } +.muRecipe { color: #ff8700; } --> diff --git a/html/factorial.mu.html b/html/factorial.mu.html index ccd47c99..43fcad16 100644 --- a/html/factorial.mu.html +++ b/html/factorial.mu.html @@ -13,13 +13,13 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } -.muScenario { color: #00af00; } .Delimiter { color: #800080; } +.muControl { color: #c0a020; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } +.muScenario { color: #00af00; } --> diff --git a/html/filesystem.mu.html b/html/filesystem.mu.html index fbc5cd20..aaa31fe0 100644 --- a/html/filesystem.mu.html +++ b/html/filesystem.mu.html @@ -13,12 +13,12 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } .Delimiter { color: #800080; } +.muControl { color: #c0a020; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } --> diff --git a/html/fork.mu.html b/html/fork.mu.html index 3f847dc3..b1565526 100644 --- a/html/fork.mu.html +++ b/html/fork.mu.html @@ -13,11 +13,11 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } -.Comment { color: #9090ff; } -.Delimiter { color: #800080; } .Constant { color: #00a0a0; } .muControl { color: #c0a020; } +.Comment { color: #9090ff; } +.Delimiter { color: #800080; } +.muRecipe { color: #ff8700; } --> diff --git a/html/global.mu.html b/html/global.mu.html index e70038c7..32e227e0 100644 --- a/html/global.mu.html +++ b/html/global.mu.html @@ -13,10 +13,10 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } +.muRecipe { color: #ff8700; } --> diff --git a/html/immutable-error.mu.html b/html/immutable-error.mu.html index 0a757e21..93afe020 100644 --- a/html/immutable-error.mu.html +++ b/html/immutable-error.mu.html @@ -13,10 +13,10 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } +.muRecipe { color: #ff8700; } --> diff --git a/html/lambda-to-mu.mu.html b/html/lambda-to-mu.mu.html index 5383acd5..e591592b 100644 --- a/html/lambda-to-mu.mu.html +++ b/html/lambda-to-mu.mu.html @@ -13,16 +13,16 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muScenario { color: #00af00; } .muData { color: #ffff00; } +.muControl { color: #c0a020; } .Delimiter { color: #800080; } -.muRecipe { color: #ff8700; } .Special { color: #c00000; } .Constant { color: #00a0a0; } .SalientComment { color: #00ffff; } .CommentedCode { color: #6c6c6c; } .Comment { color: #9090ff; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } +.muScenario { color: #00af00; } --> @@ -378,7 +378,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color s:text <- new [(abc def)] x:&:cell <- parse s trace-should-contain [ - app/parse: < abc | < def | <> > > + app/parse: < abc | < def | <> > > ] 10:boolean/raw <- is-pair? x x1:&:cell <- first x @@ -406,7 +406,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color s:text <- new [ ( abc def ) ] # extra spaces x:&:cell <- parse s trace-should-contain [ - app/parse: < abc | < def | <> > > + app/parse: < abc | < def | <> > > ] 10:boolean/raw <- is-pair? x x1:&:cell <- first x @@ -434,7 +434,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color s:text <- new [(abc def ghi)] x:&:cell <- parse s trace-should-contain [ - app/parse: < abc | < def | < ghi | <> > > > + app/parse: < abc | < def | < ghi | <> > > > ] 10:boolean/raw <- is-pair? x x1:&:cell <- first x @@ -495,7 +495,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color s:text <- new [((abc) def)] x:&:cell <- parse s trace-should-contain [ - app/parse: < < abc | <> > | < def | <> > > + app/parse: < < abc | <> > | < def | <> > > ] 10:boolean/raw <- is-pair? x x1:&:cell <- first x @@ -550,7 +550,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color s:text <- new [(abc . def)] x:&:cell <- parse s trace-should-contain [ - app/parse: < abc | def > + app/parse: < abc | def > ] 10:boolean/raw <- is-pair? x x1:&:cell <- first x @@ -574,7 +574,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color s:text <- new [(abc def . ghi)] x:&:cell <- parse s trace-should-contain [ - app/parse: < abc | < def | ghi > > + app/parse: < abc | < def | ghi > > ] 10:boolean/raw <- is-pair? x x1:&:cell <- first x diff --git a/html/mutable.mu.html b/html/mutable.mu.html index f8557ee0..82c7ae10 100644 --- a/html/mutable.mu.html +++ b/html/mutable.mu.html @@ -13,10 +13,10 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } +.muRecipe { color: #ff8700; } --> diff --git a/html/nqueens.mu.html b/html/nqueens.mu.html index b05a8618..979690cb 100644 --- a/html/nqueens.mu.html +++ b/html/nqueens.mu.html @@ -13,13 +13,13 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } .muData { color: #ffff00; } +.muControl { color: #c0a020; } .Delimiter { color: #800080; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } --> diff --git a/html/real-files.mu.html b/html/real-files.mu.html index 3ef5bc3c..c65a88a5 100644 --- a/html/real-files.mu.html +++ b/html/real-files.mu.html @@ -13,10 +13,10 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } +.muRecipe { color: #ff8700; } --> diff --git a/html/screen.mu.html b/html/screen.mu.html index 8ad9d732..5e8d25ca 100644 --- a/html/screen.mu.html +++ b/html/screen.mu.html @@ -13,10 +13,10 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } +.muRecipe { color: #ff8700; } --> diff --git a/html/server-socket.mu.html b/html/server-socket.mu.html index 5bb09e1f..18ce36d6 100644 --- a/html/server-socket.mu.html +++ b/html/server-socket.mu.html @@ -13,12 +13,12 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } .Delimiter { color: #800080; } +.muControl { color: #c0a020; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } --> diff --git a/html/static-dispatch.mu.html b/html/static-dispatch.mu.html index 466fbf50..2797735b 100644 --- a/html/static-dispatch.mu.html +++ b/html/static-dispatch.mu.html @@ -13,10 +13,10 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } +.muRecipe { color: #ff8700; } --> diff --git a/html/tangle.mu.html b/html/tangle.mu.html index fb077e0b..86d824dc 100644 --- a/html/tangle.mu.html +++ b/html/tangle.mu.html @@ -13,12 +13,12 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } .Delimiter { color: #800080; } +.muControl { color: #c0a020; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } --> diff --git a/html/x.mu.html b/html/x.mu.html index c424087b..2e5b580e 100644 --- a/html/x.mu.html +++ b/html/x.mu.html @@ -13,10 +13,10 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 12pt; font-size: 1em; } -.muRecipe { color: #ff8700; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } +.muRecipe { color: #ff8700; } --> diff --git a/mu.vim b/mu.vim index f74b1c72..9d0ce033 100644 --- a/mu.vim +++ b/mu.vim @@ -41,17 +41,15 @@ syntax region muScreen start=+ \.+ end=+\.$\|$+ highlight link muScreen muString " mu literals -syntax match muNumber %[^ ]\+:literal/\?[^ ,]*% -syntax match muNumber %\<[0-9-]\?[0-9]\+\>% -syntax match muNumber %\<[0-9-]\?[0-9]\+/[^ ,]*% -highlight link muNumber Constant -syntax match muLabel "^\s\+[^ 0-9a-zA-Z{}#\[\]][^ ]*\s*$" -syntax match muLabel %[^ ]\+:label/\?[^ ,]*% -syntax match muLabel "<[^ ]*>" -highlight link muLabel Constant -syntax match muLiteral %[^ ]\+:type/\?[^ ,]*% -syntax match muLiteral %[^ ]\+:offset/\?[^ ,]*% -syntax match muLiteral %[^ ]\+:variant/\?[^ ,]*% +syntax match muLiteral %[^ ]\+:literal/[^ ,]*\|[^ ]\+:literal\>% +syntax match muLiteral %\<[0-9-]\?[0-9]\+\>% +syntax match muLiteral %\<[0-9-]\?[0-9]\+/[^ ,]*% +syntax match muLiteral "^\s\+[^ 0-9a-zA-Z{}#\[\]][^ ]*\s*$" +syntax match muLiteral %[^ ]\+:label/[^ ,]*\|[^ ]\+:label\>% +syntax match muLiteral "<[^ ]*>" +syntax match muLiteral %[^ ]\+:type/[^ ,]*\|[^ ]\+:type\>% +syntax match muLiteral %[^ ]\+:offset/[^ ,]*\|[^ ]\+:offset\>% +syntax match muLiteral %[^ ]\+:variant/[^ ,]*\|[^ ]\+:variant\>% highlight link muLiteral Constant syntax keyword muKeyword default-space global-space new-default-space local-scope next-ingredient ingredient rewind-ingredients load-ingredients | highlight link muKeyword Constant @@ -60,10 +58,9 @@ syntax match muAssign " <- \|\" | highlight link muAssign SpecialChar syntax match muGlobal %[^ ]\+:global/\?[^ ,]*% | highlight link muGlobal SpecialChar syntax keyword muControl reply reply-if reply-unless return return-if return-unless jump jump-if jump-unless loop loop-if loop-unless break break-if break-unless current-continuation continue-from create-delimited-continuation reply-delimited-continuation | highlight muControl ctermfg=3 " common keywords -syntax keyword muRecipe recipe recipe! def def! before after | highlight muRecipe ctermfg=208 -syntax match muRecipe " -> " -syntax keyword muScenario scenario | highlight muScenario ctermfg=34 -syntax keyword muPendingScenario pending-scenario | highlight link muPendingScenario SpecialChar -syntax keyword muData container exclusive-container type | highlight muData ctermfg=226 +syntax match muRecipe "^recipe\>\|^recipe!\>\|^def\>\|^def!\>\|^before\>\|^after\>\| -> " | highlight muRecipe ctermfg=208 +syntax match muScenario "^scenario\>" | highlight muScenario ctermfg=34 +syntax match muPendingScenario "^pending-scenario\>" | highlight link muPendingScenario SpecialChar +syntax match muData "^type\>\|^container\>\|^exclusive-container\>" | highlight muData ctermfg=226 let &cpo = s:save_cpo diff --git a/vimrc.vim b/vimrc.vim index a3f31d1e..32c96159 100644 --- a/vimrc.vim +++ b/vimrc.vim @@ -24,7 +24,19 @@ function! HighlightTangledFile() syntax match muCommentedCode /#? .*$/ | highlight link muCommentedCode CommentedCode set comments+=n:# " Some other bare-bones mu highlighting. + syntax match muLiteral %[^ ]\+:literal/[^ ,]*\|[^ ]\+:literal\>% + syntax match muLiteral %[^ ]\+:label/[^ ,]*\|[^ ]\+:label\>% + syntax match muLiteral %[^ ]\+:type/[^ ,]*\|[^ ]\+:type\>% + syntax match muLiteral %[^ ]\+:offset/[^ ,]*\|[^ ]\+:offset\>% + syntax match muLiteral %[^ ]\+:variant/[^ ,]*\|[^ ]\+:variant\>% + highlight link muLiteral Constant syntax match muAssign " <- \|\" | highlight link muAssign SpecialChar + syntax match muGlobal %[^ ]\+:global/[^ ,]*\|[^ ]\+:global\>% | highlight link muGlobal SpecialChar + " common keywords + syntax match muRecipe "^recipe\>\|^recipe!\>\|^def\>\|^def!\>\|^before\>\|^after\>\| -> " | highlight muRecipe ctermfg=208 + syntax match muScenario "^scenario\>" | highlight muScenario ctermfg=34 + syntax match muPendingScenario "^pending-scenario\>" | highlight link muPendingScenario SpecialChar + syntax match muData "^type\>\|^container\>\|^exclusive-container\>" | highlight muData ctermfg=226 endfunction call HighlightTangledFile() autocmd BufRead,BufNewFile *.mu set ft=mu -- cgit 1.4.1-2-gfad0