Skip to content

Commit a58d2b4

Browse files
committed
Handle issue with % for v1.0
1 parent 7e9786e commit a58d2b4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/unicode.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ _cat_mask(a) = UInt(a)
5252
@inline _cat_mask(rng::(@static V6_COMPAT ? Range : AbstractRange)) =
5353
((UInt(2) << (rng.stop%UInt)) - UInt(1)) & ~((UInt(1) << (rng.start%UInt)) - UInt(1))
5454

55-
@inline _check_mask(ch, mask) = ((UInt(1) << category_code(ch)%UInt) & mask) != 0
55+
@inline _check_mask(ch, mask) = ((UInt(1) << (category_code(ch)%UInt)) & mask) != 0
5656

5757
## libc character class predicates ##
5858

@@ -61,8 +61,8 @@ _cat_mask(a) = UInt(a)
6161
@inline _can_upper(c) = _islower_a(c) | _can_upper_l(c)
6262

6363
@inline _iscntrl(ch) = (ch <= 0x1f) | (0x7f <= ch <= 0x9f)
64-
@inline _isdigit(ch) = (ch - '0'%UInt8) <= 9
65-
@inline _isxdigit(ch) = _isdigit(ch) | (ch - 'A'%UInt8 < 6) | (ch - 'a'%UInt8 < 6)
64+
@inline _isdigit(ch) = (ch - ('0'%UInt8)) <= 9
65+
@inline _isxdigit(ch) = _isdigit(ch) | (ch - ('A'%UInt8) < 6) | (ch - ('a'%UInt8) < 6)
6666

6767
const _isupper_mask = _cat_mask(Uni.Lu, Uni.Lt)
6868
const _isalpha_mask = _cat_mask(Uni.Lu : Uni.Lo)

0 commit comments

Comments
 (0)