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

Different behaviour for : and = in strings #27

Closed
hason opened this issue Mar 3, 2016 · 7 comments
Closed

Different behaviour for : and = in strings #27

hason opened this issue Mar 3, 2016 · 7 comments

Comments

@hason
Copy link

hason commented Mar 3, 2016

name: d:g

is fine, but

name: d=g # name= d=g

throws Error: Unexpected '=' on line 1, column 8.

@dg
Copy link
Member

dg commented Mar 9, 2016

After the colon must be a space but after the = may not be (compatiblity with INI). This behavior can be changed, but it is a big BC break.

@Majkl578
Copy link

Majkl578 commented Mar 9, 2016

Neon is officially compatible with INI?

@dg
Copy link
Member

dg commented Mar 9, 2016

No.

@hason
Copy link
Author

hason commented Mar 9, 2016

In YAML it is possible to write

foo: foo: bar # same as foo: "foo: bar"

Why not in NEON?

I would like to write:

foo: foo=bar

without quotations.

@dg
Copy link
Member

dg commented Mar 9, 2016

Why not in NEON?

So far no one needed it, probably it is not useful in practice.

I would like to write without quotations

It is currently little bit problematic, because = is the same as :. So it is possible to support foo: foo: bar xor foo: foo=bar.

@Majkl578
Copy link

In YAML it is possible to write

foo: foo: bar

No, it is not, it is illegal syntax. I.e. Symfony Yaml component fails with this error: Uncaught Symfony\Component\Yaml\Exception\ParseException: A colon cannot be used in an unquoted mapping value at line 1 (near "foo: foo: bar").
Forbidden by YAML 1.2 specification: http://yaml.org/spec/1.2/spec.html#id2788859

@hason
Copy link
Author

hason commented Mar 10, 2016

It was possible in Symfony 2. And yes, it is illegal. So I have solved a problem with =: https://github.com/symfonette/neon-integration#expression

@hason hason closed this as completed Mar 10, 2016
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