about summary refs log tree commit diff stats
path: root/subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-06-30 23:05:40 -0700
committerKartik Agaram <vc@akkartik.com>2018-06-30 23:05:40 -0700
commit7b686a02ca508b9a414b96edfcff93a667354ac6 (patch)
treebbc64a1355fda6a7136da01d8b2763340589718b /subx
parentd1262cd690ac2fb4345b736ec6f406ed5470c3d3 (diff)
downloadmu-7b686a02ca508b9a414b96edfcff93a667354ac6.tar.gz
4300 - get set up to unit test translator
Diffstat (limited to 'subx')
-rw-r--r--subx/010core.cc3
-rw-r--r--subx/021translate.cc3
2 files changed, 5 insertions, 1 deletions
diff --git a/subx/010core.cc b/subx/010core.cc
index b21511d7..f391a369 100644
--- a/subx/010core.cc
+++ b/subx/010core.cc
@@ -98,7 +98,8 @@ End_of_program = 0;
 :(code)
 // helper for tests: load a program into memory from a textual representation
 // of its bytes, and run it
-void run(const string& text_bytes) {
+void run(string text_bytes) {
+  // Begin run() For Scenarios
   load_program(text_bytes, 1);  // tests always assume a starting address of 1
   EIP = 1;  // preserve null pointer
   while (EIP < End_of_program)
diff --git a/subx/021translate.cc b/subx/021translate.cc
index f262bcd6..e43ea894 100644
--- a/subx/021translate.cc
+++ b/subx/021translate.cc
@@ -132,5 +132,8 @@ void slurp(const char* filename, string& out) {
   fout.str().swap(out);
 }
 
+:(after "Begin run() For Scenarios")
+perform_all_transforms(text_bytes);
+
 :(before "End Includes")
 using std::ios;