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

Extensible and fast date parsing #20952

Merged
merged 12 commits into from
Mar 16, 2017
Prev Previous commit
Next Next commit
Switch to datatype_name
omus committed Mar 10, 2017
commit ad19d232116b6c3ab21fa2dde3a49540d7572d2f
2 changes: 1 addition & 1 deletion base/dates/parse.jl
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ function directives{S,F}(::Type{DateFormat{S,F}})
return tokens, directive_index, directive_letters
end

genvar(t::DataType) = Symbol(lowercase(string(t.name.name)))
genvar(t::DataType) = Symbol(lowercase(string(Base.datatype_name(t))))


@generated function tryparse_core(str::AbstractString, df::DateFormat, raise::Bool=false)
Copy link
Contributor

@shashi shashi Mar 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be great if this function can take a start index and return an end position... I've had to hack around this to get this. It's very useful when you're parsing dates and some more stuff after / a list of dates

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be supported.