From aae68c20dd672aeb2bf4a85ac24ce363b3251255 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Tue, 23 Jun 2015 12:17:30 -0400 Subject: [PATCH] mpw-make -- support for quoted strings. --- bin/mpw-make-parse.rl | 12 ++++++++++++ bin/mpw-make.cpp | 5 ++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/bin/mpw-make-parse.rl b/bin/mpw-make-parse.rl index d8f4215..3bf720c 100644 --- a/bin/mpw-make-parse.rl +++ b/bin/mpw-make-parse.rl @@ -71,6 +71,18 @@ LinkIIGS TheHeader.aii.obj IRModule.p.obj ? token.append(ts + 1, te - 1); }; + ['] [^']* ['] => { + // quoted string -- remove quotes. + token.append(ts + 1, te - 1); + }; + + ["] [^"]* ["] => { + // quoted string -- remove quotes. + token.append(ts + 1, te - 1); + }; + + + any => { token.push_back(*ts); }; diff --git a/bin/mpw-make.cpp b/bin/mpw-make.cpp index a82007a..d2d7ec7 100644 --- a/bin/mpw-make.cpp +++ b/bin/mpw-make.cpp @@ -88,7 +88,10 @@ int launch_command(std::vector &argv) { argv.push_back(nullptr); print_command(argv); - if (dry_run) return 0; + if (dry_run) { + printf("\n"); + return 0; + } pid = fork(); if (pid < 0) {