[interchange-cvs] interchange - heins modified lib/Vend/Parse.pm
interchange-core@interchange.redhat.com
interchange-core@interchange.redhat.com
Fri Feb 8 23:14:01 2002
User: heins
Date: 2002-02-09 04:13:38 GMT
Modified: lib/Vend Parse.pm
Log:
* With so many tags moved out of the core, we needed a way to identify
better than "(eval 541)". This should do it.
Revision Changes Path
2.12 +11 -3 interchange/lib/Vend/Parse.pm
rev 2.12, prev_rev 2.11
Index: Parse.pm
===================================================================
RCS file: /anon_cvs/repository/interchange/lib/Vend/Parse.pm,v
retrieving revision 2.11
retrieving revision 2.12
diff -u -r2.11 -r2.12
--- Parse.pm 7 Feb 2002 21:33:21 -0000 2.11
+++ Parse.pm 9 Feb 2002 04:13:38 -0000 2.12
@@ -1,6 +1,6 @@
# Vend::Parse - Parse Interchange tags
#
-# $Id: Parse.pm,v 2.11 2002/02/07 21:33:21 mheins Exp $
+# $Id: Parse.pm,v 2.12 2002/02/09 04:13:38 mheins Exp $
#
# Copyright (C) 1996-2001 Red Hat, Inc. <interchange@redhat.com>
#
@@ -35,7 +35,7 @@
@ISA = qw(Exporter Vend::Parser);
-$VERSION = substr(q$Revision: 2.11 $, 10);
+$VERSION = substr(q$Revision: 2.12 $, 10);
@EXPORT = ();
@EXPORT_OK = qw(find_matching_end);
@@ -568,6 +568,7 @@
my($self, $tag, $attr, $attrseq, $origtext, $end_tag) = @_;
#::logDebug("HTML tag=$tag Interp='$Interpolate{$tag}' origtext=$origtext attributes:\n" . ::uneval($attr));
$tag =~ tr/-/_/; # canonical
+ $Vend::CurrentTag = $tag = lc $tag;
my $buf = \$self->{_buf};
@@ -887,13 +888,19 @@
}
+sub eval_die {
+ my $msg = shift;
+ $msg =~ s/\(eval\s+\d+/(tag '$Vend::CurrentTag'/;
+ die($msg, @_);
+}
+
# syntax color '"
sub start {
return html_start(@_) if $_[0]->{HTML};
my($self, $tag, $attr, $attrseq, $origtext, $empty_container) = @_;
$tag =~ tr/-/_/; # canonical
- $tag = lc $tag;
+ $Vend::CurrentTag = $tag = lc $tag;
my $buf = \$self->{_buf};
my($tmpbuf);
@@ -1034,6 +1041,7 @@
}
}
+ local($SIG{__DIE__}) = \&eval_die;
if($hasEndTag{$tag}) {
# Handle embedded tags, but only if interpolate is
# defined (always if using old tags)