Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix a few lurking bugs detected by JET #190

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Parsers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ _startswith(s::Char, prefix::Union{String,Char}) = ncodeunits(s) >= ncodeunits(p
_startswith(s::String, prefix::Union{Char,String,Regex}) = startswith(s, prefix)
_startswith(s::String, prefix::UInt8) = startswith(s, Char(prefix))
_startswith(s::Char, prefix::Regex) = startswith(string(s), prefix)
_startswith(s::UInt8, prefix::Regex) = startswith(Char(s), prefix)
_startswith(s::UInt8, prefix::Regex) = startswith(string(Char(s)), prefix)
_startswith(s::UInt8, prefix::UInt8) = s == prefix
_startswith(s::Char, prefix::UInt8) = first(codeunits(s)) == prefix
_startswith(s::Char, prefix::UInt8) = codepoint(s) == prefix
_startswith(a::Nothing, b) = false
_startswith(a, b::Nothing) = false
_startswith(a::Nothing, b::Nothing) = false
Expand Down Expand Up @@ -306,7 +306,7 @@ function token(x::MaybeToken, arg)
asciival(x) || throw(ArgumentError("$arg argument must be ASCII"))
return Token(x)
elseif x isa Char
return Token(asciival(x) ? UInt8(x) : String(x))
return Token(asciival(x) ? UInt8(x) : string(x))
elseif x isa Regex
return Token(mkregex(x))
else
Expand Down
Loading