diff options
author | Sébastien Dailly <sebastien@chimrod.com> | 2017-01-02 17:56:04 +0100 |
---|---|---|
committer | Sébastien Dailly <sebastien@chimrod.com> | 2017-01-10 14:35:04 +0100 |
commit | 0d1f9ff76aa6df3f17edd2d73c76ab444fec8528 (patch) | |
tree | e6a628b78a08beb7fd9912c3f4b9bbdcee59c3c4 /expression.ml | |
parent | 444c0baa87b6edfb21c002bf9e079e10509ee0e9 (diff) |
Corrected some issues with odf documents
Diffstat (limited to 'expression.ml')
-rwxr-xr-x | expression.ml | 7 |
1 files changed, 5 insertions, 2 deletions
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
|