diff options
Diffstat (limited to 'main/augeas/0007-Shellvars-allow-quotes-in-loop-conditions.patch')
-rw-r--r-- | main/augeas/0007-Shellvars-allow-quotes-in-loop-conditions.patch | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/main/augeas/0007-Shellvars-allow-quotes-in-loop-conditions.patch b/main/augeas/0007-Shellvars-allow-quotes-in-loop-conditions.patch new file mode 100644 index 0000000000..e85f60fa24 --- /dev/null +++ b/main/augeas/0007-Shellvars-allow-quotes-in-loop-conditions.patch @@ -0,0 +1,54 @@ +From 25007fa071f37998016b4f197bf6509e43174517 Mon Sep 17 00:00:00 2001 +From: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> +Date: Mon, 8 Dec 2014 14:28:16 +0200 +Subject: [PATCH 07/15] Shellvars: allow quotes in loop conditions + +--- + lenses/shellvars.aug | 8 +------- + lenses/tests/test_shellvars.aug | 4 ++++ + 2 files changed, 5 insertions(+), 7 deletions(-) + +diff --git a/lenses/shellvars.aug b/lenses/shellvars.aug +index 227e2a3..4dca315 100644 +--- a/lenses/shellvars.aug ++++ b/lenses/shellvars.aug +@@ -48,12 +48,6 @@ module Shellvars = + let anyquot = (char|dquot|squot|dollar_assign|dollar_arithm)+ | bquot | dbquot + let sto_to_semicol = store (anyquot . (Rx.space . anyquot)*) + +- let sto_to_semicol_quot = +- let no_semicol_re = /[^"'#;\n]/ +- in let no_semicol_spc_re = /[^"'#; \t\n]/ +- in let multi_chars = no_semicol_spc_re . (no_semicol_re|anyquot)+ . no_semicol_spc_re +- in store (no_semicol_spc_re | multi_chars) +- + (* Array values of the form '(val1 val2 val3)'. We do not handle empty *) + (* arrays here because of typechecking headaches. Instead, they are *) + (* treated as a simple value *) +@@ -118,7 +112,7 @@ module Shellvars = + let generic_cond_start (start_kw:string) (lbl:string) + (then_kw:string) (contents:lens) = + keyword_label start_kw lbl . Sep.space +- . sto_to_semicol_quot . semicol_eol ++ . sto_to_semicol . semicol_eol + . keyword then_kw . eol + . contents + +diff --git a/lenses/tests/test_shellvars.aug b/lenses/tests/test_shellvars.aug +index bf92735..6b2210e 100644 +--- a/lenses/tests/test_shellvars.aug ++++ b/lenses/tests/test_shellvars.aug +@@ -558,6 +558,10 @@ fi\n" = + test Shellvars.lns get "for x in foo \\\nbar\\\nbaz; do y=$x; done\n" = + { "@for" = "x in foo \\\nbar\\\nbaz" { "y" = "$x" } } + ++ (* Allow quotes in loop conditions *) ++ test Shellvars.lns get "for x in \"$@\"; do y=$x; done\n" = ++ { "@for" = "x in \"$@\"" { "y" = "$x" } } ++ + (* Local Variables: *) + (* mode: caml *) + (* End: *) +-- +2.1.0 + |