diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/util.ml | 10 | ||||
| -rw-r--r-- | lib/util.mli | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/util.ml b/lib/util.ml index 3a012acbb3..85ff2cbc48 100644 --- a/lib/util.ml +++ b/lib/util.ml @@ -283,14 +283,14 @@ let initial_refutation j n s = | UnicodeLetter -> None | _ -> let c = String.sub s 0 j in - Some ("Invalid character '"^c^"' at beginning of identifier \""^s^"\".") + Some (false,"Invalid character '"^c^"' at beginning of identifier \""^s^"\".") let trailing_refutation i j n s = match classify_unicode n with | UnicodeLetter | UnicodeIdentPart -> None | _ -> let c = String.sub s i j in - Some ("Invalid character '"^c^"' in identifier \""^s^"\".") + Some (false,"Invalid character '"^c^"' in identifier \""^s^"\".") let ident_refutation s = if s = ".." then None else try @@ -308,9 +308,9 @@ let ident_refutation s = end |x -> x with - | End_of_input -> Some "The empty string is not an identifier." - | UnsupportedUtf8 -> Some (s^": unsupported character in utf8 sequence.") - | Invalid_argument _ -> Some (s^": invalid utf8 sequence.") + | End_of_input -> Some (true,"The empty string is not an identifier.") + | UnsupportedUtf8 -> Some (true,s^": unsupported character in utf8 sequence.") + | Invalid_argument _ -> Some (true,s^": invalid utf8 sequence.") let lowercase_unicode = let tree = Segmenttree.make Unicodetable.to_lower in diff --git a/lib/util.mli b/lib/util.mli index 380f58eaba..d985518235 100644 --- a/lib/util.mli +++ b/lib/util.mli @@ -61,7 +61,7 @@ type utf8_status = UnicodeLetter | UnicodeIdentPart | UnicodeSymbol exception UnsupportedUtf8 -val ident_refutation : string -> string option +val ident_refutation : string -> (bool * string) option val classify_unicode : int -> utf8_status val lowercase_first_char_utf8 : string -> string val ascii_of_ident : string -> string |
