blob: 70677ac1871cf4cb3d8380fd5a3a21daa8822088 [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"
10 f: ">> \( _value) <<"
11 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 b: "foo"
29 c: 45
30
31 // The template does not require that this field be an integer (it may be
32 // a float), and thus this field specified additional information and
33 // cannot be removed.
34 n: int
35
36 sList: [{b: "foo"}, {}]
37}
38
39foo baz: {}
40
41foo multipath: {
42 t <Name>: {
43 // Combined with the other template, we know the value must be 5 and
44 // thus the entry below can be eliminated.
45 x: 5..8
46 }
47
48 t u: {
49 }
50}
51
52// TODO: top-level fields are currently not removed.
53group: {
Marcel van Lohuizen76b92b52018-12-16 10:47:03 +010054 comp "\(k)": v for k, v in foo
Marcel van Lohuizenea40e662018-12-11 18:07:49 +010055
56 comp bar: {
57 aa: 8 // new value
58 }
59}