From 364b8f8875dfad94d96aae180b58f0003720e15c Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Wed, 13 Mar 2019 00:46:00 -0700 Subject: [PATCH] 5002 Bugfix in top-level prototype: commandline args were broken since commit 4266 last June. We still don't have automated tests for commandline args, but we'll add an example program that'll increase the odds of detecting issues there. --- 073scheduler.cc | 1 + args.mu | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 args.mu diff --git a/073scheduler.cc b/073scheduler.cc index 41240e64..5f97220b 100644 --- a/073scheduler.cc +++ b/073scheduler.cc @@ -133,6 +133,7 @@ void run_main(int argc, char* argv[]) { Current_routine = main_routine; for (int i = 1; i < argc; ++i) { vector arg; + arg.push_back(/*alloc id*/0); arg.push_back(new_mu_text(argv[i])); assert(get(Memory, arg.back()) == 0); current_call().ingredient_atoms.push_back(arg); diff --git a/args.mu b/args.mu new file mode 100644 index 00000000..3726f097 --- /dev/null +++ b/args.mu @@ -0,0 +1,8 @@ +# To provide commandline args to a Mu program, use '--'. In this case: +# $ ./mu args.mu -- abc +# abc +def main text:text [ + local-scope + load-inputs + $print text 10/newline +]