summaryrefslogtreecommitdiff
path: root/source4/build
diff options
context:
space:
mode:
Diffstat (limited to 'source4/build')
-rw-r--r--source4/build/pidl/idl.gram11
-rw-r--r--source4/build/pidl/parser.pm4
-rw-r--r--source4/build/pidl/util.pm5
3 files changed, 17 insertions, 3 deletions
diff --git a/source4/build/pidl/idl.gram b/source4/build/pidl/idl.gram
index 956b3e9ff9..4605c4c712 100644
--- a/source4/build/pidl/idl.gram
+++ b/source4/build/pidl/idl.gram
@@ -107,11 +107,12 @@ property: 'unique'
| 'size_is' '(' expression ')' {{ "$item[1]" => "$item{expression}" }}
| 'length_is' '(' expression ')' {{ "$item[1]" => "$item{expression}" }}
| 'switch_is' '(' expression ')' {{ "$item[1]" => "$item{expression}" }}
+ | 'value' '(' anytext ')' {{ "$item[1]" => "$item{anytext}" }}
| 'switch_type' '(' type ')' {{ "$item[1]" => $item{type} }}
identifier: /[\w?]+/
-expression: /[\w?\/+*-]+/
+expression: /[\w.?\/+*-_]+/
function : type identifier '(' <commit> element_list2 ');'
{{
@@ -132,7 +133,13 @@ type :
| identifier { $item[1] }
| <error>
-text: /[\w\s.?-]*/
+text: /[\w\s\..?-]*/
+
+anytext: call(s?)
+ {{ "$item[1][0]" }}
+
+call: expression '(' <commit> expression ')'
+ {{ "$item[1]($item[4])" }}
constant: /-?\d+/
| '*'
diff --git a/source4/build/pidl/parser.pm b/source4/build/pidl/parser.pm
index ec747f33b5..d85a15eb00 100644
--- a/source4/build/pidl/parser.pm
+++ b/source4/build/pidl/parser.pm
@@ -168,7 +168,9 @@ sub ParseElementPushScalar($$$)
my($ndr_flags) = shift;
my $cprefix = util::c_push_prefix($e);
- if (defined $e->{VALUE}) {
+ if (my $value = util::has_property($e, "value")) {
+ $res .= "\tNDR_CHECK(ndr_push_$e->{TYPE}(ndr, $value));\n";
+ } elsif (defined $e->{VALUE}) {
$res .= "\tNDR_CHECK(ndr_push_$e->{TYPE}(ndr, $e->{VALUE}));\n";
} elsif (util::need_wire_pointer($e)) {
$res .= "\tNDR_CHECK(ndr_push_ptr(ndr, $var_prefix$e->{NAME}));\n";
diff --git a/source4/build/pidl/util.pm b/source4/build/pidl/util.pm
index 9e7b909109..341502e551 100644
--- a/source4/build/pidl/util.pm
+++ b/source4/build/pidl/util.pm
@@ -353,5 +353,10 @@ sub is_constant($)
return 0;
}
+sub dump($)
+{
+ print Dumper shift;
+}
+
1;