summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl/Util.pm
diff options
context:
space:
mode:
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl/Util.pm')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Util.pm19
1 files changed, 18 insertions, 1 deletions
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;