We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d7b2c20 commit 0e12d3dCopy full SHA for 0e12d3d
ocaml/utils/compilation_unit.ml
@@ -138,14 +138,10 @@ end = struct
138
end)
139
140
let is_valid_character first_char c =
141
- let code = Char.code c in
142
- if first_char
143
- then code >= 65 && code <= 90 (* [A-Z] *)
144
- else
145
- Char.equal c '_'
146
- || (code >= 48 && 57 <= 90 (* [0-9] *))
147
- || (code >= 65 && code <= 90 (* [A-Z] *))
148
- || (code >= 97 && code <= 122 (* [a-z] *))
+ match c with
+ | 'A' .. 'Z' -> true
+ | '_' | '0' .. '9' | 'a' .. 'z' -> not first_char
+ | _ -> false
149
150
let parse_for_pack pack =
151
let prefix = String.split_on_char '.' pack in
0 commit comments