Skip to content

YAML scanner fails on objects in lists #108

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

Closed
profmaad opened this issue Jan 18, 2013 · 4 comments
Closed

YAML scanner fails on objects in lists #108

profmaad opened this issue Jan 18, 2013 · 4 comments
Assignees
Milestone

Comments

@profmaad
Copy link

As seen in this ray: http://coderay.rubychan.de/rays/7788
the YAML scanner misinterprets the first key in an object stored in a list.

It interprets the entire first line (a: 1) as string/content, in every following line in the object, he correctly parses key: string/content.

@ghost ghost assigned korny Jan 18, 2013
@korny
Copy link
Member

korny commented Jan 20, 2013

It's true, the YAML parser is very stupid. It successfully highlights simple files, but when you start to combine maps, lists etc., it breaks down.

The problem is already documented in #84. Is it okay to close this as a duplicate?

@profmaad
Copy link
Author

Sure.
Is there any information when this might be fixed?

@korny
Copy link
Member

korny commented Jan 20, 2013

Actually, I'm not sure it's possible. YAML is a very complex format (and possibly insecure, see CVE-2013-0156), so I would not dare to parse it or use Ruby's YAML parser(s). The scanner needs to stay a lexical scanner, trying to mimic the understanding of YAML structure through heuristics. We should improve these heuristics, but we will not reach a quality where everything works.

It's great to start collecting example code that produces unacceptable results; this is most helpful at the moment.

@korny
Copy link
Member

korny commented Feb 17, 2013

Marked as duplicate, pending fix in #84.

@korny korny closed this as completed Feb 17, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants