|
@@ -29,6 +29,7 @@ type annotation_kind =
|
|
|
| ABool of bool
|
|
|
| AEnum of jsignature * string
|
|
|
| AArray of annotation_kind list
|
|
|
+ | AAnnotation of jsignature * annotation
|
|
|
|
|
|
and annotation = (string * annotation_kind) list
|
|
|
|
|
@@ -37,7 +38,7 @@ type export_config = {
|
|
|
}
|
|
|
|
|
|
let convert_annotations pool annotations =
|
|
|
- let a = Array.map (fun (jsig,l) ->
|
|
|
+ let rec process_annotation (jsig, l) =
|
|
|
let offset = pool#add_string (generate_signature false jsig) in
|
|
|
let l = List.map (fun (name,ak) ->
|
|
|
let offset = pool#add_string name in
|
|
@@ -55,14 +56,19 @@ let convert_annotations pool annotations =
|
|
|
| AArray l ->
|
|
|
let l = List.map (fun ak -> loop ak) l in
|
|
|
'[',ValArray(Array.of_list l)
|
|
|
+ | AAnnotation (jsig, a) ->
|
|
|
+ let ann = process_annotation (jsig, a) in
|
|
|
+ '@',ValAnnotation(ann)
|
|
|
+
|
|
|
in
|
|
|
offset,loop ak
|
|
|
) l in
|
|
|
- {
|
|
|
+ {
|
|
|
ann_type = offset;
|
|
|
ann_elements = Array.of_list l;
|
|
|
- }
|
|
|
- ) annotations in
|
|
|
+ }
|
|
|
+ in
|
|
|
+ let a = Array.map process_annotation annotations in
|
|
|
a
|
|
|
|
|
|
class base_builder = object(self)
|
|
@@ -89,4 +95,4 @@ class base_builder = object(self)
|
|
|
|
|
|
method export_attributes (pool : JvmConstantPool.constant_pool) =
|
|
|
DynArray.to_array (DynArray.map (write_attribute pool) attributes)
|
|
|
-end
|
|
|
+end
|