Changeset 21436 for perl5

Show
Ignore:
Timestamp:
07/22/08 13:55:11 (6 months ago)
Author:
fglock
Message:

[PCR] better error message

Location:
perl5/Pugs-Compiler-Rule/lib/Pugs
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • perl5/Pugs-Compiler-Rule/lib/Pugs/Emitter/Rule/Perl5/CharClass.pm

    r21420 r21436  
    2020    $c =~ s/\s+$//; 
    2121    my $s = charnames::vianame($c); 
    22     return $s if $s; 
     22    return $s if defined $s; 
    2323    $s = charnames::vianame("LINE FEED (LF)")  
    2424        if $c eq "LINE FEED" || $c eq "LF"; 
  • perl5/Pugs-Compiler-Rule/lib/Pugs/Runtime/Regex.pm

    r16824 r21436  
    214214    return sub { 
    215215        #use charnames ':full'; 
    216         my $bool = $_[7]{ignorecase} 
    217             ? substr( $_[0], $_[5] ) =~ m/(?i)$rx/ 
    218             : substr( $_[0], $_[5] ) =~ m/$rx/; 
    219         $_[3] = Pugs::Runtime::Match->new({  
     216        my $bool; 
     217        eval { 
     218            $bool = $_[7]{ignorecase} 
     219                ? substr( $_[0], $_[5] ) =~ m/(?i)$rx/ 
     220                : substr( $_[0], $_[5] ) =~ m/$rx/; 
     221            $_[3] = Pugs::Runtime::Match->new({  
    220222                bool  => \$bool, 
    221223                str   => \$_[0], 
     
    225227                match => [], 
    226228            }); 
     229            1; 
     230        }  
     231        or do { 
     232            die "$@ in perl5 regex: /$rx/"; 
     233        }; 
     234        $_[3]; 
    227235    }; 
    228236}