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.
This commit is contained in:
Kartik Agaram 2019-03-13 00:46:00 -07:00
parent 4a943d4ed3
commit 364b8f8875
2 changed files with 9 additions and 0 deletions

View File

@ -133,6 +133,7 @@ void run_main(int argc, char* argv[]) {
Current_routine = main_routine;
for (int i = 1; i < argc; ++i) {
vector<double> 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);

8
args.mu Normal file
View File

@ -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
]