forked from l20n/lol-fixtures
-
Notifications
You must be signed in to change notification settings - Fork 0
/
macros.lol
106 lines (85 loc) · 2.87 KB
/
macros.lol
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<double($a) { $a + $a }>
<callDouble "{{ double(3) }}">
<zero($n) { 0 }>
<callZero "{{ zero(1) }}">
<callFib "{{ fib(20) }}">
<fib($n) { $n == 0 ?
0 :
$n == 1 ?
1 :
fib($n - 1) + fib($n - 2) }>
<callFac "{{ fac(5) }}">
<fac($n) { $n == 0 ?
1 :
$n * fac($n - 1) }>
<plural($n) { $n == 1 ?
'one' :
$n % 10 >= 2 &&
$n % 10 <= 4 &&
($n % 100 < 10 || $n % 100 >= 20) ?
'few' :
'many' }>
<callPlural0 "{{ plural(0) }}">
<callPlural1 "{{ plural(1) }}">
<callPlural2 "{{ plural(2) }}">
<callPlural5 "{{ plural(5) }}">
<callPlural11 "{{ plural(11) }}">
<callPlural22 "{{ plural(22) }}">
<callPlural101 "{{ plural(101) }}">
<callPlural102 "{{ plural(102) }}">
<callPlural111 "{{ plural(111) }}">
<callPlural121 "{{ plural(121) }}">
<callPlural122 "{{ plural(122) }}">
<callZeroOrFac "{{ zero(1) || fac(5) }}">
<quad($a) { double(double($a)) }>
<callQuad "{{ quad(7) }}">
<call($macro, $arg) { $macro($arg) }>
<callCall "{{ call(fac, 5) }}">
<callCallString "{{ call('fac', 5) }}">
<get($entity) { $entity }>
<callGet "{{ get(brandName) }}">
<callGet1 "{{ get(brandName).nominative }}">
<callGet2 "{{ get(brandName).genitive }}">
<getGenitive($entity) { $entity.genitive }>
<callGetGenitive "{{ getGenitive(brandName) }}">
<brandName {
*nominative: "Firefox",
genitive: "Firefox's"
}>
<getBrandName($null) { brandName }>
<callGetBrandName "{{ getBrandName() }}">
<getBrandNameCase($case) { brandName[$case] }>
<callGetBrandNameCase "{{ getBrandNameCase('genitive') }}">
<brandNameLength {
*short: {
*nominative: "Firefox",
genitive: "Firefox's"
},
long: {
*nominative: "Mozilla Firefox",
genitive: "Mozilla Firefox's"
}
}>
<getBrandNameLength($length) { brandNameLength[$length] }>
<callGetBrandNameLength1 "{{ getBrandNameLength('long') }}">
<callGetBrandNameLength2 "{{ getBrandNameLength('long').genitive }}">
<getBrandNameLengthGenitive($length) { brandNameLength[$length].genitive }>
<callGetBrandNameLengthGenitive "{{ getBrandNameLengthGenitive('long') }}">
<brandNameThis {
*short: {
*nominative: "Firefox",
genitive: "Firefox's"
},
long: {
*nominative: "Mozilla {{ ~ }}",
genitive: "Mozilla {{ ~.short.genitive }}"
}
}>
<getBrandNameThisLength($length) { brandNameThis[$length] }>
<callGetBrandNameThisLength1 "{{ getBrandNameLength('long') }}">
<callGetBrandNameThisLength2 "{{ getBrandNameLength('long').genitive }}">
<getBrandNameThisGenitive($length) { brandNameThis[$length].genitive }>
<callGetBrandNameThisGenitive "{{ getBrandNameThisGenitive('long') }}">
<getBrandNameThis($length, $case) { brandNameThis[$length][$case] }>
<callGetBrandNameThis1 "{{ getBrandNameThis('long', 'nominative') }}">
<callGetBrandNameThis2 "{{ getBrandNameThis('long', 'genitive') }}">