From 95f7f4d001684d447ce8e0f880200cfac89f011a Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 9 Jan 2007 23:41:25 +0000 Subject: r20637: Don't check for NULL pointers when the pointer is guaranteed to not be NULL (if it is a ref pointer). (This used to be commit 419547df76c38fde1f54b06dc633832523ad3394) --- source4/pidl/lib/Parse/Pidl/Util.pm | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'source4/pidl/lib/Parse/Pidl/Util.pm') diff --git a/source4/pidl/lib/Parse/Pidl/Util.pm b/source4/pidl/lib/Parse/Pidl/Util.pm index 35338492dd..35e25286f5 100644 --- a/source4/pidl/lib/Parse/Pidl/Util.pm +++ b/source4/pidl/lib/Parse/Pidl/Util.pm @@ -6,7 +6,7 @@ package Parse::Pidl::Util; require Exporter; @ISA = qw(Exporter); -@EXPORT = qw(has_property property_matches ParseExpr is_constant make_str print_uuid MyDumper); +@EXPORT = qw(has_property property_matches ParseExpr ParseExprExt is_constant make_str print_uuid MyDumper); use vars qw($VERSION); $VERSION = '0.01'; @@ -115,4 +115,21 @@ sub ParseExpr($$$) undef); } +sub ParseExprExt($$$$) +{ + my($expr, $varlist, $e, $deref) = @_; + + die("Undefined value in ParseExpr") if not defined($expr); + + my $x = new Parse::Pidl::Expr(); + + return $x->Run($expr, sub { my $x = shift; error($e, $x); }, + # Lookup fn + sub { my $x = shift; + return($varlist->{$x}) if (defined($varlist->{$x})); + return $x; + }, + $deref); +} + 1; -- cgit