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

whitespaces between two commas #39

Closed
jangko opened this issue May 21, 2017 · 1 comment
Closed

whitespaces between two commas #39

jangko opened this issue May 21, 2017 · 1 comment

Comments

@jangko
Copy link

jangko commented May 21, 2017

this is the yaml script

scenes:
  - 
    duration: 9
    label:
      - {text: "...", position: {x:201, y:241} } 
      - {text: "...", position: {x:268, y:202} }
      - {text: "...", , position: {x:278, y:151} }
      - {text: "...", position: {x:348, y:111} }

this is the Nim code

import yaml/[parser, stream], streams

proc main() =
  var s = newFileStream("bug.yml")
  var p = newYamlParser()
  var ev = p.parse(s)
  
  try:
    for x in ev:
      echo x.kind
  except YamlStreamError as err:
    echo err.msg

main()

and this is the result:

...
[NimYAML] Error in file C:\Users\Jangko\.nimble\pkgs\yaml-0.9.1\yaml\parser.nim at line 845:
assertion failed!
[NimYAML] Stacktrace:
Traceback (most recent call last)
test.nim(14)             test
test.nim(10)             main
stream.nim(208)          finished
internal.nim(26)         stateFlow
[NimYAML] Please report this bug.

Is this really a bug?, I think I just put something wrong in the yaml script. Perhaps an alternate error message is better.

Btw, your yaml library is awesome

@flyx
Copy link
Owner

flyx commented May 21, 2017

Well this is invalid YAML, but the parser does not properly handle it, therefore it is indeed a bug. It should not run into a failed assertion, but raise a proper parser error instead.

@flyx flyx closed this as completed in 45321ca Nov 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants