aboutsummaryrefslogtreecommitdiff
path: root/lib/unicode.mli
diff options
context:
space:
mode:
authorHugo Herbelin2017-10-04 22:00:19 +0200
committerHugo Herbelin2017-10-05 08:36:50 +0200
commit526791d917f9b0804376eae02a462a3b32dd7cba (patch)
treed9ad17bf4c1e287627acc3183bdbabf88b49438c /lib/unicode.mli
parent9a2bb3a6d12a082c61dfda62be53c195fe3cb57c (diff)
Distinguishing pseudo-letters out of the set of unicode letters.
This includes _ and insecable space which can be used in idents and this allows more precise heuristics.
Diffstat (limited to 'lib/unicode.mli')
-rw-r--r--lib/unicode.mli11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/unicode.mli b/lib/unicode.mli
index c7d7424801..a608d5f026 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,6 +17,15 @@ 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