diff options
author | 2012-08-07 04:16:45 +0100 | |
---|---|---|
committer | 2012-08-19 17:32:01 +0300 | |
commit | 10e8001655ed4e82eccdeb650f073d462a66ff78 (patch) | |
tree | 2b2f68bcfa8d51a484800eb33e3af761eed8b94f | |
parent | Parser: Support appending strings with special characters (diff) | |
download | libbash-10e8001655ed4e82eccdeb650f073d462a66ff78.tar.gz libbash-10e8001655ed4e82eccdeb650f073d462a66ff78.tar.bz2 libbash-10e8001655ed4e82eccdeb650f073d462a66ff78.zip |
Parser: Support line break after pipe
-rw-r--r-- | bashast/bashast.g | 2 | ||||
-rw-r--r-- | bashast/gunit/pipeline.gunit | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/bashast/bashast.g b/bashast/bashast.g index 9fd3fdb..8943209 100644 --- a/bashast/bashast.g +++ b/bashast/bashast.g @@ -272,7 +272,7 @@ command_separator | AMP^ | EOL!; pipeline - : time? ((BANG) => (BANG BLANK!))? command^ (BLANK!? PIPE^ BLANK!? command)*; + : time? ((BANG) => (BANG BLANK!))? command^ (BLANK!? PIPE^ wspace!? command)*; time : TIME^ BLANK! ((time_posix) => time_posix)?; diff --git a/bashast/gunit/pipeline.gunit b/bashast/gunit/pipeline.gunit index b97ec3b..4a3a4f4 100644 --- a/bashast/gunit/pipeline.gunit +++ b/bashast/gunit/pipeline.gunit @@ -30,3 +30,4 @@ pipeline: echo \"three\" fi" -> (COMMAND (IF_STATEMENT (if (LIST (COMMAND (STRING cat) time)) (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING three))))))) "i=1 j=2" -> (COMMAND (VARIABLE_DEFINITIONS (= i (STRING 1)) (= j (STRING 2)))) +"cat foo |\ncat" -> (| (COMMAND (STRING cat) (STRING foo)) (COMMAND (STRING cat))) |