Blob Blame History Raw
From d2f95da0bde7130cce98bbd91dc2095df3635bd4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Mon, 22 May 2017 11:14:40 +0200
Subject: [PATCH] Fix unescaped curly bracket in regexps
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Since 5.22.0 a literal '{' is a warning, since 5.26.0 it's an error:

Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/\G{ <-- HERE / at YappParse.yp line 288.
[...]

CPAN RT#106685
CPAN RT#114776

Signed-off-by: Petr Písař <ppisar@redhat.com>
---
 YappParse.yp            | 4 ++--
 lib/Parse/Yapp/Parse.pm | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/YappParse.yp b/YappParse.yp
index 9f6c234..8000b34 100644
--- a/YappParse.yp
+++ b/YappParse.yp
@@ -285,7 +285,7 @@ sub _Lexer {
         return($1, [ $1, $lineno[0] ]);
     };
 
-        $$input=~/\G{/gc
+        $$input=~/\G\{/gc
     and do {
         my($level,$from,$code);
 
@@ -312,7 +312,7 @@ sub _Lexer {
         and return('START',[ undef, $lineno[0] ]);
             $$input=~/\G%(expect)/gc
         and return('EXPECT',[ undef, $lineno[0] ]);
-            $$input=~/\G%{/gc
+            $$input=~/\G%\{/gc
         and do {
             my($code);
 
diff --git a/lib/Parse/Yapp/Parse.pm b/lib/Parse/Yapp/Parse.pm
index db561de..9651fa7 100755
--- a/lib/Parse/Yapp/Parse.pm
+++ b/lib/Parse/Yapp/Parse.pm
@@ -880,7 +880,7 @@ sub _Lexer {
         return($1, [ $1, $lineno[0] ]);
     };
 
-        $$input=~/\G{/gc
+        $$input=~/\G\{/gc
     and do {
         my($level,$from,$code);
 
@@ -907,7 +907,7 @@ sub _Lexer {
         and return('START',[ undef, $lineno[0] ]);
             $$input=~/\G%(expect)/gc
         and return('EXPECT',[ undef, $lineno[0] ]);
-            $$input=~/\G%{/gc
+            $$input=~/\G%\{/gc
         and do {
             my($code);
 
-- 
2.9.4