From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QoyQG-0006mb-28 for garchives@archives.gentoo.org; Thu, 04 Aug 2011 13:57:20 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 10A3A21C1EF; Thu, 4 Aug 2011 13:53:43 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id D886821C1EE for ; Thu, 4 Aug 2011 13:53:43 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 966CA1B4032 for ; Thu, 4 Aug 2011 13:53:43 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 0134080042 for ; Thu, 4 Aug 2011 13:53:43 +0000 (UTC) From: "Petteri Räty" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Petteri Räty" Message-ID: Subject: [gentoo-commits] proj/libbash:master commit in: bashast/, bashast/gunit/ X-VCS-Repository: proj/libbash X-VCS-Files: bashast/bashast.g bashast/gunit/redir.gunit X-VCS-Directories: bashast/ bashast/gunit/ X-VCS-Committer: betelgeuse X-VCS-Committer-Name: Petteri Räty X-VCS-Revision: f3e50b21917905fa908000a9bcb8f2fdff451f63 Date: Thu, 4 Aug 2011 13:53:43 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: f6e913db21dfce9f6aa52f2ce089ebd0 commit: f3e50b21917905fa908000a9bcb8f2fdff451f63 Author: Mu Qiao gentoo org> AuthorDate: Fri Jul 22 13:16:45 2011 +0000 Commit: Petteri R=C3=A4ty gentoo org> CommitDate: Tue Aug 2 07:52:18 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/libbash.git;a= =3Dcommit;h=3Df3e50b21 Parser: improve here document and here string Here document and here string can be combined with bash redirection. Now this is supported. --- bashast/bashast.g | 6 +++--- bashast/gunit/redir.gunit | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/bashast/bashast.g b/bashast/bashast.g index a6b2e59..39e6d54 100644 --- a/bashast/bashast.g +++ b/bashast/bashast.g @@ -255,7 +255,8 @@ redirection : redirection_atom+; redirection_atom : redirection_operator BLANK? redirection_destination -> ^(REDIR redire= ction_operator redirection_destination) - | BLANK!? process_substitution; + | BLANK!? process_substitution + | here_string; =20 process_substitution : (dir=3DLESS_THAN|dir=3DGREATER_THAN)LPAREN BLANK* command_list BLANK*= RPAREN @@ -339,9 +340,8 @@ redirection_operator command : command_atom ( - redirection -> ^(COMMAND command_atom redirection) + redirection here_document? -> ^(COMMAND command_atom redirection here= _document?) | here_document -> ^(COMMAND command_atom here_document) - | here_string -> ^(COMMAND command_atom here_string) | -> ^(COMMAND command_atom) ); =20 diff --git a/bashast/gunit/redir.gunit b/bashast/gunit/redir.gunit index 882290f..d6aa599 100644 --- a/bashast/gunit/redir.gunit +++ b/bashast/gunit/redir.gunit @@ -28,6 +28,7 @@ redirection: "< this.is.1input" -> (REDIR < (STRING this . is . 1 input)) " 3< \"input from file\"" -> (REDIR 3 < (STRING (DOUBLE_QUOTED_STRING in= put from file))) " 2<&0" -> (REDIR 2 <& (FILE_DESCRIPTOR 0)) +"<<<\"#include \" >& /dev/null" -> (<<< (STRING (DOUBLE_QUOTE= D_STRING # include < pthread . h >))) (REDIR >& (STRING / dev / null)) =20 here_string: "<<< herestring" -> (<<< (STRING herestring)) @@ -47,3 +48,7 @@ _EOF_.abc " -> (LIST (COMMAND (STRING cat) (<< (STRING blah=20 blah=20 ) (REDIR > (STRING / dev / null))))) +"cat > /dev/null <<-END_LDSCRIPT +GNU... +END_LDSCRIPT" -> (LIST (COMMAND (STRING cat) (REDIR > (STRING / dev / nu= ll)) (<<- (STRING GNU .. .=20 +))))