about summary refs log tree commit diff stats
path: root/cpp/012run
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-03-14 22:17:37 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-03-14 22:17:37 -0700
commite7f76736d22acafa8b7b84df24fde0575d97686c (patch)
tree3f60913dddb775edd0092d7aabd241a6c12daef5 /cpp/012run
parent06db0dd4beb09b5cdbe257a33a2d0fb1da7b394e (diff)
downloadmu-e7f76736d22acafa8b7b84df24fde0575d97686c.tar.gz
921
Diffstat (limited to 'cpp/012run')
-rw-r--r--cpp/012run15
1 files changed, 15 insertions, 0 deletions
diff --git a/cpp/012run b/cpp/012run
index 1e38c15a..bd914faa 100644
--- a/cpp/012run
+++ b/cpp/012run
@@ -84,6 +84,21 @@ void run(routine rr) {
 #undef instructions
 }
 
+:(before "End Main")
+if (argc > 1) {
+  setup();
+  for (int i = 1; i < argc; ++i) {
+    ifstream fin(argv[i]);
+    while (!fin.eof()) add_recipe(fin);
+    fin.close();
+  }
+
+  recipe_number r = Recipe_number[string("main")];
+  if (r) run(r);
+  dump_memory();
+}
+
+:(code)
 vector<int> read_memory(reagent x) {
 //?   cout << "read_memory: " << x.to_string() << '\n'; //? 1
   vector<int> result;