Gentoo Archives: gentoo-commits

From: "Petteri Räty" <betelgeuse@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/libbash:master commit in: scripts/, bashast/
Date: Thu, 04 Aug 2011 13:56:12
Message-Id: 1e51015b4e2e76a912e077faf772e6470090b130.betelgeuse@gentoo
1 commit: 1e51015b4e2e76a912e077faf772e6470090b130
2 Author: Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jul 29 12:54:12 2011 +0000
4 Commit: Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
5 CommitDate: Tue Aug 2 07:52:19 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=1e51015b
7
8 Parser: improve the rule for regular expression
9
10 ---
11 bashast/bashast.g | 14 +++++++++++---
12 scripts/var_expansion.bash | 7 +++++++
13 2 files changed, 18 insertions(+), 3 deletions(-)
14
15 diff --git a/bashast/bashast.g b/bashast/bashast.g
16 index ea8185f..5549439 100644
17 --- a/bashast/bashast.g
18 +++ b/bashast/bashast.g
19 @@ -620,19 +620,27 @@ keyword_condition_binary
20 -> ^(MATCH_PATTERN condition_part ^(STRING extended_pattern_match+))
21 | -> condition_part
22 );
23 -//TODO improve this rule
24 bash_pattern_part
25 scope {
26 int parens;
27 +#ifdef OUTPUT_C
28 + bool quoted;
29 +#else
30 + boolean quoted;
31 +#endif
32 }
33 @init {
34 $bash_pattern_part::parens = 0;
35 + $bash_pattern_part::quoted = false;
36 }
37 :(
38 - (ESC BLANK) => ESC BLANK
39 + DQUOTE! { $bash_pattern_part::quoted = !$bash_pattern_part::quoted; }
40 + | {$bash_pattern_part::quoted}? => ~DQUOTE
41 + | (ESC BLANK) => ESC BLANK
42 | LPAREN { if(LA(-2) != ESC) $bash_pattern_part::parens++; }
43 + | LLPAREN { if(LA(-2) != ESC) $bash_pattern_part::parens += 2; }
44 | {$bash_pattern_part::parens != 0}? => RPAREN { if(LA(-2) != ESC) $bash_pattern_part::parens--; }
45 - | ~(BLANK|EOL|LOGICAND|LOGICOR|LPAREN|RPAREN)
46 + | ~(BLANK|EOL|LOGICAND|LOGICOR|LPAREN|RPAREN|DQUOTE|LLPAREN)
47 )+;
48 keyword_binary_string_operator
49 : BLANK! binary_operator BLANK!
50
51 diff --git a/scripts/var_expansion.bash b/scripts/var_expansion.bash
52 index 2d9a28e..9f442b1 100644
53 --- a/scripts/var_expansion.bash
54 +++ b/scripts/var_expansion.bash
55 @@ -127,3 +127,10 @@ echo ${bar+abc}
56 foo=
57 unset bar
58 echo ${bar=abc}
59 +
60 +# This regular expression will cause boost::exception_detail::clone_impl<boost::xpressive::regex_error>
61 +#[[ "${version_components_groups}" =~ ("*".*" "|" *"|^2.*\ (2|\*)|^3.*\ (3|\*)) ]]
62 +[[ " ${FUNCNAME[@]:2} " =~ " "(_python_final_sanity_checks|python_execute_function|python_mod_optimize|python_mod_cleanup)" " ]]
63 +[[ "$(declare -p PYTHON_SANITY_CHECKS_EXECUTED)" != "declare -- PYTHON_SANITY_CHECKS_EXECUTED="* || " ${FUNCNAME[@]:1} " =~ " "(python_set_active_version|python_pkg_setup)" " && -z "${PYTHON_SKIP_SANITY_CHECKS}" ]]
64 +[[ " ${FUNCNAME[@]:1} " =~ " "(python_set_active_version|python_pkg_setup)" " ]]
65 +[[ "$(echo "2p" "${file}")" =~ ^"# Gentoo '".*"' wrapper script generated by python_generate_wrapper_scripts()"$ ]]