Skip to content

Commit

Permalink
flambda-backend: Fix valid character range computation for compilatio…
Browse files Browse the repository at this point in the history
…n units (#1110)
  • Loading branch information
lthls authored Feb 9, 2023
1 parent 40c754a commit 7c9fc32
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions utils/compilation_unit.ml
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,10 @@ end = struct
end)

let is_valid_character first_char c =
let code = Char.code c in
if first_char
then code >= 65 && code <= 90 (* [A-Z] *)
else
Char.equal c '_'
|| (code >= 48 && 57 <= 90 (* [0-9] *))
|| (code >= 65 && code <= 90 (* [A-Z] *))
|| (code >= 97 && code <= 122 (* [a-z] *))
match c with
| 'A' .. 'Z' -> true
| '_' | '0' .. '9' | 'a' .. 'z' -> not first_char
| _ -> false

let parse_for_pack pack =
let prefix = String.split_on_char '.' pack in
Expand Down

0 comments on commit 7c9fc32

Please sign in to comment.