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

{ } block split over several lines #30

Open
interlab opened this issue Nov 27, 2013 · 4 comments
Open

{ } block split over several lines #30

interlab opened this issue Nov 27, 2013 · 4 comments

Comments

@interlab
Copy link

sorry my english 👻

  1. there shall be an error

example:

text: {
    test1: 123
    test2: 456
    test3: 789
}

out:
array ( 'text' => array ( 'test1' => 123, 'test2' => 456, 'test3' => 789, ), 0 => '}', )

it was expected:
error


  1. error

example:

text: {
    test1: 123,
    test2: 456,
    test3: 789
}

out:
array ( 'text' => array ( 'test1' => '123,', 'test2' => '456,', 'test3' => 789, ), 0 => '}', )

it was expected:
array ( 'text' => array ( 'test1' => 123, 'test3' => 789, 'test2' => 456, ), )

@ryanuber
Copy link
Contributor

This is probably because currently Spyc is mostly line-driven. If you load the inline block as a single line, seems to work fine, accounting for the { and } characters as well as the , delimiter between elements. The problem comes in when a block using { and } is split across multiple lines. It seems like Spyc then uses its traditional YAML format parser, hence the mistakes. I started working on a fix but quickly realized that the problem is larger than I initially thought.

The YAML syntax in question has been supported by the spec since YAML 1.0, so we really should fix this. I'll take another stab at it at some point if no one else jumps on it.

@interlab
Copy link
Author

in the symphony I noted a similar problem

@mustangostang mustangostang changed the title bad results { } block split over several lines Mar 30, 2014
@ossobuffo
Copy link

@ryanuber: Any progress on this? Just got bitten by this today.

@ryanuber
Copy link
Contributor

@ossobuffo I honestly have not done anything related to this project in some years now, sorry! Maybe @mustangostang has some ideas?

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

3 participants