Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Add support for newlines in selectors #23

Closed
subtleGradient opened this issue Aug 6, 2014 · 2 comments
Closed

Add support for newlines in selectors #23

subtleGradient opened this issue Aug 6, 2014 · 2 comments
Labels

Comments

@subtleGradient
Copy link

https://github.com/subtleGradient/SubtleGradient-Themes.tmbundle/blob/master/Themes/Brilliance%20White.tmTheme#L671-L674

○ → node --harmony_collections $HOME/Downloads/Atom.app/Contents/Resources/app/apm/node_modules/atom-package-manager/lib/cli.js  init --theme "$HOME/.atom/packages/SubtleGradient-Themes-tmbundle-Themes-Brilliance-White-tmTheme" --convert "$PWD/SubtleGradient Themes.tmbundle/Themes/Brilliance White.tmTheme"
Expected "(", "-", [ \t], [*], [LRB], [a-zA-Z0-9+_] or end of input but "\n" found.
ashleygwilliams pushed a commit to ashleygwilliams/first-mate that referenced this issue Nov 23, 2015
Update include-path for atom-dark-syntax
@Ingramz
Copy link
Contributor

Ingramz commented May 10, 2017

Out of interest I took a look at this. The error is actually somewhat correct or should point out that you have a mistake there.

The scope selector component in TextMate processes this "scope" you highlighted exactly as if it were meta.group.braces.round punctuation.section.scope, . This is the first line of the string without end of line character. The parsing component found an unknown character - in this case \n and stopped parsing the scope. Because semantically the parsing ended at comma, only the alternatives preceding that comma are considered in TextMate, in this case just the first one.

So all this time, the way TextMate has processed that specific scope has been meta.group.braces.round punctuation.section.scope, without considering any of the other alternatives. TextMate has never actually supported newlines in this case. Getting rid of newlines from scopes in plist should fix that for you.

Should Atom or first-mate silently fail in such cases? I do not think so, as it causes confusion. Probably finding a way to point user to documentation, which explains how to properly form scope selectors, would be the best way to tackle parse errors.

@winstliu
Copy link
Contributor

Closing as wontfix. I agree with @Ingramz here.

And on that note, we seriously need to finish the grammar documentation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants