Commit 7b0dc59e authored by Julien Lopez's avatar Julien Lopez
Browse files

Compilation fixes

parent e69199a0
...@@ -77,5 +77,5 @@ type code_item = ...@@ -77,5 +77,5 @@ type code_item =
type code = code_item list type code = code_item list
module Print : sig module Print : sig
val lambda_to_string : Lambda.expr -> string val lambda_to_string : expr -> string
end end
...@@ -352,7 +352,7 @@ let rec pp_value ppf = function ...@@ -352,7 +352,7 @@ let rec pp_value ppf = function
| XmlNs(_,_,_,_,sigma) -> Format.fprintf ppf "XmlNs(%a)" pp_sigma sigma | XmlNs(_,_,_,_,sigma) -> Format.fprintf ppf "XmlNs(%a)" pp_sigma sigma
| Record(_,sigma) -> Format.fprintf ppf "Record(%a)" pp_sigma sigma | Record(_,sigma) -> Format.fprintf ppf "Record(%a)" pp_sigma sigma
| Atom(a) -> Format.fprintf ppf "Atom(%a)" Atoms.V.print a | Atom(a) -> Format.fprintf ppf "Atom(%a)" Atoms.V.print a
| Integer(i) -> Format.fprintf ppf "%d" (Big_int.int_of_big_int i) | Integer(i) -> Format.fprintf ppf "%d" (Intervals.V.get_int i)
| Char(i) -> Format.fprintf ppf "'%c'" (Chars.V.to_char i) | Char(i) -> Format.fprintf ppf "'%c'" (Chars.V.to_char i)
| Abstraction(None, _, sigma) -> | Abstraction(None, _, sigma) ->
Format.fprintf ppf "Abstraction(None,%a)" pp_sigma sigma Format.fprintf ppf "Abstraction(None,%a)" pp_sigma sigma
...@@ -362,7 +362,7 @@ let rec pp_value ppf = function ...@@ -362,7 +362,7 @@ let rec pp_value ppf = function
pp_sigma sigma pp_sigma sigma
| Abstract((name, _)) -> Format.fprintf ppf "Abstract(%s)" name | Abstract((name, _)) -> Format.fprintf ppf "Abstract(%s)" name
| String_latin1(_,_,s,_) -> Format.fprintf ppf "\"%s\"" s | String_latin1(_,_,s,_) -> Format.fprintf ppf "\"%s\"" s
| String_utf8(_,_,s,_) -> Format.fprintf ppf "\"%s\"" s | String_utf8(_,_,s,_) -> Format.fprintf ppf "\"%s\"" (Encodings.Utf8.get_str s)
| Concat(v1, v2) -> | Concat(v1, v2) ->
Format.fprintf ppf "Concat(%a, %a)" Format.fprintf ppf "Concat(%a, %a)"
pp_value v1 pp_value v1
......
...@@ -80,6 +80,28 @@ let print_node ppf n = ...@@ -80,6 +80,28 @@ let print_node ppf n =
to_print := n :: !to_print; to_print := n :: !to_print;
dump_print ppf dump_print ppf
let print_lst f ppf l =
let rec aux ppf = function
|[] -> Format.fprintf ppf "@."
|[h] -> Format.fprintf ppf "%a" f h
|h::t -> Format.fprintf ppf "%a,%a" f h aux t
in
match l with
|[] -> Format.fprintf ppf ""
|_ -> Format.fprintf ppf "%a" aux l
let pp_v ppf (id, name) =
Format.fprintf ppf "(%d,%s)" (Upool.int id) (Encodings.Utf8.to_string name)
let pp_fv ppf fv = print_lst pp_v ppf fv
let pp_node ppf node =
Format.fprintf ppf "id:%d; descr:[%a]; accept:[id:%d; descr:%a]; fv:[%a]"
node.id
print node.descr
(Types.id node.accept)
Types.Print.print (Types.descr node.accept)
pp_fv node.fv
let counter = ref 0 let counter = ref 0
......
...@@ -25,6 +25,9 @@ val id: node -> int ...@@ -25,6 +25,9 @@ val id: node -> int
val descr: node -> descr val descr: node -> descr
val fv : node -> fv val fv : node -> fv
(* For debugging *)
val pp_node : Format.formatter -> node -> unit
(* Pretty-printing *) (* Pretty-printing *)
module Print : sig module Print : sig
......
...@@ -2453,7 +2453,7 @@ struct ...@@ -2453,7 +2453,7 @@ struct
and decompose_rec any make dnf acc = and decompose_rec any make dnf acc =
decompose_kind any (fun bdd -> decompose_kind any (fun bdd ->
cup (decompose_dnf (ty any) (fun (b, l) -> cup (decompose_dnf (ty any) (fun (b, l) ->
make b (format_rec b [] l)) (Rec.get bdd) [])) dnf acc make b (format_rec b [] (LabelMap.get l))) (Rec.get bdd) [])) dnf acc
and decompose_type t = and decompose_type t =
try try
DescrHash.find memo t DescrHash.find memo t
......
...@@ -200,20 +200,12 @@ module Print = struct ...@@ -200,20 +200,12 @@ module Print = struct
br.br_ghost br.br_ghost
Var.Set.print br.br_vars_poly Var.Set.print br.br_vars_poly
pp_fv br.br_vars_empty pp_fv br.br_vars_empty
pp_node br.br_pat Patterns.pp_node br.br_pat
Types.Print.print br.br_body.exp_typ Types.Print.print br.br_body.exp_typ
pp_typed br.br_body pp_typed br.br_body
in in
print_lst f ppf brs print_lst f ppf brs
and pp_node ppf node =
Format.fprintf ppf "id:%d; descr:[%a]; accept:[id:%d; descr:%a]; fv:[%a]"
node.Patterns.id
Patterns.print node.Patterns.descr
(Types.id node.Patterns.accept)
Types.Print.print (Types.descr node.Patterns.accept)
pp_fv node.Patterns.fv
and pp_v ppf (id, name) = and pp_v ppf (id, name) =
Format.fprintf ppf "(%d,%s)" (Upool.int id) (Encodings.Utf8.to_string name) Format.fprintf ppf "(%d,%s)" (Upool.int id) (Encodings.Utf8.to_string name)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment