public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Petteri Räty" <betelgeuse@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/libbash:master commit in: bashast/, test/
Date: Thu,  7 Apr 2011 16:44:59 +0000 (UTC)	[thread overview]
Message-ID: <57038643622fa72931d2a5e9f0d0696f4cbbd6cd.betelgeuse@gentoo> (raw)

commit:     57038643622fa72931d2a5e9f0d0696f4cbbd6cd
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Thu Apr  7 11:22:59 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Thu Apr  7 16:39:28 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=57038643

Simplify double quoted string with negation

Using the same trick with negation as previously for single quotes make
the double quote rules simpler. The test str_assignment6 was faulty as
it was starting a command expansion that was never completed.

---
 bashast/bashast.g    |   16 ++++------------
 test/walker_test.cpp |    4 ++--
 2 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/bashast/bashast.g b/bashast/bashast.g
index 3d52c27..2c72c44 100644
--- a/bashast/bashast.g
+++ b/bashast/bashast.g
@@ -368,10 +368,6 @@ ns_str_part_no_res
 	|	name|OTHER|EQUALS|PCT|PCTPCT|MINUS|DOT|DOTDOT|COLON|BOP|UOP|TEST_EXPR|'_'|TILDE|INC|DEC|MUL_ASSIGN|DIVIDE_ASSIGN|MOD_ASSIGN|PLUS_ASSIGN|MINUS_ASSIGN|LSHIFT_ASSIGN|RSHIFT_ASSIGN|AND_ASSIGN|XOR_ASSIGN|OR_ASSIGN|ESC_CHAR|CARET;
 //strings with no slashes, used in certain variable expansions
 ns_str	:	ns_str_part* -> ^(STRING ns_str_part*);
-//Allowable parts of double quoted strings
-dq_str_part
-	:	BLANK|EOL|AMP|LOGICAND|LOGICOR|LESS_THAN|GREATER_THAN|PIPE|SQUOTE|SEMIC|COMMA|LPAREN|RPAREN|LLPAREN|RRPAREN|DOUBLE_SEMIC|LBRACE|RBRACE|TICK|LEQ|GEQ
-	|	str_part_with_pound;
 //Generic strings/filenames.
 fname	:	nqstr -> ^(STRING nqstr);
 //A string that is NOT a bash reserved word
@@ -398,14 +394,10 @@ nqstr	:	(bracket_pattern_match|extended_pattern_match|var_ref|command_sub|arithm
 //double quoted string rule, allows expansions
 dqstr	:	QUOTE dqstr_part* QUOTE -> ^(DOUBLE_QUOTED_STRING dqstr_part*);
 dqstr_part
-	:	bracket_pattern_match
-	|	extended_pattern_match
-	|	var_ref
-	|	command_sub
-	|	arithmetic_expansion
-	|	dq_str_part
-	|	pattern_match_trigger
-	|	BANG;
+	: var_ref
+	| command_sub
+	| arithmetic_expansion
+	| ~(DOLLAR|TICK|QUOTE);
 //single quoted string rule, no expansions
 sqstr_part
 	: ~SQUOTE*;

diff --git a/test/walker_test.cpp b/test/walker_test.cpp
index 6081254..8185710 100644
--- a/test/walker_test.cpp
+++ b/test/walker_test.cpp
@@ -56,6 +56,6 @@ TEST_STRING_ASSIGNMENT(str_assignment5,
                        "str",
                        "123 abc = % %% - . .. :  -a -aa test _ ~ ++ -- *= /= %= += -= <<= >>= &= ^= |= \\a ^ aä")
 TEST_STRING_ASSIGNMENT(str_assignment6,
-                       "str=\"/ \n \r\n & && ||| || > < ' : ; , ( (( ) )) ;;  { } ` >= <=\"",
+                       "str=\"/ \n \r\n & && ||| || > < ' : ; , ( (( ) )) ;; { } >= <=\"",
                        "str",
-                       "/ \n \r\n & && ||| || > < ' : ; , ( (( ) )) ;;  { } ` >= <=")
+                       "/ \n \r\n & && ||| || > < ' : ; , ( (( ) )) ;; { } >= <=")



             reply	other threads:[~2011-04-07 16:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-07 16:44 Petteri Räty [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-04-14  4:50 [gentoo-commits] proj/libbash:master commit in: bashast/, test/ Petteri Räty
2011-03-31 12:32 Petteri Räty
2011-03-31 12:32 Petteri Räty
2011-03-30 12:48 Petteri Räty
2011-03-30 12:48 Petteri Räty

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57038643622fa72931d2a5e9f0d0696f4cbbd6cd.betelgeuse@gentoo \
    --to=betelgeuse@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox