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

Implement Type parsing #6

Merged
merged 28 commits into from
Nov 15, 2021
Merged

Implement Type parsing #6

merged 28 commits into from
Nov 15, 2021

Conversation

danini-the-panini
Copy link
Owner

@danini-the-panini danini-the-panini commented Oct 22, 2021

https://github.com/kdl-org/kdl/blob/main/SPEC.md#type-annotation

  • date-time: ISO8601 date/time format.
  • time: "Time" section of ISO8601.
  • date: "Date" section of ISO8601.
  • duration: ISO8601 duration format.
  • decimal: IEEE 754-2008 decimal string format.
  • currency: ISO 4217 currency code.
  • country-2: ISO 3166-1 alpha-2 country code.
  • country-3: ISO 3166-1 alpha-3 country code.
  • country-subdivision: ISO 3166-2 country subdivision code.
  • email: RFC5302 email address.
  • idn-email: RFC6531 internationalized email address.
  • hostname: RFC1132 internet hostname.
  • idn-hostname: RFC5890 internationalized internet hostname.
  • ipv4: RFC2673 dotted-quad IPv4 address.
  • ipv6: RFC2373 IPv6 address.
  • url: RFC3986 URI.
  • url-reference: RFC3986 URI Reference.
  • irl: RFC3987 Internationalized Resource Identifier.
  • irl-reference: RFC3987 Internationalized Resource Identifier Reference.
  • url-template: RFC6570 URI Template.
  • uuid: RFC4122 UUID.
  • regex: Regular expression. Specific patterns may be implementation-dependent.
  • base64: A Base64-encoded string, denoting arbitrary binary data.

Also adds support for passing in a hash of type → proc to a type_parsers options, allowing a user to provide custom implementations.
Also allows disabling of type parsing altogether by passing the parse_types: false option.

@danini-the-panini danini-the-panini merged commit 4a03dbb into main Nov 15, 2021
@danini-the-panini danini-the-panini deleted the ds-parse-types branch November 15, 2021 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant