From cad5341becb798a14be433fd137b601ee919200b Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Mon, 11 Mar 2019 11:36:00 +0900 Subject: [PATCH] Fix regular express at speedup file fix build error """ Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/(\$(?:elt|new_elt|child|cdata|ent|_?parent|twig_current|next_sibling|first_child|prev_sibling|last_child|ref|elt->_parent))->set_(parent|prev_sibling)\(\s*((?:undef|\$\w+|\$\w+->{ <-- HERE \w+}|\$\w+->\w+|\$\w+->\w+\([^)]+\)))\s*\)/ at speedup line 49, <> line 1. [ 30s] Makefile:278: recipe for target 'Twig.pm' failed """ Change-Id: I5fa66f2f967a5fe9aeaa2a6cbae2fd6751b5eb75 Signed-off-by: DongHun Kwak --- speedup | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/speedup b/speedup index 41c59cc..36ff459 100644 --- a/speedup +++ b/speedup @@ -13,7 +13,7 @@ print STDERR "perl version is $]\n"; my $var= '(\$[a-z_]+(?:\[\d\])?)'; -my $set_to = '(?:undef|\$\w+|\$\w+->{\w+}|\$\w+->\w+|\$\w+->\w+\([^)]+\))'; +my $set_to = '(?:undef|\$\w+|\$\w+->\{\w+\}|\$\w+->\w+|\$\w+->\w+\([^)]+\))'; my $elt = '\$(?:elt|new_elt|child|cdata|ent|_?parent|twig_current|next_sibling|first_child|prev_sibling|last_child|ref|elt->_parent)'; @@ -46,10 +46,10 @@ while( <>) #s/$var->_($PRIVATE)\b(?!\()/$1\->\{$2\}/g; s/$var->_($PRIVATE)\b(\s*\(\s*\))?(?!\s*\()/$1\->\{$2\}/g; - s{($elt)->set_(parent|prev_sibling)\(\s*($set_to)\s*\)}{$1\->{$2}=$3; if( \$XML::Twig::weakrefs) { weaken( $1\->{$2});} }g; - s{($elt)->set_(first_child)\(\s*($set_to)\s*\)}{ $1\->set_not_empty; $1\->{$2}=$3; }g; - s{($elt)->set_(next_sibling)\(\s*($set_to)\s*\)}{ $1\->{$2}=$3; }g; - s{($elt)->set_(last_child)\(\s*($set_to)\s*\)}{ $1\->set_not_empty; $1\->{$2}=$3; if( \$XML::Twig::weakrefs) { weaken( $1\->{$2});} }g; + s{($elt)->set_(parent|prev_sibling)\(\s*($set_to)\s*\)}{$1\->\{$2\}=$3; if( \$XML::Twig::weakrefs) { weaken( $1\->\{$2\});} }g; + s{($elt)->set_(first_child)\(\s*($set_to)\s*\)}{ $1\->set_not_empty; $1\->\{$2\}=$3; }g; + s{($elt)->set_(next_sibling)\(\s*($set_to)\s*\)}{ $1\->\{$2\}=$3; }g; + s{($elt)->set_(last_child)\(\s*($set_to)\s*\)}{ $1\->set_not_empty; $1\->\{$2\}=$3; if( \$XML::Twig::weakrefs) { weaken( $1\->\{$2\});} }g; s/$var->atts/$1\->{att}/g; -- 2.7.4