Fix regular express at speedup file 54/201154/1 accepted/tizen_5.5_unified accepted/tizen_5.5_unified_mobile_hotfix accepted/tizen_5.5_unified_wearable_hotfix accepted/tizen_6.0_unified accepted/tizen_6.0_unified_hotfix accepted/tizen_6.5_unified backup/perl-XML-Twig-3.39-20220725 tizen_5.5 tizen_5.5_mobile_hotfix tizen_5.5_tv tizen_5.5_wearable_hotfix tizen_6.0 tizen_6.0_hotfix tizen_6.5 accepted/tizen/5.5/unified/20191031.013611 accepted/tizen/5.5/unified/mobile/hotfix/20201027.072509 accepted/tizen/5.5/unified/wearable/hotfix/20201027.105040 accepted/tizen/6.0/unified/20201030.112109 accepted/tizen/6.0/unified/hotfix/20201102.232321 accepted/tizen/6.5/unified/20211028.225624 accepted/tizen/unified/20190311.041259 submit/tizen/20190311.030432 submit/tizen_5.5/20191031.000008 submit/tizen_5.5_mobile_hotfix/20201026.185108 submit/tizen_5.5_wearable_hotfix/20201026.184308 submit/tizen_6.0/20201029.205503 submit/tizen_6.0_hotfix/20201102.192903 submit/tizen_6.0_hotfix/20201103.115103 submit/tizen_6.5/20211028.163601 tizen_5.5.m2_release tizen_6.0.m2_release tizen_6.5.m2_release
authorDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 11 Mar 2019 02:36:00 +0000 (11:36 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 11 Mar 2019 02:36:57 +0000 (11:36 +0900)
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 <dh0128.kwak@samsung.com>
speedup

diff --git a/speedup b/speedup
index 41c59cc..36ff459 100644 (file)
--- 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;