Fixes tokenization regression issue.
authorJakub Pawlowicz <contact@jakubpawlowicz.com>
Tue, 10 Feb 2015 15:51:08 +0000 (15:51 +0000)
committerJakub Pawlowicz <contact@jakubpawlowicz.com>
Tue, 10 Feb 2015 15:51:08 +0000 (15:51 +0000)
Introduced in a9c75d34.

lib/selectors/tokenizer.js
test/selectors/tokenizer-test.js

index 79e4947..af80009 100644 (file)
@@ -13,7 +13,7 @@ function Tokenizer(minifyContext, addMetadata, addSourceMap) {
 Tokenizer.prototype.toTokens = function (data) {
   data = data
     .replace(/\r\n/g, '\n')
-    .replace(/\)([^\s\{_;,])/g, this.addSourceMap ? ') __ESCAPED_COMMENT_CLEAN_CSS(0,-1)__$1' : ') $1');
+    .replace(/\)([^\s\{_;:,])/g, this.addSourceMap ? ') __ESCAPED_COMMENT_CLEAN_CSS(0,-1)__$1' : ') $1');
 
   var chunker = new Chunker(data, '}', 128);
   if (chunker.isEmpty())
index f3be522..0d8df0c 100644 (file)
@@ -149,6 +149,14 @@ vows.describe(Tokenizer)
           ]
         }]
       ],
+      'pseudoselector after an argument one': [
+        'div:nth-child(2n):not(.test){}',
+        [{
+          kind: 'selector',
+          value: [{ value: 'div:nth-child(2n):not(.test)' }],
+          body: []
+        }]
+      ],
       'media query': [
         '@media (min-width:980px){}',
         [{