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

Issue Parsing Positive Time Zone Offset (+07:00) in @std/toml #6187

Closed
immccn123 opened this issue Nov 14, 2024 · 0 comments · Fixed by #6188
Closed

Issue Parsing Positive Time Zone Offset (+07:00) in @std/toml #6187

immccn123 opened this issue Nov 14, 2024 · 0 comments · Fixed by #6188
Labels
bug Something isn't working needs triage

Comments

@immccn123
Copy link

Describe the bug

Date strings like 1979-05-27T00:32:00+07:00 is not parsed.

According to the TOML Spec, RFC 3339 formatted date-time with offset should be parsed.

Steps to Reproduce

import * as toml from "@std/toml";

toml.parse("time = 1979-05-27T00:32:00-07:00") // ok
toml.parse("time = 1979-05-27T00:32:00+07:00") // not ok
//                                    ^

Then

error: Uncaught (in promise) SyntaxError: Parse error on line 1, column 26: Unexpected character: "+"
      throw new SyntaxError(message);
            ^
    at https://jsr.io/@std/toml/1.0.1/_parser.ts:801:13
    at Module.parse (https://jsr.io/@std/toml/1.0.1/parse.ts:26:24)
    at index.ts:4:6

Expected behavior

Both negative and positive time zone offsets (-07:00 and +07:00) should be parsed correctly.

Environment

  • OS: Ubuntu 20.04
  • deno version: 1.43.6
  • std version: jsr:@std/toml@^1.0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant