Skip to content
Browse files

Perlito5 - parser: fix regex escape

  • Loading branch information...
1 parent 933767d commit f79354ccec9e002da458eacaeb0defee55786157 @fglock committed
Showing with 3 additions and 2 deletions.
  1. +1 −1 html/perlito5.js
  2. +1 −1 perlito5.pl
  3. +1 −0 src5/lib/Perlito5/Grammar/String.pm
View
2 html/perlito5.js
@@ -8596,7 +8596,7 @@ var p5100 = p5pkg['main'];
else {
if ( (p5str(v_c) == String.fromCharCode(92)) ) {
if ( (p5num(v_interpolate) == 2) ) {
- null;
+ (v_m = ((new p5HashRef(p5a_to_h(p5list_to_a('str', v_str, 'from', v_p, 'to', (p5num(v_p) + 2), 'capture', p5call(p5pkg["Perlito5::AST::Val::Buf"], "new", ['buf', p5pkg["Perlito5::Grammar::String"].substr([v_str, v_p, 2], 1)], 1)))))));
}
else {
if ( (p5num(v_interpolate) == 1) ) {
View
2 perlito5.pl
@@ -4983,7 +4983,7 @@ sub Perlito5::Grammar::String::string_interpolation_parse {
else {
if (($c eq chr(92))) {
if (($interpolate == 2)) {
-
+ ($m = {'str', $str, 'from', $p, 'to', ($p + 2), 'capture', Perlito5::AST::Val::Buf->new('buf', substr($str, $p, 2))})
}
else {
if (($interpolate == 1)) {
View
1 src5/lib/Perlito5/Grammar/String.pm
@@ -363,6 +363,7 @@ sub string_interpolation_parse {
elsif ($c eq '\\') {
if ($interpolate == 2) {
# regex
+ $m = { str => $str, from => $p, to => $p+2, capture => Perlito5::AST::Val::Buf->new( buf => substr($str, $p, 2) ) }
}
elsif ($interpolate == 1) {
# double-quotes

0 comments on commit f79354c

Please sign in to comment.
Something went wrong with that request. Please try again.