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

parse error - @charset #7

Open
shin820 opened this issue Feb 21, 2014 · 6 comments
Open

parse error - @charset #7

shin820 opened this issue Feb 21, 2014 · 6 comments

Comments

@shin820
Copy link

shin820 commented Feb 21, 2014

Hi,
I got the following error when parsing @charset "utf-8";

18:05:13.045 ERROR - Unable to parse file: D:\Refactoring_Test\test\01
test\test_css\mission-css.css
com.sonar.sslr.api.RecognitionException: Parse error at line 1 column 2 failed t
o match all of: whiteSpaces lBracket idSelector classSelector colon lBracket idS
elector classSelector colon _ident from to _num adjacentComb precededComb childC
omb lBracket idSelector classSelector colon _ident from to _num adjacentComb pre
cededComb childComb comma eof comma lCurlyBracket statement

1: ?@charset "utf-8";
^

Failed at rules:
/-whiteSpaces
/-ident consumed from (1, 1) to (1, 1): "?"
/-typeSelector
| /-lBracket
| /-attributeSelector
| +-idSelector
| +-classSelector
| | /-colon
| +-pseudo
| /-subS
+-typeSelector consumed from (1, 1) to (1, 1): "?"
/-simpleSelector

@spil-tamas
Copy link

I am not a css expert, but what is that ? before the charset? it should be just: @charset "UTF-8";

@shin820
Copy link
Author

shin820 commented Feb 21, 2014

Actually there is no sign '?' in my CSS file, but it appears when CSS parsing.

@kalidasya
Copy link
Owner

hm... perhaps, its a char encoding issue... what is the encoding setting in the sonar-runner.properties? can you check is the file properly encoded in UTF8?

@shin820
Copy link
Author

shin820 commented Feb 21, 2014

Yes, this is a encoding issue. The issue is result from that I'm a windows user and I used notepad to save this file as 'UTF8'.
About the details, please see http://koti.mbnet.fi/akini/java/unicodereader/

@kalidasya
Copy link
Owner

ok I will check can I do something from the plugin's side, thanks for the link!

@kalidasya
Copy link
Owner

can you try to reproduce this with the javascript plugin? so analyse a similar js 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

3 participants