about summary refs log tree commit diff stats
path: root/cpp/.traces/clear-line-erases-printed-characters
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-05-02 15:52:22 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-05-02 22:56:13 -0700
commit22b3069272c1a177e814a7c4e769e20858e2b368 (patch)
tree761199b26823fe5ba11af66108e95ece1bc4f02c /cpp/.traces/clear-line-erases-printed-characters
parenta316f1e4168a98ba8c1bbe7b091f8a7e7b3f03e6 (diff)
downloadmu-22b3069272c1a177e814a7c4e769e20858e2b368.tar.gz
1242 - simpler implementation for 'scenario'
Also now has the side effect that scenarios can have any number of 'run'
or check or any future blocks, in any order.
Diffstat (limited to 'cpp/.traces/clear-line-erases-printed-characters')
-rw-r--r--cpp/.traces/clear-line-erases-printed-characters112
1 files changed, 103 insertions, 9 deletions
diff --git a/cpp/.traces/clear-line-erases-printed-characters b/cpp/.traces/clear-line-erases-printed-characters
index 4aacb7e0..9aae7db2 100644
--- a/cpp/.traces/clear-line-erases-printed-characters
+++ b/cpp/.traces/clear-line-erases-printed-characters
@@ -1,3 +1,74 @@
+parse/0: instruction: run
+parse/0:   ingredient: {name: "
+#?     $start-tracing #? 3
+    1:address:screen <- init-fake-screen 3:literal/width, 2:literal/height
+    # print a character
+    1:address:screen <- print-character 1:address:screen, 97:literal  # 'a'
+    # move cursor to start of line
+    1:address:screen <- move-cursor 1:address:screen, 0:literal/row, 0:literal/column
+    # clear line
+    1:address:screen <- clear-line 1:address:screen
+    2:address:array:character <- get 1:address:screen/deref, data:offset
+    3:array:character <- copy 2:address:array:character/deref
+  ", value: 0, type: 0, properties: ["
+#?     $start-tracing #? 3
+    1:address:screen <- init-fake-screen 3:literal/width, 2:literal/height
+    # print a character
+    1:address:screen <- print-character 1:address:screen, 97:literal  # 'a'
+    # move cursor to start of line
+    1:address:screen <- move-cursor 1:address:screen, 0:literal/row, 0:literal/column
+    # clear line
+    1:address:screen <- clear-line 1:address:screen
+    2:address:array:character <- get 1:address:screen/deref, data:offset
+    3:array:character <- copy 2:address:array:character/deref
+  ": "literal-string"]}
+parse/0: instruction: memory-should-contain
+parse/0:   ingredient: {name: "
+    3 <- 6  # width*height
+    4 <- 0
+    5 <- 0
+    6 <- 0
+    7 <- 0
+    8 <- 0
+    9 <- 0
+  ", value: 0, type: 0, properties: ["
+    3 <- 6  # width*height
+    4 <- 0
+    5 <- 0
+    6 <- 0
+    7 <- 0
+    8 <- 0
+    9 <- 0
+  ": "literal-string"]}
+after-brace/0: recipe clear-line-erases-printed-characters
+after-brace/0: run ...
+after-brace/0: memory-should-contain ...
+new/0: routine allocated memory from 1000 to 101000
+schedule/0: clear-line-erases-printed-characters
+run/0: instruction clear-line-erases-printed-characters/0
+run/0: run {name: "
+#?     $start-tracing #? 3
+    1:address:screen <- init-fake-screen 3:literal/width, 2:literal/height
+    # print a character
+    1:address:screen <- print-character 1:address:screen, 97:literal  # 'a'
+    # move cursor to start of line
+    1:address:screen <- move-cursor 1:address:screen, 0:literal/row, 0:literal/column
+    # clear line
+    1:address:screen <- clear-line 1:address:screen
+    2:address:array:character <- get 1:address:screen/deref, data:offset
+    3:array:character <- copy 2:address:array:character/deref
+  ", value: 0, type: 0, properties: ["
+#?     $start-tracing #? 3
+    1:address:screen <- init-fake-screen 3:literal/width, 2:literal/height
+    # print a character
+    1:address:screen <- print-character 1:address:screen, 97:literal  # 'a'
+    # move cursor to start of line
+    1:address:screen <- move-cursor 1:address:screen, 0:literal/row, 0:literal/column
+    # clear line
+    1:address:screen <- clear-line 1:address:screen
+    2:address:array:character <- get 1:address:screen/deref, data:offset
+    3:array:character <- copy 2:address:array:character/deref
+  ": "literal-string"]}
 parse/0: instruction: init-fake-screen
 parse/0:   ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal", "width": ]}
 parse/0:   ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal", "height": ]}
@@ -22,16 +93,14 @@ parse/0: instruction: copy
 parse/0:   ingredient: {name: "2", value: 0, type: 2-5-4, properties: ["2": "address":"array":"character", "deref": ]}
 parse/0:   product: {name: "3", value: 0, type: 5-4, properties: ["3": "array":"character"]}
 name/0: element data of type screen is at offset 4
-after-brace/0: recipe test-clear-line-erases-printed-characters
+after-brace/0: recipe tmp0
 after-brace/0: init-fake-screen ...
 after-brace/0: print-character ...
 after-brace/0: move-cursor ...
 after-brace/0: clear-line ...
 after-brace/0: get ...
 after-brace/0: copy ...
-new/0: routine allocated memory from 1000 to 101000
-schedule/0: test-clear-line-erases-printed-characters
-run/0: instruction test-clear-line-erases-printed-characters/0
+run/0: instruction tmp0/0
 run/0: {name: "1", value: 1, type: 2-11, properties: ["1": "address":"screen"]} <- init-fake-screen {name: "3", value: 3, type: 0, properties: ["3": "literal", "width": ]}, {name: "2", value: 2, type: 0, properties: ["2": "literal", "height": ]}
 run/0: instruction init-fake-screen/0
 run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal", "capacity": ]}
@@ -403,7 +472,7 @@ run/0: reply {name: "result", value: 1, type: 2-11, properties: ["result": "addr
 mem/0: location 1002 is 1031
 run/0: result 0 is 1031
 mem/0: storing 1031 in location 1
-run/0: instruction test-clear-line-erases-printed-characters/1
+run/0: instruction tmp0/1
 run/0: {name: "1", value: 1, type: 2-11, properties: ["1": "address":"screen"]} <- print-character {name: "1", value: 1, type: 2-11, properties: ["1": "address":"screen"]}, {name: "97", value: 97, type: 0, properties: ["97": "literal"]}
 mem/0: location 1 is 1031
 run/0: instruction print-character/0
@@ -521,7 +590,7 @@ run/0: reply {name: "x", value: 1, type: 2-11, properties: ["x": "address":"scre
 mem/0: location 1076 is 1031
 run/0: result 0 is 1031
 mem/0: storing 1031 in location 1
-run/0: instruction test-clear-line-erases-printed-characters/2
+run/0: instruction tmp0/2
 run/0: {name: "1", value: 1, type: 2-11, properties: ["1": "address":"screen"]} <- move-cursor {name: "1", value: 1, type: 2-11, properties: ["1": "address":"screen"]}, {name: "0", value: 0, type: 0, properties: ["0": "literal", "row": ]}, {name: "0", value: 0, type: 0, properties: ["0": "literal", "column": ]}
 mem/0: location 1 is 1031
 run/0: instruction move-cursor/0
@@ -578,7 +647,7 @@ run/0: reply {name: "x", value: 1, type: 2-11, properties: ["x": "address":"scre
 mem/0: location 1107 is 1031
 run/0: result 0 is 1031
 mem/0: storing 1031 in location 1
-run/0: instruction test-clear-line-erases-printed-characters/3
+run/0: instruction tmp0/3
 run/0: {name: "1", value: 1, type: 2-11, properties: ["1": "address":"screen"]} <- clear-line {name: "1", value: 1, type: 2-11, properties: ["1": "address":"screen"]}
 mem/0: location 1 is 1031
 run/0: instruction clear-line/0
@@ -1046,7 +1115,7 @@ run/0: reply {name: "x", value: 1, type: 2-11, properties: ["x": "address":"scre
 mem/0: location 1138 is 1031
 run/0: result 0 is 1031
 mem/0: storing 1031 in location 1
-run/0: instruction test-clear-line-erases-printed-characters/4
+run/0: instruction tmp0/4
 run/0: {name: "2", value: 2, type: 2-5-4, properties: ["2": "address":"array":"character"]} <- get {name: "1", value: 1, type: 2-11, properties: ["1": "address":"screen", "deref": ]}, {name: "data", value: 4, type: 0, properties: ["data": "offset"]}
 run/0: ingredient 0 is 1
 mem/0: location 1 is 1031
@@ -1056,7 +1125,7 @@ run/0: its type is 2
 mem/0: location 1035 is 1036
 run/0: product 0 is 1036
 mem/0: storing 1036 in location 2
-run/0: instruction test-clear-line-erases-printed-characters/5
+run/0: instruction tmp0/5
 run/0: {name: "3", value: 3, type: 5-4, properties: ["3": "array":"character"]} <- copy {name: "2", value: 2, type: 2-5-4, properties: ["2": "address":"array":"character", "deref": ]}
 run/0: ingredient 0 is 2
 mem/0: location 2 is 1036
@@ -1074,3 +1143,28 @@ mem/0: storing 0 in location 6
 mem/0: storing 0 in location 7
 mem/0: storing 0 in location 8
 mem/0: storing 0 in location 9
+run/0: instruction clear-line-erases-printed-characters/1
+run/0: memory-should-contain {name: "
+    3 <- 6  # width*height
+    4 <- 0
+    5 <- 0
+    6 <- 0
+    7 <- 0
+    8 <- 0
+    9 <- 0
+  ", value: 0, type: 0, properties: ["
+    3 <- 6  # width*height
+    4 <- 0
+    5 <- 0
+    6 <- 0
+    7 <- 0
+    8 <- 0
+    9 <- 0
+  ": "literal-string"]}
+run/0: checking location 3
+run/0: checking location 4
+run/0: checking location 5
+run/0: checking location 6
+run/0: checking location 7
+run/0: checking location 8
+run/0: checking location 9