From 0d1f9ff76aa6df3f17edd2d73c76ab444fec8528 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Mon, 2 Jan 2017 17:56:04 +0100 Subject: Corrected some issues with odf documents --- expression.ml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'expression.ml') diff --git a/expression.ml b/expression.ml index 1feb62e..155e1b9 100755 --- a/expression.ml +++ b/expression.ml @@ -6,6 +6,7 @@ let u = UTF8.from_utf8string type t = | Basic of ScTypes.types (** A direct type *) | Formula of formula (** A formula *) + | Undefined (** The content is not defined *) and formula = | Expression of ScTypes.expression (** A valid expression *) @@ -13,7 +14,7 @@ and formula = let is_defined = function - | Basic ScTypes.Undefined -> false + | Undefined -> false | _ -> true let load content = begin @@ -41,7 +42,7 @@ let load content = begin ) ) else ( (* If the string in empty, build an undefined value *) - Basic ScTypes.Undefined + Undefined ) end @@ -60,6 +61,7 @@ let eval expr sources = begin | Basic value -> ScTypes.Result value | Formula (Expression f) -> ScTypes.Result (eval_exp f) | Formula (Error (i, s)) -> ScTypes.Error ScTypes.Error + | Undefined -> ScTypes.Error Not_found with ex -> ScTypes.Error ex end @@ -91,6 +93,7 @@ let show e = ScTypes.show_expr buffer f | Basic b -> ScTypes.Type.show buffer b | Formula (Error (i,s)) -> UTF8.Buffer.add_string buffer s + | Undefined -> () end; UTF8.Buffer.contents buffer -- cgit v1.2.3