Skip to content

cannot parse edtf dates prior to 1000AD #35

@ppanero

Description

@ppanero

Even if the use of datetime was removed in favor of time_struct as mentioned here: #26

When parsing dates (both with the default parse_edtf or even by only using level0Expression the parsing is limited to 1000AD +. For example:

parse_edtf("576")
[...]
3...) W:(0123...) W:(0123...)} ^ {W:(0123...) "u" W:(0123...) W:(0123...)} ^ {W:(0123...) W:(0123...) "u" W:(0123...)} ^ {W:(0123...) W:(0123...) W:(0123...) "u"}}) "-" Combine:({01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 ^ Combine:({0u | 1u ^ {"u" W:(0123...)}})}) "-" Combine:({01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 ^ Combine:({{"u" W:(0123...)} ^ {W:(0123...) "u"}})})} ^ {Combine:({W:(0123...) ^ {~{"-0000"} "-" W:(0123...)}}) "-" Combine:({0u | 1u ^ {"u" W:(0123...)}}) "-" Combine:({01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 ^ Combine:({{"u" W:(0123...)} ^ {W:(0123...) "u"}})})} ^ {Combine:({W:(0123...) ^ {~{"-0000"} "-" W:(0123...)}}) "-" 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 "-" Combine:({{"u" W:(0123...)} ^ {W:(0123...) "u"}})}}}}} ^ {"y" Combine:({["-"] Combine:({W:(1234...) [W:(0123...)]...})}) "e" Combine:({W:(1234...) [W:(0123...)]...}) [{"p" Combine:({W:(1234...) [W:(0123...)]...})}]} ^ {{Combine:({W:(0123...) ^ {~{"-0000"} "-" W:(0123...)}}) "-" 21 | 22 | 23 | 24} "^" Re:('\\S')}}}, found end of text  (at char 3), (line:1, col:4)

The stack trace is humongous, therefore I'm not pasting it here. The bottom line (as far as I can tell) is because of the use of Combine. I'm debugging a bit more to try to figure out why and I'm happy to contribute with a fix. But I'd appreciate any help on further investigation :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions