Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit d5a6727

Browse files
committed
Remove unsupported line and paragraph separator
Bytes are represented as char under the hood; the diff's codepaths never worked! It couldn't have possibly detected those non-ascii letters in the first place
1 parent dc71166 commit d5a6727

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

src/res_character_codes.ml

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
let lineSeparator = Char.unsafe_chr 0x2028
2-
let paragraphSeparator = Char.unsafe_chr 0x2029
3-
41
let isUpperCase ch = 'A' <= ch && ch <= 'Z' [@@inline]
2+
53
let isLowerCase ch = 'a' <= ch && ch <= 'z' [@@inline]
64

75
let isDigit ch = '0' <= ch && ch <= '9' [@@inline]
@@ -12,23 +10,7 @@ let isHex = function
1210
| '0'..'9' | 'a'..'f' | 'A'..'F' -> true
1311
| _ -> false
1412

15-
(*
16-
// ES5 7.3:
17-
// The ECMAScript line terminator characters are listed in Table 3.
18-
// Table 3: Line Terminator Characters
19-
// Code Unit Value Name Formal Name
20-
// \u000A Line Feed <LF>
21-
// \u000D Carriage Return <CR>
22-
// \u2028 Line separator <LS>
23-
// \u2029 Paragraph separator <PS>
24-
// Only the characters in Table 3 are treated as line terminators. Other new line or line
25-
// breaking characters are treated as white space but not as line terminators.
26-
*)
27-
let isLineBreak ch =
28-
ch == '\n'
29-
|| ch == '\r'
30-
|| ch == lineSeparator
31-
|| ch == paragraphSeparator
13+
let isLineBreak ch = ch == '\n' || ch == '\r' [@@inline]
3214

3315
let digitValue ch =
3416
match ch with

0 commit comments

Comments
 (0)