diff options
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
|