blob: db0ca2eb9c553248a669d1f045d0fa9294887144 [file] [log] [blame]
Marcel van Lohuizenea40e662018-12-11 18:07:49 +01001package trim
2
3foo <Name>: {
4 _value: string
5
6 a: 4
7 b: string
8 d: 8
9 e: "foo"
Marcel van Lohuizen76b92b52018-12-16 10:47:03 +010010 f: ">> \( _value) <<"
Marcel van Lohuizenea40e662018-12-11 18:07:49 +010011 n: 5
12
13 list: ["foo", 8.0]
14
15 struct: {a: 3.0}
16
17 sList: [{a: 8, b: string}, {a: 9, b: "foo" | string}]
18 rList: [{a: "a"}]
19 rcList: [{a: "a", c: b}]
20
21 t <Name>: {
22 x: 0..5
23 }
24}
25
26foo bar: {
27 _value: "here"
28
29 a: 4
30 b: "foo"
31 c: 45
32 e: string
33 f: ">> here <<"
34
35 // The template does not require that this field be an integer (it may be
36 // a float), and thus this field specified additional information and
37 // cannot be removed.
38 n: int
39
40 struct: {a: 3.0}
41
42 list: ["foo", float]
43
44 sList: [{a: 8, b: "foo"}, {b: "foo"}]
45 rList: [{a: string}]
46 rcList: [{a: "a", c: "foo"}]
47}
48
49foo baz: {}
50
51foo multipath: {
52 t <Name>: {
53 // Combined with the other template, we know the value must be 5 and
54 // thus the entry below can be eliminated.
55 x: 5..8
56 }
57
58 t u: {
59 x: 5
60 }
61}
62
63// TODO: top-level fields are currently not removed.
64group: {
Marcel van Lohuizen76b92b52018-12-16 10:47:03 +010065 comp "\(k)": v for k, v in foo
Marcel van Lohuizenea40e662018-12-11 18:07:49 +010066
67 comp bar: {
68 a: 4
69 aa: 8 // new value
70 }
71
72 comp baz: {} // removed: fully implied by comprehension above
Marcel van Lohuizen76b92b52018-12-16 10:47:03 +010073}