blob: 930ca97d8cf1da96e1248fca47c6bd8526bf61e5 (
plain)
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
|
(.module:
[lux (#- static)
[abstract
["." equivalence (#+ Equivalence)]
[monoid (#+)]
["." monad (#+ do)]]
[control
[parser (#+)]
["." state (#+ State)]]
[data
[number (#+)
[i64 (#+)]]
[format
["." binary (#+ Format)]]
[collection
["." row (#+ Row)]]]
[type
[abstract (#+)]]]
["." // #_
[encoding (#+)]
[modifier (#+ modifiers:)]
["#." constant (#+ UTF8)
["#/." pool (#+ Pool)]]
["#." index (#+ Index)]
["#." attribute (#+ Attribute)]
["#." descriptor (#+ Descriptor Value)]])
(modifiers:
["0001" public]
["0002" private]
["0004" protected]
["0008" static]
["0010" final]
["0040" volatile]
["0080" transient]
["1000" synthetic]
["4000" enum]
)
(type: #export Field
{#modifier Modifier
#name (Index UTF8)
#descriptor (Index (Descriptor (Value Any)))
#attributes (Row Attribute)})
(def: #export equivalence
(Equivalence Field)
($_ equivalence.product
..modifier-equivalence
//index.equivalence
//index.equivalence
(row.equivalence //attribute.equivalence)))
(def: #export format
(Format Field)
($_ binary.and
..modifier-format
//index.format
//index.format
(binary.row/16 //attribute.format)))
(def: #export (field modifier name descriptor attributes)
(-> Modifier UTF8 (Descriptor (Value Any)) (Row Attribute)
(State Pool Field))
(do state.monad
[@name (//constant/pool.utf8 name)
@descriptor (//constant/pool.descriptor descriptor)]
(wrap {#modifier modifier
#name @name
#descriptor @descriptor
#attributes attributes})))
|