diff options
author | Son Ho | 2021-11-18 16:03:04 +0100 |
---|---|---|
committer | Son Ho | 2021-11-18 16:03:04 +0100 |
commit | e4c3e2db8c3f83dac1b5eae3086e6488720f6b17 (patch) | |
tree | aec0ed2f350468f73ee4cf31cd2c4c75fde5e5bd | |
parent | d79f58d32e141c4441e9393119eecd37eb4c690a (diff) |
Add an Errors.ml file
Diffstat (limited to '')
-rw-r--r-- | src/Errors.ml | 5 | ||||
-rw-r--r-- | src/Identifiers.ml | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/Errors.ml b/src/Errors.ml new file mode 100644 index 00000000..dcdc9102 --- /dev/null +++ b/src/Errors.ml @@ -0,0 +1,5 @@ +exception IntegerOverflow of unit + +exception Unimplemented of string + +let unimplemented msg = raise (Unimplemented ("unimplemented: " ^ msg)) diff --git a/src/Identifiers.ml b/src/Identifiers.ml index 7d440f4d..07d9c8a5 100644 --- a/src/Identifiers.ml +++ b/src/Identifiers.ml @@ -1,5 +1,3 @@ -exception IntegerOverflow of unit - (** Signature for a module describing an identifier. We often need identifiers (for definitions, variables, etc.) and in @@ -45,7 +43,7 @@ module IdGen () : Id = struct (* Identifiers should never overflow (because max_int is a really big * value - but we really want to make sure we detect overflows if * they happen *) - if x == max_int then raise (IntegerOverflow ()) else x + 1 + if x == max_int then raise (Errors.IntegerOverflow ()) else x + 1 let to_string = string_of_int |