From: miker Date: Mon, 7 Mar 2005 22:01:04 +0000 (+0000) Subject: removing computed regexes and commenting out unused code X-Git-Tag: osrf_rel_2_0_1~1677 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=9c185d7ab8b59382cb963879e7628b701780d8bd;p=OpenSRF.git removing computed regexes and commenting out unused code git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@195 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/perlmods/JSON.pm b/src/perlmods/JSON.pm index 9e6db46..db0d59e 100644 --- a/src/perlmods/JSON.pm +++ b/src/perlmods/JSON.pm @@ -14,7 +14,7 @@ use overload ( '*' => sub { int($_[0]) * int($_[1]) } ); use overload ( '/' => sub { int($_[0]) / int($_[1]) } ); use overload ( '%' => sub { int($_[0]) % int($_[1]) } ); use overload ( '**' => sub { int($_[0]) ** int($_[1]) } ); -use overload ( 'neg' => sub { neg(int($_[0])) } ); +use overload ( 'neg' => sub { -int($_[0]) } ); sub toString { defined($_[1]) ? ${$_[1]} : ${$_[0]} } @@ -41,9 +41,6 @@ sub register_class_hint { my $class = shift; my %args = @_; - $args{hint_re} = qr/(?:\b$args{hint})\b/; - $args{class_re} = qr/(?:\b$args{name})\b/; - $_class_map{hints}{$args{hint}} = \%args; $_class_map{classes}{$args{name}} = \%args; } @@ -97,13 +94,13 @@ sub JSON2perl { s/\/\*--\s*E\w*?\s+(\S+)\s*--\*\// => _json_hint_to_class("$1")) /sog; } else { #why don't I work?!?! - my $string = $_; - for my $hint (values %{$_class_map{hints}}) { - $string =~ s/\/\*--\s*S\w*?\s+$$hint{hint_re}\s*--\*\// bless(/sog; - $string =~ s/\/\*--\s*E\w*?\s+$$hint{hint_re}\s*--\*\// => "$$hint{name}") /sog; - } - $_ = $string; - s/\/\*--\s*\w+\s+\S+\s*--\*\///sog; + #my $string = $_; + #for my $hint (values %{$_class_map{hints}}) { + # $string =~ s/\/\*--\s*S\w*?\s+$$hint{hint_re}\s*--\*\// bless(/sog; + # $string =~ s/\/\*--\s*E\w*?\s+$$hint{hint_re}\s*--\*\// => "$$hint{name}") /sog; + #} + #$_ = $string; + #s/\/\*--\s*\w+\s+\S+\s*--\*\///sog; }