File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ export tokenize
16
16
@inline ishex (c:: Char ) = isdigit (c) || (' a' <= c <= ' f' ) || (' A' <= c <= ' F' )
17
17
@inline isbinary (c:: Char ) = c == ' 0' || c == ' 1'
18
18
@inline isoctal (c:: Char ) = ' 0' ≤ c ≤ ' 7'
19
- @inline iswhitespace (c:: Char ) = Base. isspace (c)
19
+ @inline iswhitespace (c:: Char ) = Base. isspace (c) || c === ' \u feff '
20
20
21
21
struct StringState
22
22
triplestr:: Bool
Original file line number Diff line number Diff line change 868
868
check_kw_hashes (String ([cs... ]) for cs in Iterators. product ([' a' :' z' for _ in 1 : len]. .. ))
869
869
end
870
870
end
871
+
872
+
873
+ @testset " UTF-8 BOM" begin
874
+ @test Tokenize. Tokens. kind .(collect (tokenize (" \u feff[1\u feff2]" ))) == [
875
+ Tokens. WHITESPACE,
876
+ Tokens. LSQUARE,
877
+ Tokens. INTEGER,
878
+ Tokens. WHITESPACE,
879
+ Tokens. INTEGER,
880
+ Tokens. RSQUARE,
881
+ Tokens. ENDMARKER
882
+ ]
883
+ end
You can’t perform that action at this time.
0 commit comments