Skip to content

Commit 1d5c00a

Browse files
committed
CHC: add exp list to dictionary
1 parent 514b147 commit 1d5c00a

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

CodeHawk/CHC/cchlib/cCHDictionary.ml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,14 @@ object (self)
563563
else
564564
None
565565

566+
method write_xml_exp_list ?(tag="iexpl") (node: xml_element_int) (l: exp list) =
567+
node#setAttribute tag
568+
(String.concat "," (List.map string_of_int (List.map self#index_exp l)))
569+
570+
method read_xml_exp_list ?(tag="iexpl") (node: xml_element_int): exp list =
571+
List.map self#get_exp
572+
(List.map int_of_string (String.split_on_char ',' (node#getAttribute tag)))
573+
566574
method read_xml_funarg_list
567575
?(tag="ifunargs") (node:xml_element_int):funarg list =
568576
self#get_funargs (node#getIntAttribute tag)

CodeHawk/CHC/cchlib/cCHLibTypes.mli

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,10 @@ class type cdictionary_int =
159159

160160
method write_xml_exp: ?tag:string -> xml_element_int -> exp -> unit
161161
method write_xml_exp_opt: ?tag:string -> xml_element_int -> exp option -> unit
162+
method write_xml_exp_list: ?tag:string -> xml_element_int -> exp list -> unit
162163
method read_xml_exp : ?tag:string -> xml_element_int -> exp
163164
method read_xml_exp_opt: ?tag:string -> xml_element_int -> exp option
165+
method read_xml_exp_list: ?tag:string -> xml_element_int -> exp list
164166

165167
method read_xml_funarg_list: ?tag:string -> xml_element_int -> funarg list
166168

0 commit comments

Comments
 (0)