/
test_info.dei
82 lines (67 loc) · 1.83 KB
/
test_info.dei
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Fonts for the default UI style
# - size can be "pt" or "px", defaults to "pt"
# - weight: normal bold light
# - style: normal italic
script {
# Version module will be available in embedded scripts here.
import Version
def joinArray(a)
result = ''
for i in a: result += i
return result
end
}
script "condition testing" condition "Version.OS == 'macx'" {
print "Running on %s!" % Version.OS
for i in [0, 2, 4]
print 'i =', i
end
}
# Nameless groups are allowed.
group {
condition: False
script test2 condition True { print "WILL NOT BE RUN" }
}
thing A {
member: value from A
}
thing B inherits A {
member2: value from B
script { print "Contents of B:"; print __this__ }
}
group {
# All members inherit A.
inherits = A
thing C {
member2: value from C
script { print "Contents of C:"; print __this__ }
}
thing D inherits B {
# Inherits A from group, then B.
member3: value from D
script { print "Contents of D:"; print __this__ }
}
}
type1 first-block { key = value }
type2 example-block inherits first-block {}
group font {
condition: Version.OS == 'macx'
preferences < font.default, $" 'font'+'.'+'title' " >
font Default {
family $= 'Lucida ' + "Grande"
size $: joinArray(['16', 'pt'])
weight = normal
style: normal
script {
print "Default font:"
print __this__
}
}
# Identifiers retain case in script namespaces (and are case
# sensitive), however group types are forced lower case (FoNt==font).
FoNt "Title" inherits font.Default {
SIZE: 24pt
weight $: if __this__.weight == "normal": "bold"; else: "normal"
}
}
script { print "Title font:\n", font.Title }