From 10e8001655ed4e82eccdeb650f073d462a66ff78 Mon Sep 17 00:00:00 2001 From: André Aparício Date: Tue, 7 Aug 2012 04:16:45 +0100 Subject: Parser: Support line break after pipe --- bashast/bashast.g | 2 +- bashast/gunit/pipeline.gunit | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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))) -- cgit v1.2.3-65-gdbad