Skip to content

Commit

Permalink
Format files using DocumentFormat
Browse files Browse the repository at this point in the history
  • Loading branch information
davidanthoff authored Aug 11, 2021
1 parent ced8d24 commit eb0f302
Show file tree
Hide file tree
Showing 10 changed files with 274 additions and 275 deletions.
16 changes: 8 additions & 8 deletions benchmark/benchmarks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ datetimestr = "1970-02-02 02:20:20"
datetimestrlen = our_lastindex(datetimestr)

SUITE["util"]["tryparsenext"] = BenchmarkGroup()
SUITE["util"]["tryparsenext"]["NumericFloat64"] = @benchmarkable TextParse.tryparsenext($(TextParse.Numeric(Float64)), $float64str,1,$float64strlen)
SUITE["util"]["tryparsenext"]["LongNumericFloat64"] = @benchmarkable TextParse.tryparsenext($(TextParse.Numeric(Float64)), $longfloat64str,1,$longfloat64strlen)
SUITE["util"]["tryparsenext"]["UInt64"] = @benchmarkable TextParse.tryparsenext($(TextParse.Numeric(UInt64)), $intstr,1,$intstrlen)
SUITE["util"]["tryparsenext"]["NegInt64"] = @benchmarkable TextParse.tryparsenext($(TextParse.Numeric(Int64)), $negintstr,1,$negintstrlen)
SUITE["util"]["tryparsenext"]["Percentage"] = @benchmarkable TextParse.tryparsenext($(TextParse.Percentage()), $percentagestring,1,$percentagestringlen, TextParse.default_opts)
SUITE["util"]["tryparsenext"]["StringToken"] = @benchmarkable TextParse.tryparsenext($(TextParse.StringToken(String)), $somestring,1,$somestringlen, TextParse.default_opts)
SUITE["util"]["tryparsenext"]["DateTimeToken"] = @benchmarkable TextParse.tryparsenext($tok, $datetimestr,1,$datetimestrlen, $opts)
SUITE["util"]["tryparsenext"]["QuotedStringToken"] = @benchmarkable TextParse.tryparsenext($(Quoted(String,quotechar='"', escapechar='"')), $somequotedstring)
SUITE["util"]["tryparsenext"]["NumericFloat64"] = @benchmarkable TextParse.tryparsenext($(TextParse.Numeric(Float64)), $float64str, 1, $float64strlen)
SUITE["util"]["tryparsenext"]["LongNumericFloat64"] = @benchmarkable TextParse.tryparsenext($(TextParse.Numeric(Float64)), $longfloat64str, 1, $longfloat64strlen)
SUITE["util"]["tryparsenext"]["UInt64"] = @benchmarkable TextParse.tryparsenext($(TextParse.Numeric(UInt64)), $intstr, 1, $intstrlen)
SUITE["util"]["tryparsenext"]["NegInt64"] = @benchmarkable TextParse.tryparsenext($(TextParse.Numeric(Int64)), $negintstr, 1, $negintstrlen)
SUITE["util"]["tryparsenext"]["Percentage"] = @benchmarkable TextParse.tryparsenext($(TextParse.Percentage()), $percentagestring, 1, $percentagestringlen, TextParse.default_opts)
SUITE["util"]["tryparsenext"]["StringToken"] = @benchmarkable TextParse.tryparsenext($(TextParse.StringToken(String)), $somestring, 1, $somestringlen, TextParse.default_opts)
SUITE["util"]["tryparsenext"]["DateTimeToken"] = @benchmarkable TextParse.tryparsenext($tok, $datetimestr, 1, $datetimestrlen, $opts)
SUITE["util"]["tryparsenext"]["QuotedStringToken"] = @benchmarkable TextParse.tryparsenext($(Quoted(String, quotechar='"', escapechar='"')), $somequotedstring)

somefieldstring = " 12,3"
f = TextParse.fromtype(Int)
Expand Down
10 changes: 5 additions & 5 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using Documenter, TextParse

makedocs(
modules = [TextParse],
sitename = "TextParse.jl",
authors = "Shashi Gowda",
pages = Any["Home" => "index.md"],
modules=[TextParse],
sitename="TextParse.jl",
authors="Shashi Gowda",
pages=Any["Home" => "index.md"],
)

deploydocs(
repo = "github.com/JuliaComputing/TextParse.jl.git"
repo="github.com/JuliaComputing/TextParse.jl.git"
)
4 changes: 2 additions & 2 deletions src/VectorBackedStrings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Base.@propagate_inbounds function Base.iterate(s::VectorBackedUTF8String, i::Int
i > ncodeunits(s) && return nothing
b = codeunit(s, i)
u = UInt32(b) << 24
Base.between(b, 0x80, 0xf7) || return reinterpret(Char, u), i+1
Base.between(b, 0x80, 0xf7) || return reinterpret(Char, u), i + 1
return our_next_continued(s, i, u)
end

Expand All @@ -58,7 +58,7 @@ function our_next_continued(s::VectorBackedUTF8String, i::Int, u::UInt32)
@inbounds b = codeunit(s, i)
b & 0xc0 == 0x80 || @goto ret
u |= UInt32(b); i += 1
@label ret
@label ret
return reinterpret(Char, u), i
end

Expand Down
Loading

0 comments on commit eb0f302

Please sign in to comment.