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 1QBPgq-0002Pu-21 for garchives@archives.gentoo.org; Sun, 17 Apr 2011 10:58:52 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9241F1C0B5; Sun, 17 Apr 2011 10:58:33 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 629691C0B7 for ; Sun, 17 Apr 2011 10:58:33 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 17C8A1B4093 for ; Sun, 17 Apr 2011 10:58:33 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 7583080072 for ; Sun, 17 Apr 2011 10:58:32 +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/fname.gunit X-VCS-Directories: bashast/ bashast/gunit/ X-VCS-Committer: betelgeuse X-VCS-Committer-Name: Petteri Räty X-VCS-Revision: cd818e41fb54894c6716edf2a14c5ee907a02528 Date: Sun, 17 Apr 2011 10:58:32 +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: 86345f1c623429ad8e346ee9c66997b1 commit: cd818e41fb54894c6716edf2a14c5ee907a02528 Author: Petteri R=C3=A4ty petteriraty eu> AuthorDate: Sat Apr 16 16:51:48 2011 +0000 Commit: Petteri R=C3=A4ty gentoo org> CommitDate: Sun Apr 17 10:57:04 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/libbash.git;a= =3Dcommit;h=3Dcd818e41 Parser: escaped double quotes in dqstr The parser now handles escaped double quotes inside double quoted strings. --- bashast/bashast.g | 9 +++++---- bashast/gunit/fname.gunit | 3 +++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bashast/bashast.g b/bashast/bashast.g index 7b900cc..d82e7cf 100644 --- a/bashast/bashast.g +++ b/bashast/bashast.g @@ -409,10 +409,11 @@ nqstr_part //double quoted string rule, allows expansions dqstr : DQUOTE dqstr_part* DQUOTE -> ^(DOUBLE_QUOTED_STRING dqstr_part*)= ; dqstr_part - : var_ref - | command_sub - | arithmetic_expansion - | ~(DOLLAR|TICK|DQUOTE); + : var_ref + | command_sub + | arithmetic_expansion + | ESC DQUOTE + | ~(DOLLAR|TICK|DQUOTE); //single quoted string rule, no expansions sqstr_part : ~SQUOTE*; diff --git a/bashast/gunit/fname.gunit b/bashast/gunit/fname.gunit index a5b1f7f..f048755 100644 --- a/bashast/gunit/fname.gunit +++ b/bashast/gunit/fname.gunit @@ -67,3 +67,6 @@ fname: "ab[12[:alpha:]]" -> (STRING ab (MATCH_PATTERN 12 (CHARACTER_CLASS alpha= ))) "\"'foo'\"" -> (STRING (DOUBLE_QUOTED_STRING ' foo ')) "--preserve=3Dtimestamps,mode" -> (STRING - -p reserve =3D timestamps , = mode) + +dqstr: +"\"\\\"\"" -> (DOUBLE_QUOTED_STRING \ ")