summaryrefslogtreecommitdiffstats
path: root/perl_checker.src/common.ml
diff options
context:
space:
mode:
Diffstat (limited to 'perl_checker.src/common.ml')
-rw-r--r--perl_checker.src/common.ml4
1 files changed, 4 insertions, 0 deletions
diff --git a/perl_checker.src/common.ml b/perl_checker.src/common.ml
index a4d0789..07e138e 100644
--- a/perl_checker.src/common.ml
+++ b/perl_checker.src/common.ml
@@ -715,6 +715,10 @@ let char_is_alpha c =
Char.code 'a' <= i && i <= Char.code 'z' ||
Char.code 'A' <= i && i <= Char.code 'Z'
+let char_is_number c =
+ let i = Char.code c in
+ Char.code '0' <= i && i <= Char.code '9'
+
let rec string_forall_with f i s =
try
f s.[i] && string_forall_with f (i+1) s