From d009e158803956c76adbf8f58a62884c3e7affb3 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 26 Jan 2016 23:47:23 -0800 Subject: 2605 --- html/082scenario_screen.cc.html | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) (limited to 'html/082scenario_screen.cc.html') diff --git a/html/082scenario_screen.cc.html b/html/082scenario_screen.cc.html index 85ef4880..71522122 100644 --- a/html/082scenario_screen.cc.html +++ b/html/082scenario_screen.cc.html @@ -44,7 +44,8 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } scenario screen-in-scenario [ assume-screen 5/width, 3/height run [ - screen:address:screen <- print screen:address:screen, 97 # 'a' + 1:character <- copy 97/a + screen:address:shared:screen <- print screen:address:shared:screen, 1:character/a ] screen-should-contain [ # 01234 @@ -58,8 +59,10 @@ scenario screen-in-scenario [ scenario screen-in-scenario-unicode-color [ assume-screen 5/width, 3/height run [ - screen:address:screen <- print screen:address:screen, 955/greek-small-lambda, 1/red - screen:address:screen <- print screen:address:screen, 97/a + 1:character <- copy 955/greek-small-lambda + screen:address:shared:screen <- print screen:address:shared:screen, 1:character/lambda, 1/red + 2:character <- copy 97/a + screen:address:shared:screen <- print screen:address:shared:screen, 2:character/a ] screen-should-contain [ # 01234 @@ -74,8 +77,10 @@ scenario screen-in-scenario-unicode-color [ scenario screen-in-scenario-color [ assume-screen 5/width, 3/height run [ - screen:address:screen <- print screen:address:screen, 955/greek-small-lambda, 1/red - screen:address:screen <- print screen:address:screen, 97/a, 7/white + 1:character <- copy 955/greek-small-lambda + screen:address:shared:screen <- print screen:address:shared:screen, 1:character/lambda, 1/red + 2:character <- copy 97/a + screen:address:shared:screen <- print screen:address:shared:screen, 2:character/a, 7/white ] # screen-should-contain shows everything screen-should-contain [ @@ -107,7 +112,8 @@ scenario screen-in-scenario-color [ scenario screen-in-scenario-error [ assume-screen 5/width, 3/height run [ - screen:address:screen <- print screen:address:screen, 97 # 'a' + 1:character <- copy 97/a + screen:address:shared:screen <- print screen:address:shared:screen, 1:character/a ] screen-should-contain [ # 01234 @@ -125,7 +131,8 @@ scenario screen-in-scenario-error [ scenario screen-in-scenario-color [ assume-screen 5/width, 3/height run [ - screen:address:screen <- print screen:address:screen, 97/a, 1/red + 1:character <- copy 97/a + screen:address:shared:screen <- print screen:address:shared:screen, 1:character/a, 1/red ] screen-should-contain-in-color 2/green, [ # 01234 @@ -174,11 +181,11 @@ Name[r]["screen"] = SCREEN:(before "End Rewrite Instruction(curr, recipe result)") // rewrite `assume-screen width, height` to -// `screen:address:screen <- new-fake-screen width, height` +// `screen:address:shared:screen <- new-fake-screen width, height` if (curr.name == "assume-screen") { curr.name = "new-fake-screen"; assert(curr.products.empty()); - curr.products.push_back(reagent("screen:address:screen")); + curr.products.push_back(reagent("screen:address:shared:screen")); curr.products.at(0).set_value(SCREEN); } @@ -235,18 +242,18 @@ struct raw_string_stream { :(code) void check_screen(const string& expected_contents, const int color) { assert(!current_call().default_space); // not supported - long long int screen_location = get_or_insert(Memory, SCREEN); + long long int screen_location = get_or_insert(Memory, SCREEN)+/*skip refcount*/1; int data_offset = find_element_name(get(Type_ordinal, "screen"), "data", ""); assert(data_offset >= 0); - long long int screen_data_location = screen_location+data_offset; // type: address:array:character - long long int screen_data_start = get_or_insert(Memory, screen_data_location); // type: array:character + long long int screen_data_location = screen_location+data_offset; // type: address:shared:array:character + long long int screen_data_start = get_or_insert(Memory, screen_data_location) + /*skip refcount*/1; // type: array:character int width_offset = find_element_name(get(Type_ordinal, "screen"), "num-columns", ""); long long int screen_width = get_or_insert(Memory, screen_location+width_offset); int height_offset = find_element_name(get(Type_ordinal, "screen"), "num-rows", ""); long long int screen_height = get_or_insert(Memory, screen_location+height_offset); raw_string_stream cursor(expected_contents); // todo: too-long expected_contents should fail - long long int addr = screen_data_start+1; // skip length + long long int addr = screen_data_start+/*skip length*/1; for (long long int row = 0; row < screen_height; ++row) { cursor.skip_whitespace_and_comments(); if (cursor.at_end()) break; @@ -370,15 +377,15 @@ case _DUMP_SCREEN: { :(code) void dump_screen() { assert(!current_call().default_space); // not supported - long long int screen_location = get_or_insert(Memory, SCREEN); + long long int screen_location = get_or_insert(Memory, SCREEN) + /*skip refcount*/1; int width_offset = find_element_name(get(Type_ordinal, "screen"), "num-columns", ""); long long int screen_width = get_or_insert(Memory, screen_location+width_offset); int height_offset = find_element_name(get(Type_ordinal, "screen"), "num-rows", ""); long long int screen_height = get_or_insert(Memory, screen_location+height_offset); int data_offset = find_element_name(get(Type_ordinal, "screen"), "data", ""); assert(data_offset >= 0); - long long int screen_data_location = screen_location+data_offset; // type: address:array:character - long long int screen_data_start = get_or_insert(Memory, screen_data_location); // type: array:character + long long int screen_data_location = screen_location+data_offset; // type: address:shared:array:character + long long int screen_data_start = get_or_insert(Memory, screen_data_location) + /*skip refcount*/1; // type: array:character assert(get_or_insert(Memory, screen_data_start) == screen_width*screen_height); long long int curr = screen_data_start+1; // skip length for (long long int row = 0; row < screen_height; ++row) { -- cgit 1.4.1-2-gfad0