File tree Expand file tree Collapse file tree 3 files changed +28
-1
lines changed
Expand file tree Collapse file tree 3 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -1578,6 +1578,7 @@ less.Parser = function Parser(env) {
15781578 value = this . detachedRuleset ( ) ;
15791579 }
15801580
1581+ this . comments ( ) ;
15811582 if ( ! value ) {
15821583 // prefer to try to parse first if its a variable or we are compressing
15831584 // but always fallback on the other one
@@ -1822,6 +1823,8 @@ less.Parser = function Parser(env) {
18221823 break ;
18231824 }
18241825
1826+ this . comments ( ) ;
1827+
18251828 if ( hasIdentifier ) {
18261829 value = this . entity ( ) ;
18271830 if ( ! value ) {
@@ -1839,6 +1842,8 @@ less.Parser = function Parser(env) {
18391842 }
18401843 }
18411844
1845+ this . comments ( ) ;
1846+
18421847 if ( hasBlock ) {
18431848 rules = this . blockRuleset ( ) ;
18441849 }
@@ -2053,9 +2058,20 @@ less.Parser = function Parser(env) {
20532058 return name . push ( a [ 1 ] ) ;
20542059 }
20552060 }
2061+ function cutOutBlockComments ( ) {
2062+ //match block comments
2063+ var a = / ^ \s * \/ \* (?: [ ^ * ] | \* + [ ^ \/ * ] ) * \* + \/ / . exec ( c ) ;
2064+ if ( a ) {
2065+ length += a [ 0 ] . length ;
2066+ c = c . slice ( a [ 0 ] . length ) ;
2067+ return true ;
2068+ }
2069+ return false ;
2070+ }
20562071
20572072 match ( / ^ ( \* ? ) / ) ;
20582073 while ( match ( / ^ ( (?: [ \w - ] + ) | (?: @ \{ [ \w - ] + \} ) ) / ) ) ; // !
2074+ while ( cutOutBlockComments ( ) ) ;
20592075 if ( ( name . length > 1 ) && match ( / ^ \s * ( (?: \+ _ | \+ ) ? ) \s * : / ) ) {
20602076 // at last, we have the complete match now. move forward,
20612077 // convert name particles to tree objects and return:
Original file line number Diff line number Diff line change 5858.sr-only-focusable {
5959 clip : auto;
6060}
61+ @-webkit-keyframes hover {
62+ 0% {
63+ color : red;
64+ }
65+ }
6166# last {
6267 color : # 0000ff ;
6368}
Original file line number Diff line number Diff line change 6262*/
6363
6464.selector /* .with */ , .lots , /* of */ .comments {
65- color : grey , /* blue */ orange ;
65+ color /* survive */ /* me too */ : grey , /* blue */ orange ;
6666 -webkit-border-radius : 2px /* webkit only */ ;
6767 -moz-border-radius : (2px * 4 ) /* moz only with operation */ ;
6868}
8484 clip : auto ;
8585}
8686
87+ @-webkit-keyframes /* Safari */ hover /* and Chrome */ {
88+ 0% {
89+ color : red ;
90+ }
91+ }
92+
8793#last { color : blue }
8894//
8995
You can’t perform that action at this time.
0 commit comments