author | Roker <roker@pep-project.org> |
Fri, 15 Jan 2021 13:36:41 +0100 | |
branch | ENGINE-864 |
changeset 5269 | e7794a7f7de2 |
parent 2829 | e444c3c960bb |
child 4585 | af441dfc1d2c |
permissions | -rw-r--r-- |
1 // This file is under GNU General Public License 3.0
2 // see LICENSE.txt
4 // function library
6 def "func:distinctName" {
7 param "nodes", "/..";
8 choose {
9 when "not($nodes)"
10 result "/..";
11 otherwise
12 result "$nodes[1] | func:distinctName($nodes[position() > 1])[@name != $nodes[1]/@name]";
13 }
14 }
16 def "func:distinctType" {
17 param "nodes", "/..";
18 choose {
19 when "not($nodes)"
20 result "/..";
21 otherwise
22 result "$nodes[1] | func:distinctType($nodes[position() > 1])[@type != $nodes[1]/@type]";
23 }
24 }
26 def "func:asn1name"
27 result "translate(@name, '_', '-')";
29 def "func:asn1type" {
30 choose {
31 when "@type='bool'"
32 result "'BOOLEAN'";
33 when "@type='int'"
34 result "'INTEGER'";
35 otherwise
36 result "translate(@type, '_', '-')";
37 }
38 }
40 def "func:basicType" {
41 choose {
42 when "substring(@type,1,1)=yml:lcase(substring(@type,1,1))"
43 result "true()";
44 otherwise
45 result "false()";
46 }
47 }
49 def "func:ctype" {
50 choose {
51 when "func:basicType()"
52 result "@type";
53 otherwise
54 result "concat(@type,'_t')";
55 }
56 }