diff options
| author | Maxime Dénès | 2017-10-06 12:45:33 +0200 |
|---|---|---|
| committer | Maxime Dénès | 2017-10-06 12:45:33 +0200 |
| commit | 3de25a6f91ec3cc5c9173ab7c93caee87cae578f (patch) | |
| tree | 31cf6d23bb35bef3b090a5ed66f21e9d1da2627b /lib/unicode.mli | |
| parent | ef11a1240c14560e199527ae6d8a6eb893da1438 (diff) | |
| parent | 40260a31cd197f655e6d3e0570a88d96fc1a9cac (diff) | |
Merge PR #1119: Fixing bug BZ#5769 (generating a name "_" out of a type "_something")
Diffstat (limited to 'lib/unicode.mli')
| -rw-r--r-- | lib/unicode.mli | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/unicode.mli b/lib/unicode.mli index b8e7c33ad4..32ffbb8e94 100644 --- a/lib/unicode.mli +++ b/lib/unicode.mli @@ -8,7 +8,7 @@ (** Unicode utilities *) -type status = Letter | IdentPart | Symbol | Unknown +type status (** Classify a unicode char into 3 classes or unknown. *) val classify : int -> status @@ -17,10 +17,23 @@ val classify : int -> status Return [Some (b,s)] otherwise, where [s] is an explanation and [b] is severity. *) val ident_refutation : string -> (bool * string) option +(** Tells if a valid initial character for an identifier *) +val is_valid_ident_initial : status -> bool + +(** Tells if a valid non-initial character for an identifier *) +val is_valid_ident_trailing : status -> bool + +(** Tells if a character is unclassified *) +val is_unknown : status -> bool + (** First char of a string, converted to lowercase @raise Assert_failure if the input string is empty. *) val lowercase_first_char : string -> string +(** Split a string supposed to be an ident at the first letter; + as an optimization, return None if the first character is a letter *) +val split_at_first_letter : string -> (string * string) option + (** Return [true] if all UTF-8 characters in the input string are just plain ASCII characters. Returns [false] otherwise. *) val is_basic_ascii : string -> bool |
