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 1QBPiL-0002hh-CE for garchives@archives.gentoo.org; Sun, 17 Apr 2011 11:00:25 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7E2301C0B1; Sun, 17 Apr 2011 10:58:32 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 47F6D1C0AD for ; Sun, 17 Apr 2011 10:58:32 +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 C36961B4026 for ; Sun, 17 Apr 2011 10:58:31 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 2BD0E8006E for ; Sun, 17 Apr 2011 10:58:31 +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: <196605139384079f1629cf02d7a91860878bbdf7.betelgeuse@gentoo> 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: 196605139384079f1629cf02d7a91860878bbdf7 Date: Sun, 17 Apr 2011 10:58:31 +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: dd56de1105c9a87be78858bfc92957b4 commit: 196605139384079f1629cf02d7a91860878bbdf7 Author: Petteri R=C3=A4ty petteriraty eu> AuthorDate: Sat Apr 16 12:30:56 2011 +0000 Commit: Petteri R=C3=A4ty gentoo org> CommitDate: Sun Apr 17 10:57:00 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/libbash.git;a= =3Dcommit;h=3D19660513 Parser: support commas in command arguments Comma wasn't listed in the big bunch of tokens allowed in argument strings. Now it's listed there and disallowed for use inside brace expansion because it limits alternatives there. --- bashast/bashast.g | 8 ++++++-- bashast/gunit/fname.gunit | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/bashast/bashast.g b/bashast/bashast.g index 9619d64..468a460 100644 --- a/bashast/bashast.g +++ b/bashast/bashast.g @@ -160,7 +160,7 @@ range : DIGIT DOTDOT^ DIGIT | LETTER DOTDOT^ LETTER; brace_expansion_part : brace_expansion - | fname + | ((~COMMA) =3D> fname_part)+ -> ^(STRING fname_part+) | var_ref | command_sub; commasep: brace_expansion_part(COMMA! brace_expansion_part)+; @@ -371,6 +371,9 @@ str_part : ns_str_part | SLASH; //Parts of strings, no slashes, no reserved words +//Using negation leads to code that doesn't compile with the C backend +//Should be investigated and filed upstream +//Problematic: ~(CASE|DO|DONE|ELIF|ELSE|ESAC|FI|FOR|FUNCTION|IF|IN|SELEC= T|THEN|UNTIL|WHILE|TIME) ns_str_part : num | name @@ -378,7 +381,8 @@ ns_str_part |OTHER|EQUALS|PCT|PCTPCT|MINUS|DOT|DOTDOT|COLON|TEST_EXPR |TILDE|MUL_ASSIGN|DIVIDE_ASSIGN|MOD_ASSIGN|PLUS_ASSIGN|MINUS_ASSIGN |TIME_POSIX|LSHIFT_ASSIGN|RSHIFT_ASSIGN|AND_ASSIGN|XOR_ASSIGN - |OR_ASSIGN|CARET|POUND|POUNDPOUND; + |OR_ASSIGN|CARET|POUND|POUNDPOUND|COMMA; + //Generic strings/filenames. fname : (~POUND) =3D> fname_part fname_part* -> ^(STRING fname_part+); //A string that is NOT a bash reserved word diff --git a/bashast/gunit/fname.gunit b/bashast/gunit/fname.gunit index 126afe8..a5b1f7f 100644 --- a/bashast/gunit/fname.gunit +++ b/bashast/gunit/fname.gunit @@ -66,3 +66,4 @@ fname: "ab[[.backslash.]]" -> (STRING ab (MATCH_PATTERN (COLLATING_SYMBOL backs= lash))) "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)