This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 248231 - Unexpected token HASH_SYMBOL found
Summary: Unexpected token HASH_SYMBOL found
Status: RESOLVED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: CSS Preprocessors (SASS, LESS, ...) (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Milutin Kristofic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-28 15:02 UTC by Geertjan Wielenga
Modified: 2014-11-26 04:23 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Unexpected token HASH SYMBOL found (10.78 KB, image/png)
2014-10-28 15:02 UTC, Geertjan Wielenga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Geertjan Wielenga 2014-10-28 15:02:27 UTC
Created attachment 150144 [details]
Unexpected token HASH SYMBOL found

In an SCSS file, in an OJET project, the attached error is shown throughout an OJET project template. Needs to be fixed, the parser is not able to parse it. 

To reproduce, use the OJET starter template and see scss\oj\v1.1.0\utilities\_oj.experimental.utilities.flexboxgrid.scss.
Comment 1 Geertjan Wielenga 2014-10-28 15:04:53 UTC
Not just HASH_SYMBOL causes a problem. Also these:

ERROR
RPAREN
SEMI
RBRACE
LPAREN
SASS_DEFAULT

I am using: javascript2-frameworks-484-on-20141028
Comment 2 Milutin Kristofic 2014-10-31 17:08:16 UTC
I am fixing parser, but I need more time. I am fixing parser for Bug #248270, after that I can fix this.

The problem is with sass interpolation #{} ... this "eval" functionality can be almost everywhere and currently our CSS parser has just workaround for that - it ignores characters around interpolation.

Therefore this needs a quite big rewrite of Css parser.
Comment 3 Milutin Kristofic 2014-11-25 19:07:24 UTC
I fixed in this patch http://hg.netbeans.org/web-main/rev/3d9d386b2351 following bugs in OJET project:

- HASH SYMBOL Bug .table-odd-cols-#{$i} > .oj-row > .oj-col:nth-child(even) {}
- map with Strings: $map: ('1':'1');
- default value in map declaration $modules: () !default
- If declaration without space : @if() {}

Unfortunately, there are more bugs in OJET project.

- calling own sass function URL @return url($imageDir + $path); I opened Bug #248898
- using comma in the end of selector .test, .test2, {} this is a bug in their code, CSS is ignoring such rules, so this is good behavior from our parser
Comment 4 Vladimir Riha 2014-11-25 19:27:35 UTC
I filed the extra comma in issue 248715 where it comes from Sencha Touch framework. W3C's CSS validator marks this as syntax error but scss compilator removes it and compiles the file to valid CSS (I guess less will do the same). Could this "error" be accepted by parser in less/scss files so it wouldn't mark it in these files?
Comment 5 Milutin Kristofic 2014-11-25 20:38:57 UTC
Vlada, that's good idea, I will implement additional comma for scss/less. I haven't thought about it that way. Thanks
Comment 6 Quality Engineering 2014-11-26 04:23:11 UTC
Integrated into 'main-silver', will be available in build *201411260001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/3d9d386b2351
User: Milutin Kristofic <mkristofic@netbeans.org>
Log: #248231 - Unexpected token HASH_SYMBOL found