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

Parser error improvements #46

Merged
merged 2 commits into from
Aug 4, 2014
Merged

Parser error improvements #46

merged 2 commits into from
Aug 4, 2014

Conversation

jgoz
Copy link
Contributor

@jgoz jgoz commented Aug 1, 2014

This makes the following changes to parser errors:

1. Message format

Switch to a gnu-style format for parser error messages.*

filename:lineno:column: message

This makes it easier to diagnose the location of an error when multiple CSS files are being parsed in a build chain. There are also terminals and other tools that can parse messages formatted this way and jump to the location of the error in a text editor/IDE.

* Note: if there's a different format that you would prefer that also includes the filename, I'd be happy to change it. I picked this format because it's fairly common.

2. Capture "reason"

Add the raw error message generated by the parser without filename/line/column, stored as reason on the Error object. This will make it easier to reformat parser error messages by consuming applications, if desired.

John Gozde added 2 commits August 1, 2014 15:20
-> `filename:line:column: reason`
Allows users to more easily reformat error messages.
@conradz
Copy link
Contributor

conradz commented Aug 4, 2014

I'm 👍 on this, @necolas any opinion?

@necolas
Copy link
Contributor

necolas commented Aug 4, 2014

sgtm too

conradz added a commit that referenced this pull request Aug 4, 2014
Parser error improvements
@conradz conradz merged commit 118e12f into reworkcss:master Aug 4, 2014
@jgoz
Copy link
Contributor Author

jgoz commented Aug 4, 2014

Thanks @conradz, @necolas

@conradz conradz mentioned this pull request Aug 4, 2014
8 tasks
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

Successfully merging this pull request may close these issues.

None yet

3 participants