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

only:scope or only:(scope scope) not working #9

Closed
gandm opened this issue Mar 5, 2016 · 2 comments
Closed

only:scope or only:(scope scope) not working #9

gandm opened this issue Mar 5, 2016 · 2 comments

Comments

@gandm
Copy link

gandm commented Mar 5, 2016

=scope works but only:scope doesn't. A modifier of only: is passed to the :matcherBuilder which thows an error Unknown modifier: only: at

throw Error(`Unknown modifier: ${modifier}`);

This is caught by
} catch (_e) {
which does nothing with it! No error is communicated to the user.

test file

// SYNTAX TEST "source.js.jsx"
/* this file contains all grammatical productions in ECMA-262 edition 5.1 ** * **/

// << =source.js.jsx
var a=2
//    ^ =(source.js.jsx constant.numeric.js)

// << only:source.js.jsx
var a=2
//    ^ only:(source.js.jsx constant.numeric.js)
@gandm
Copy link
Author

gandm commented Mar 5, 2016

Changing https://github.com/kevinastone/atom-grammar-test/blob/master/lib/grammar.pegjs#L34 to only = ("only:" / "=") { return "="; } fixes the returned modifier to be = but doesn't fix what to do with a valid thrown error,

@kevinastone
Copy link
Owner

Yeah, the no error to the user is an issue with this format since non-parsing comments are supposed to be ignored to allow other comments in the syntax test file 😐

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