From 9f44a14e09671634f7bbb3ee6ae33fc7a2276fac Mon Sep 17 00:00:00 2001 From: "ian%hixie.ch" Date: Sat, 28 Dec 2002 18:24:27 +0000 Subject: [PATCH] Allow catch...with statements to not be followed by anything. Also add a little debug code. --- webtools/PLIF/PLIF/Exception.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/webtools/PLIF/PLIF/Exception.pm b/webtools/PLIF/PLIF/Exception.pm index 1e69582e015..2f1d7b3056e 100644 --- a/webtools/PLIF/PLIF/Exception.pm +++ b/webtools/PLIF/PLIF/Exception.pm @@ -163,7 +163,8 @@ sub catch($$) { not $continuation->isa('PLIF::Exception::Internal::With')) { syntax 'Syntax error: missing "with" operator in "catch" clause', caller; } - syntax 'Syntax error after "catch ... with" clause', caller if (scalar(@more)); + { local $" = '\', \''; + syntax "Syntax error after \"catch ... with\" clause ('@_'?)", caller if (scalar(@more)); } $continuation->{'resolved'} = 1; my $handler = $continuation->{'handler'}; $continuation = $continuation->{'continuation'}; @@ -176,9 +177,9 @@ sub catch($$) { sub with(&;$) { my($handler, $continuation) = @_; - if (not defined($continuation) or - not ref($continuation) or - not $continuation->isa('PLIF::Exception::Internal::Continuation')) { + if (defined($continuation) and + (not ref($continuation) or + not $continuation->isa('PLIF::Exception::Internal::Continuation'))) { syntax 'Syntax error after "catch ... with" clause', caller; } return PLIF::Exception::Internal::With->create($handler, $continuation, caller);