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.
Summary: | LESS parsing issues | ||
---|---|---|---|
Product: | web | Reporter: | Vladimir Riha <vriha> |
Component: | CSS Preprocessors (SASS, LESS, ...) | Assignee: | Marek Fukala <mfukala> |
Status: | VERIFIED FIXED | ||
Severity: | normal | CC: | cadavre, CassieRheaume, code-guru, jomit, luislobo, pjiricka, sabel, tmysik, vriha, Wareczek, xaguilars |
Priority: | P2 | ||
Version: | 7.4 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
Vladimir Riha
2013-03-15 09:48:58 UTC
#11 selector interpolation - unexpected character @ found @name: blocked; .@{name} { color: black; } ============================== #12 Media Queries as Variables - 2 errors on line with @media @singleQuery: "(max-width: 500px)"; @media screen, @singleQuery { set { padding: 3 3 3 3; } } Product Version: NetBeans IDE Dev (Build web-main-10168-on-20130325) Java: 1.7.0; Java HotSpot(TM) 64-Bit Server VM 21.0-b17 Runtime: Java(TM) SE Runtime Environment 1.7.0-b147 System: Linux version 3.5.0-26-generic running on amd64; UTF-8; en_US (nb) *** Bug 229594 has been marked as a duplicate of this bug. *** *** Bug 230977 has been marked as a duplicate of this bug. *** extracted from issue 227484#c23: 1. Unexpected token NUMBER found http://i43.tinypic.com/33ju82w.png 2. Unexpected token COMMA found http://i43.tinypic.com/34o351l.png #14 usage of !important .mixin(@val){ color: red } .important { .mixin(2) !important; } => unexpected token IMPORTANT_SYM Product Version: NetBeans IDE Dev (Build 201306242301) #15 Guarded mixins .mixin (@a) when (lightness(@a) >= 50%) { background-color: black; } => unexpected token PERCENTAGE, GREATER_OR_EQ and LBRACE ============================= #16 unexpected token comma .child, .sibling { .parent & { color: black; } & + & { color: red; } } Product Version: NetBeans IDE Dev (Build 201306242301) #16 Problem when mixin declaration is after its usage @attr:1; @name:1; pre { .test2(red); } .test2(@j){ color: @j; font-size: @attr; } => unexpected token RPAREN and IDENT. If I flip order of pre and .test2 declarations, it is OK Last one #17 valid MQ in Less @media screen and (max-width: 400px) { h1 { color: green; } } => unexpected token IDENT, LPAREN etc. *** Bug 232308 has been marked as a duplicate of this bug. *** To reproduce #1 and #8, you need to have some code below, e.g. for #1: .test(@a){ font: @a; } foo{ @a: 12px; @b: normal; .test(@a @b); } div{} What seems to be OK now: #2, #3, #5, =========================== #18 from issue 229594 .subnav-fixed { #gradient > .vertical(#f5f5f5, #eeeeee); } Product Version: NetBeans IDE Dev (Build 201307172300) Java: 1.7.0_40-ea; Java HotSpot(TM) Client VM 24.0-b52 Runtime: Java(TM) SE Runtime Environment 1.7.0_40-ea-b33 System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb) #19 Multiple selectors .a, .b { width: 1050px; } => Unexpected token COMMA #19 - the first selector is incorrectly recognized as mixin call, then the parsing fails: .transition() { h1 { color: red; } } .transition; //correct mixin call .transition, div { //not a mixin call } changeset: 260814:06ead4ff16c1 summary: #227510 - fixing case #19 - class selector in selectors group recognized as less mixin call I think I should have started this one already ... quite a lot of work here. Integrated into 'main-silver', will be available in build *201308092300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/06ead4ff16c1 User: Marek Fukala <mfukala@netbeans.org> Log: #227510 - fixing case #19 - class selector in selectors group recognized as less mixin call 2,3,5,6,8,16/1,17,19 are fixed, the rest (12 issues) is in progress changeset: 261536:da3f4a9aae0e summary: #227510/1 - mixin call followed by a block changeset: 261537:3073bb6c058f summary: #227510/4 - sass keywords as less variable names as for #7 - it looks like it is an invalid class name so the editor error is correct. W3C's css validator says: In CSS1, a class name could start with a digit (".55ft"), unless it was a dimension (".55in"). In CSS2, such classes are parsed as unknown dimensions (to allow for future additions of new units) To make "3dtransform" a valid class, CSS2 requires the first digit to be escaped ".\33 dtransform" [3dtransform] "Tricky" is that technically it is not class selector, but mixin and I haven't found any limitations on mixin's name. But I'm fine with not fixing it, it is probably corner case changeset: 261601:de387926ef8b summary: #227510/9 - LESS javascript expressions changeset: 261602:623e29c38d61 summary: #227510/10 - less escaped content > "Tricky" is that technically it is not class selector, but mixin and I
> haven't found any limitations on mixin's name. But I'm fine with not fixing
> it, it is probably corner case
you are right, technically almost anything can be a mixin name in less, vrrrr...
changeset: 261603:168ee8a72c66 summary: #227510/11 - selector interpolation changeset: 261614:23fa62847e46 summary: #227510/12 - less variable as media query #13 works fine, so I've added tests for the cases extracted from the screenshots: changeset: 261615:d7c2bab45d24 summary: #227510/13 - adding tests for: function in mixin call, mixin call with ws separated values, comma in selectors group searching for changes summary: #227510/14 - important symbol in mixin call changeset: 261617:2a45b6fc21b1 summary: #227510/15 - less guarded mixin w/ less function in condition #16/2 - already fixed by a former fix of the mixin declaration predicate searching for changes summary: #227510/16 - adding test for nested selector concatenation changeset: 261622:d52cd939a586 summary: #227510/16/2 - adding test for mixin declaration predicate (In reply to Marek Fukala from comment #20) > > "Tricky" is that technically it is not class selector, but mixin and I > > haven't found any limitations on mixin's name. But I'm fine with not fixing > > it, it is probably corner case > you are right, technically almost anything can be a mixin name in less, > vrrrr... I've added this case to following issue: https://netbeans.org/bugzilla/show_bug.cgi?id=231249#c5 So if I'm not mistaken, the only remaining issue is the case #18 which so far somehow resists all my attempts to fix :-) => filed as issue Bug 234639 - can't parse mixin call acting as selector Thanks :) I'll verify it all tomorrow or on Thursday. *** Bug 234683 has been marked as a duplicate of this bug. *** Thanks Marku, verified Product Version: NetBeans IDE Dev (Build 201308222300) Updates: Updates available Java: 1.7.0_40; Java HotSpot(TM) Client VM 24.0-b55 Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b39 System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb) *** Bug 235269 has been marked as a duplicate of this bug. *** Some issues is still persisting with LESS parsing. These are unsolved from the previous mentions: //#7 unexpected token dimension .3dtransform (@perspective: 300, @rotateY: 180deg) { -webkit-perspective: @perspective; } //--------------------------------------------------- //#18 unexpected token WS found from issue 229594 .subnav-fixed { #gradient > .vertical(#f5f5f5, #eeeeee); } //--------------------------------------------------- These haven't been mentioned and have parsing issue: //#20 unexpected token LPAREN/IDENT found import (less) "theme"; import (css) "../base.css"; //#21 unexpected LPAREN found .pull-right > .dropdown-menu(); #gradient > .horizontal(@start-color: rgba(0,0,0,.5); @end-color: rgba(0,0,0,.0001)); //#22 unexpecten RPAREN/SEMI/LBRACE found .img-responsive(@display: block;) { height: auto; } //#23 unexpected token IDENT .modal { &.in .modal-dialog { .translate(0, 0)} } code-guru, please don't add new problems to this issue but report a new one next time with one problem in one issue. Thank you in advance. As you can see, #7 and #18 are tracked as separate issues, no reason to mention it here again. I reported your cases and added you to cc of these issues: #20: issue 237975 #21: I think this is another instance of #18 #22: issue 237976 #23: I would guess it is again similar as #18, but I'm not sure so reported as issue 237977 Closing this issue back as fixed. Thanks |