From 6b1bcb401a25727bea39066cfe7d16fe3536e981 Mon Sep 17 00:00:00 2001 From: Mu Qiao Date: Fri, 2 Mar 2012 16:25:49 +0800 Subject: Walker: allow empty case command --- bashast/libbashWalker.g | 3 ++- scripts/compound_command.bash | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/bashast/libbashWalker.g b/bashast/libbashWalker.g index f57f403..95f8a90 100644 --- a/bashast/libbashWalker.g +++ b/bashast/libbashWalker.g @@ -1068,7 +1068,8 @@ case_clause[const std::string& target] returns[bool matched] else { $matched = false; - seek_to_next_tree(ctx); + if(LA(1) == CASE_COMMAND) + seek_to_next_tree(ctx); } }) |CASE_PATTERN; diff --git a/scripts/compound_command.bash b/scripts/compound_command.bash index 0d3321e..36161fe 100644 --- a/scripts/compound_command.bash +++ b/scripts/compound_command.bash @@ -361,3 +361,15 @@ for ((i = "${#python_versions[@]}"; i >= 0; i--)) do echo $i done +EAPI="4" +case ${EAPI} in + 0|1) + echo "Unsupported EAPI=${EAPI} (too old) for ruby-ng.eclass" ;; + 2|3);; + 4) + # S is no longer automatically assigned when it doesn't exist. + S="${WORKDIR}" + ;; + *) + echo "Unknown EAPI=${EAPI} for ruby-ng.eclass" +esac -- cgit v1.2.3-65-gdbad