From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id ABFE513800E for ; Tue, 7 Aug 2012 02:39:07 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A179EE066E; Tue, 7 Aug 2012 02:38:50 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 76A2FE066E for ; Tue, 7 Aug 2012 02:38:50 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D6BE11B4020 for ; Tue, 7 Aug 2012 02:38:49 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id C31CFE5441 for ; Tue, 7 Aug 2012 02:38:46 +0000 (UTC) From: "Mu Qiao" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mu Qiao" Message-ID: <1343952221.14db07b33b4a2df8ede5b8f7b7cda89004009d8d.qiaomuf@gentoo> Subject: [gentoo-commits] proj/libbash:master commit in: scripts/, bashast/ X-VCS-Repository: proj/libbash X-VCS-Files: bashast/bashast.g bashast/libbashWalker.g scripts/command_execution.bash X-VCS-Directories: scripts/ bashast/ X-VCS-Committer: qiaomuf X-VCS-Committer-Name: Mu Qiao X-VCS-Revision: 14db07b33b4a2df8ede5b8f7b7cda89004009d8d X-VCS-Branch: master Date: Tue, 7 Aug 2012 02:38:46 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: a2c91deb-b177-43a3-bfa7-31a64ec5e444 X-Archives-Hash: 4c4df39a9d8ad68408428272f006f913 commit: 14db07b33b4a2df8ede5b8f7b7cda89004009d8d Author: André Aparício gmail com> AuthorDate: Fri Jul 20 02:25:32 2012 +0000 Commit: Mu Qiao gentoo org> CommitDate: Fri Aug 3 00:03:41 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=14db07b3 Parser&Walker: Escape ' --- bashast/bashast.g | 3 ++- bashast/libbashWalker.g | 1 + scripts/command_execution.bash | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bashast/bashast.g b/bashast/bashast.g index 61c7e57..4438b8c 100644 --- a/bashast/bashast.g +++ b/bashast/bashast.g @@ -786,7 +786,7 @@ ns_string_part |OTHER|EQUALS|PCT|PCTPCT|PLUS|MINUS|DOT|DOTDOT|COLON |TILDE|LSQUARE|RSQUARE|CARET|POUND|COMMA|EXPORT|LOCAL|DECLARE|AT // Escaped characters - |ESC_RPAREN|ESC_LPAREN|ESC_RSQUARE|ESC_LSQUARE|ESC_DOLLAR|ESC_GT|ESC_LT|ESC_TICK|ESC_DQUOTE + |ESC_RPAREN|ESC_LPAREN|ESC_RSQUARE|ESC_LSQUARE|ESC_DOLLAR|ESC_GT|ESC_LT|ESC_TICK|ESC_DQUOTE|ESC_SQUOTE // The following is for filename expansion |TIMES|QMARK; @@ -1129,6 +1129,7 @@ SEMIC : ';'; DOUBLE_SEMIC : ';;'; PIPE : '|'; ESC_DQUOTE : '\\"'; +ESC_SQUOTE : { !double_quoted }? => '\\\''; DQUOTE : '"' { if(LA(-1) != '\\') double_quoted = !double_quoted; }; SQUOTE : { double_quoted }? => '\''; SINGLE_QUOTED_STRING_TOKEN : { !double_quoted }? => '\'' .* '\''; diff --git a/bashast/libbashWalker.g b/bashast/libbashWalker.g index 9c85f9d..34a7660 100644 --- a/bashast/libbashWalker.g +++ b/bashast/libbashWalker.g @@ -466,6 +466,7 @@ options {backtrack = true;} |ESC_LSQUARE { $libbash_value = "["; } |ESC_DOLLAR { $libbash_value = "$"; } |ESC_DQUOTE { $libbash_value = "\""; } + |ESC_SQUOTE { $libbash_value = "'"; } |ESC_GT { $libbash_value = ">"; } |ESC_LT { $libbash_value = "<"; } |ESC_TICK { $libbash_value = "`"; } diff --git a/scripts/command_execution.bash b/scripts/command_execution.bash index 1cc837b..c526d75 100644 --- a/scripts/command_execution.bash +++ b/scripts/command_execution.bash @@ -96,7 +96,7 @@ eval abc+=\( \"\$@\" \) declare MOZILLA_FIVE_HOME="/usr/share/${PN}" declare foo=23 empty bar=42 echo $MOZILLA_FIVE_HOME $foo $lol $bar -echo \(\)\[\]\$\"\> +echo \(\)\[\]\$\"\>\' FILE=scripts/input_output_test echo foo > $FILE