From b373055e028210399a09c2ccc1d27b6aad636a6a Mon Sep 17 00:00:00 2001
From: Jonathan Suh Function _classCallCheck ✓ Was called Branch IfStatement ✗ Positive was not executed (if) ✓ Negative was executed (else) Function Comb ✓ Was called
_classCallCheck(this, Comb);
this.config = {};
this.exclude = [];
// Whether lint mode is on.
this.lint = false;
// List of file paths that should be excluded from processing.
this.pathsToExclude = null;
// List of used plugins.
this.plugins = [];
this.pluginsDependencies = {};
// List of supported syntaxes.
this.supportedSyntaxes = new Set();
// Whether verbose mode is on.
this.verbose = false;
}Function configure ✓ Was called
if (typeof config !== 'object')
// TODO: throw error
throw new Error();
this.lint = config.lint;
this.verbose = config.verbose;
if (config.exclude) this.exclude = config.exclude.map(function (pattern) {
return new minimatch.Minimatch(pattern);
});
for (var i = 0, l = this.plugins.length; i < l; i++) {
var plugin = this.plugins[i];
var _name = plugin.name;
if (!config.hasOwnProperty(_name)) continue;
try {
plugin.value = config[_name];
this.config[_name] = plugin.value;
} catch (e) {}
}
// Chaining.
return this;
};Branch IfStatement ✓ Positive was executed (if) ✓ Negative was executed (else)
this.lint = config.lint;Function (anonymous_5) ✓ Was called
return new minimatch.Minimatch(pattern);
});Branch IfStatement ✓ Positive was executed (if)
return new minimatch.Minimatch(pattern);
});✓ Negative was executed (else)
for (var i = 0, l = this.plugins.length; i < l; i++) {Branch IfStatement ✗ Positive was not executed (if) ✓ Negative was executed (else)
try {Function getAcceptableFilesFromDirectory ✓ Was called
if (!this.shouldProcess(path)) return;
var files = [];
var filesInThisDir = fs.readdirSync(path);
for (var i = 0, fl = filesInThisDir.length; i < fl; i++) {
var fullname = path + '/' + filesInThisDir[i];
var stat = fs.statSync(fullname);
if (stat.isDirectory() && this.shouldProcess(fullname)) files = files.concat(this.getAcceptableFilesFromDirectory(fullname));else if (this.shouldProcessFile(fullname)) files.push(fullname);
}
return files;
};Branch IfStatement ✗ Positive was not executed (if) ✓ Negative was executed (else)
var files = [];Branch IfStatement ✓ Positive was executed (if) ✓ Negative was executed (else) Branch LogicalExpression ✓ Was returned ✓ Was returned Branch IfStatement ✓ Positive was executed (if) ✓ Negative was executed (else)
}Function lintDirectory ✓ Was called
var _this = this;
var files = this.getAcceptableFilesFromDirectory(path);
var promises = files.map(function (file) {
return _this.lintFile(file);
});
return Promise.all(promises);
};Function (anonymous_8) ✓ Was called
return _this.lintFile(file);
});Function lintFile ✓ Was called
var _this2 = this;
var syntax = path.split('.').pop();
return this.readFile(path).then(function (string) {
return _this2.lintString(string, { syntax: syntax, filename: path });
});
};Function (anonymous_10) ✓ Was called
return _this2.lintString(string, { syntax: syntax, filename: path });
});Function lintPath ✓ Was called
path = path.replace(/\/$/, '');
return fs.statSync(path).isDirectory() ? this.lintDirectory(path) : this.lintFile(path);
};Branch ConditionalExpression ✓ Positive was returned (? ...) ✓ Negative was returned (: ...) Function lintString ✓ Was called
return this.parseString(text, options).then(this.lintTree.bind(this));
};Function lintTree ✓ Was called
var _this3 = this;
var errors = [];
var config = this.config;
return new Promise(function (resolve) {
_this3.plugins.filter(function (plugin) {
return typeof plugin.value !== null && typeof plugin.lint === 'function' && plugin.syntax.indexOf(ast.syntax) !== -1;
}).forEach(function (plugin) {
var e = plugin.lint(ast, config);
errors = errors.concat(e);
});
if (filename) {
errors.map(function (error) {
error.filename = filename;
return error;
});
}
resolve(errors);
});
};Function (anonymous_14) ✓ Was called
_this3.plugins.filter(function (plugin) {
return typeof plugin.value !== null && typeof plugin.lint === 'function' && plugin.syntax.indexOf(ast.syntax) !== -1;
}).forEach(function (plugin) {
var e = plugin.lint(ast, config);
errors = errors.concat(e);
});
if (filename) {
errors.map(function (error) {
error.filename = filename;
return error;
});
}
resolve(errors);
});Function (anonymous_15) ✓ Was called
return typeof plugin.value !== null && typeof plugin.lint === 'function' && plugin.syntax.indexOf(ast.syntax) !== -1;
}).forEach(function (plugin) {Branch LogicalExpression ✓ Was returned ✗ Was not returned Branch LogicalExpression ✓ Was returned ✗ Was not returned Function (anonymous_16) ✓ Was called
var e = plugin.lint(ast, config);
errors = errors.concat(e);
});Branch IfStatement ✓ Positive was executed (if)
errors.map(function (error) {
error.filename = filename;
return error;
});
}✓ Negative was executed (else)
resolve(errors);Function (anonymous_17) ✓ Was called
error.filename = filename;
return error;
});Function parseString ✓ Was called
var syntax = options && options.syntax;
var filename = options && options.filename || '';
var context = options && options.context;
var tree = undefined;
if (!text) return this.lint ? [] : text;
if (!syntax) syntax = 'css';
this.syntax = syntax;
return new Promise(function (resolve) {
try {
tree = gonzales.parse(text, { syntax: syntax, rule: context });
resolve(tree, filename);
} catch (e) {
var version = require('../package.json').version;
var message = filename ? [filename] : [];
message.push(e.message);
message.push('CSScomb Core version: ' + version);
e.stack = e.message = message.join('\n');
throw e;
}
});
};Branch LogicalExpression ✓ Was returned ✓ Was returned Branch LogicalExpression ✓ Was returned ✓ Was returned Branch LogicalExpression ✓ Was returned ✓ Was returned Branch LogicalExpression ✓ Was returned ✓ Was returned Branch IfStatement ✗ Positive was not executed (if) ✓ Negative was executed (else)
if (!syntax) syntax = 'css';Branch ConditionalExpression ✗ Positive was not returned (? ...) ✗ Negative was not returned (: ...) Branch IfStatement ✓ Positive was executed (if) ✓ Negative was executed (else)
this.syntax = syntax;Function (anonymous_19) ✓ Was called
try {
tree = gonzales.parse(text, { syntax: syntax, rule: context });
resolve(tree, filename);
} catch (e) {
var version = require('../package.json').version;
var message = filename ? [filename] : [];
message.push(e.message);
message.push('CSScomb Core version: ' + version);
e.stack = e.message = message.join('\n');
throw e;
}
});Branch ConditionalExpression ✗ Positive was not returned (? ...) ✗ Negative was not returned (: ...) Function pluginAlreadyUsed ✓ Was called
return this.pluginIndex(name) !== -1;
};Function pluginIndex ✓ Was called
var index = -1;
this.plugins.some(function (plugin, i) {
if (plugin.name === name) {
index = i;
return true;
}
});
return index;
};Function (anonymous_22) ✗ Was not called
if (plugin.name === name) {
index = i;
return true;
}
});Branch IfStatement ✗ Positive was not executed (if)
index = i;
return true;
}✗ Negative was not executed (else)
});Function processDirectory ✗ Was not called
var that = this;
return vfs.listDir(path).then(function (filenames) {
return vow.all(filenames.map(function (filename) {
var fullname = path + '/' + filename;
return vfs.stat(fullname).then(function (stat) {
if (stat.isDirectory() && that.shouldProcess(fullname)) {
return that.processDirectory(fullname);
} else {
return that.processFile(fullname);
}
});
})).then(function (results) {
return [].concat.apply([], results);
});
});
};Function (anonymous_24) ✗ Was not called
return vow.all(filenames.map(function (filename) {
var fullname = path + '/' + filename;
return vfs.stat(fullname).then(function (stat) {
if (stat.isDirectory() && that.shouldProcess(fullname)) {
return that.processDirectory(fullname);
} else {
return that.processFile(fullname);
}
});
})).then(function (results) {
return [].concat.apply([], results);
});
});Function (anonymous_25) ✗ Was not called
var fullname = path + '/' + filename;
return vfs.stat(fullname).then(function (stat) {
if (stat.isDirectory() && that.shouldProcess(fullname)) {
return that.processDirectory(fullname);
} else {
return that.processFile(fullname);
}
});
})).then(function (results) {Function (anonymous_26) ✗ Was not called
if (stat.isDirectory() && that.shouldProcess(fullname)) {
return that.processDirectory(fullname);
} else {
return that.processFile(fullname);
}
});Branch IfStatement ✗ Positive was not executed (if)
return that.processDirectory(fullname);
} else {✗ Negative was not executed (else)
return that.processFile(fullname);
}Branch LogicalExpression ✗ Was not returned ✗ Was not returned Function (anonymous_27) ✗ Was not called
return [].concat.apply([], results);
});Function processFile ✗ Was not called
var that = this;
if (!this.shouldProcessFile(path)) return;
return vfs.read(path, 'utf8').then(function (data) {
var syntax = path.split('.').pop();
var processedData = that.processString(data, {
syntax: syntax,
filename: path
});
if (that.lint) return processedData;
if (data === processedData) {
if (that.verbose) console.log(' ', path);
return 0;
}
return vfs.write(path, processedData, 'utf8').then(function () {
if (that.verbose) console.log('✓', path);
return 1;
});
});
};Branch IfStatement ✗ Positive was not executed (if) ✗ Negative was not executed (else)
return vfs.read(path, 'utf8').then(function (data) {Function (anonymous_29) ✗ Was not called
var syntax = path.split('.').pop();
var processedData = that.processString(data, {
syntax: syntax,
filename: path
});
if (that.lint) return processedData;
if (data === processedData) {
if (that.verbose) console.log(' ', path);
return 0;
}
return vfs.write(path, processedData, 'utf8').then(function () {
if (that.verbose) console.log('✓', path);
return 1;
});
});Branch IfStatement ✗ Positive was not executed (if) ✗ Negative was not executed (else)
if (data === processedData) {Branch IfStatement ✗ Positive was not executed (if)
if (that.verbose) console.log(' ', path);
return 0;
}✗ Negative was not executed (else)
return vfs.write(path, processedData, 'utf8').then(function () {Branch IfStatement ✗ Positive was not executed (if) ✗ Negative was not executed (else)
return 0;Function (anonymous_30) ✗ Was not called
if (that.verbose) console.log('✓', path);
return 1;
});Branch IfStatement ✗ Positive was not executed (if) ✗ Negative was not executed (else)
return 1;Function readFile ✓ Was called
var _this4 = this;
return new Promise(function (resolve, reject) {
if (!_this4.shouldProcessFile(path)) reject();
fs.readFile(path, 'utf8', function (e, string) {
if (e) reject();
resolve(string);
});
});
};Function (anonymous_32) ✓ Was called
if (!_this4.shouldProcessFile(path)) reject();
fs.readFile(path, 'utf8', function (e, string) {
if (e) reject();
resolve(string);
});
});Branch IfStatement ✓ Positive was executed (if) ✓ Negative was executed (else)
fs.readFile(path, 'utf8', function (e, string) {Function (anonymous_33) ✓ Was called
if (e) reject();
resolve(string);
});Branch IfStatement ✗ Positive was not executed (if) ✓ Negative was executed (else)
resolve(string);Function processPath ✗ Was not called
var that = this;
path = path.replace(/\/$/, '');
return vfs.stat(path).then(function (stat) {
if (stat.isDirectory()) {
return that.processDirectory(path);
} else {
return that.processFile(path);
}
});
};Function (anonymous_35) ✗ Was not called
if (stat.isDirectory()) {
return that.processDirectory(path);
} else {
return that.processFile(path);
}
});Branch IfStatement ✗ Positive was not executed (if)
return that.processDirectory(path);
} else {✗ Negative was not executed (else)
return that.processFile(path);
}Function processString ✓ Was called
return this.parseString(text, options).then(this.processTree.bind(this)).then(function (ast) {
return ast.toString();
});
};Function (anonymous_37) ✓ Was called
return ast.toString();
});Function processTree ✓ Was called
var _this5 = this;
var config = this.config;
return new Promise(function (resolve) {
_this5.plugins.filter(function (plugin) {
return plugin.value !== null && typeof plugin.process === 'function' && plugin.syntax.indexOf(ast.syntax) !== -1;
}).forEach(function (plugin) {
plugin.process(ast, config);
});
resolve(ast);
});
};Function (anonymous_39) ✓ Was called
_this5.plugins.filter(function (plugin) {
return plugin.value !== null && typeof plugin.process === 'function' && plugin.syntax.indexOf(ast.syntax) !== -1;
}).forEach(function (plugin) {
plugin.process(ast, config);
});
resolve(ast);
});Function (anonymous_40) ✓ Was called
return plugin.value !== null && typeof plugin.process === 'function' && plugin.syntax.indexOf(ast.syntax) !== -1;
}).forEach(function (plugin) {Branch LogicalExpression ✓ Was returned ✗ Was not returned Branch LogicalExpression ✓ Was returned ✗ Was not returned Function (anonymous_41) ✓ Was called
plugin.process(ast, config);
});Function shouldProcess ✓ Was called
path = path.replace(/\/$/, '');
if (!fs.existsSync(path)) {
console.warn('Path ' + path + ' was not found.');
return false;
}
path = path.replace(/^\.\//, '');
return this.exclude.every(function (e) {
return !e.match(path);
});
};Branch IfStatement ✗ Positive was not executed (if)
console.warn('Path ' + path + ' was not found.');
return false;
}✓ Negative was executed (else)
path = path.replace(/^\.\//, '');Function (anonymous_43) ✗ Was not called
return !e.match(path);
});Function shouldProcessFile ✓ Was called
// Get file's extension:
var syntax = path.split('.').pop();
// Check if syntax is supported. If not, ignore the file:
if (!this.supportedSyntaxes.has(syntax)) return false;
return this.shouldProcess(path);
};Branch IfStatement ✓ Positive was executed (if) ✓ Negative was executed (else)
return this.shouldProcess(path);Function use ✓ Was called
// Check whether plugin with the same is already used.
var pluginName = options.name;
if (this.pluginAlreadyUsed(pluginName)) {
if (this.verbose) console.warn(Errors.twoPluginsWithSameName(pluginName));
return;
}
var plugin = new Plugin(options);
plugin.syntax.forEach(function (s) {
this.supportedSyntaxes.add(s);
}, this);
// Sort plugins.
var pluginToRunBefore = plugin.runBefore;
if (!pluginToRunBefore) {
this.plugins.push(plugin);
} else {
if (this.pluginAlreadyUsed(pluginToRunBefore)) {
var i = this.pluginIndex(pluginToRunBefore);
this.plugins.splice(i, 0, plugin);
} else {
this.plugins.push(plugin);
if (!this.pluginsDependencies[pluginToRunBefore]) this.pluginsDependencies[pluginToRunBefore] = [];
this.pluginsDependencies[pluginToRunBefore].push(pluginName);
}
}
var dependents = this.pluginsDependencies[pluginName];
if (!dependents) return this;
for (var i = 0, l = dependents.length; i < l; i++) {
var _name2 = dependents[i];
var x = this.pluginIndex(_name2);
var _plugin = this.plugins[x];
this.plugins.splice(x, 1);
this.plugins.splice(-1, 0, _plugin);
}
// Chaining.
return this;
};Branch IfStatement ✗ Positive was not executed (if)
if (this.verbose) console.warn(Errors.twoPluginsWithSameName(pluginName));
return;
}✓ Negative was executed (else)
var plugin = new Plugin(options);Branch IfStatement ✗ Positive was not executed (if) ✗ Negative was not executed (else)
return;Function (anonymous_46) ✓ Was called
this.supportedSyntaxes.add(s);
}, this);Branch IfStatement ✓ Positive was executed (if)
this.plugins.push(plugin);
} else {✗ Negative was not executed (else)
if (this.pluginAlreadyUsed(pluginToRunBefore)) {
var i = this.pluginIndex(pluginToRunBefore);
this.plugins.splice(i, 0, plugin);
} else {
this.plugins.push(plugin);
if (!this.pluginsDependencies[pluginToRunBefore]) this.pluginsDependencies[pluginToRunBefore] = [];
this.pluginsDependencies[pluginToRunBefore].push(pluginName);
}
}Branch IfStatement ✗ Positive was not executed (if)
var i = this.pluginIndex(pluginToRunBefore);
this.plugins.splice(i, 0, plugin);
} else {✗ Negative was not executed (else)
this.plugins.push(plugin);
if (!this.pluginsDependencies[pluginToRunBefore]) this.pluginsDependencies[pluginToRunBefore] = [];
this.pluginsDependencies[pluginToRunBefore].push(pluginName);
}Branch IfStatement ✗ Positive was not executed (if) ✗ Negative was not executed (else)
this.pluginsDependencies[pluginToRunBefore].push(pluginName);Branch IfStatement ✓ Positive was executed (if) ✗ Negative was not executed (else)
for (var i = 0, l = dependents.length; i < l; i++) {Function implementSetValue ✓ Was called
if (typeof valueType === 'undefined') throw new Error();
return format('If you see this message and you are not\n a developer adding a new option, please open an issue here:\n https://github.com/csscomb/core/issues/new\n\n For option to accept values of type "' + valueType + '"\n you need to implement custom `setValue()` method.');
},Branch IfStatement ✓ Positive was executed (if) ✓ Negative was executed (else)
return format('If you see this message and you are not\n a developer adding a new option, please open an issue here:\n https://github.com/csscomb/core/issues/new\n\n For option to accept values of type "' + valueType + '"\n you need to implement custom `setValue()` method.');Function missingName ✓ Was called
return 'Plugin must have a valid `name` property.';
},Function missingSetValue ✓ Was called
return format('Plugin must either implemet `setValue()` method\n or provide `accepts` object with acceptable values.');
},Function missingSyntax ✓ Was called
return 'Plugin must list supported syntaxes.';
},Function twoPluginsWithSameName ✓ Was called
if (typeof pluginName === 'undefined') throw new Error();
return format('You\'re trying to use one plugin twice:\n ' + pluginName + '. Please make sure there are not two different\n plugins with the same name.');
},Branch IfStatement ✓ Positive was executed (if) ✓ Negative was executed (else)
return format('You\'re trying to use one plugin twice:\n ' + pluginName + '. Please make sure there are not two different\n plugins with the same name.');Function unacceptableBoolean ✓ Was called
if (typeof pattern === 'undefined') throw new Error();
return 'Value must be one of the following: ' + pattern.join(', ') + '.';
},Branch IfStatement ✓ Positive was executed (if) ✓ Negative was executed (else)
return 'Value must be one of the following: ' + pattern.join(', ') + '.';Function unacceptableNumber ✓ Was called
return 'Value must be an integer.';
},Function unacceptableString ✓ Was called
if (typeof pattern === 'undefined') throw new Error();
return 'Value must match pattern ' + pattern + '.';
},Branch IfStatement ✓ Positive was executed (if) ✓ Negative was executed (else)
return 'Value must match pattern ' + pattern + '.';Function unacceptableValueType ✓ Was called
if (typeof valueType === 'undefined' || typeof accepts === 'undefined') throw new Error();
return format('The option does not accept values of type\n ' + valueType + '.\nValue\'s type must be one the following:\n ' + Object.keys(accepts).join(', ') + '.');
}Branch IfStatement ✓ Positive was executed (if) ✓ Negative was executed (else)
return format('The option does not accept values of type\n ' + valueType + '.\nValue\'s type must be one the following:\n ' + Object.keys(accepts).join(', ') + '.');Branch LogicalExpression ✓ Was returned ✓ Was returned Function (anonymous_56) ✓ Was called
return string.replace(/\n\s*/gm, ' ');
};Function Plugin ✗ Was not called
for (var method in methods) {
this[method] = typeof method === 'function' ? methods[method].bind(this) : methods[method];
}
this.validate();
};Branch ConditionalExpression ✗ Positive was not returned (? ...) ✗ Negative was not returned (: ...) Function validate ✗ Was not called
if (typeof this.name !== 'string' || !this.name) throw new Error(Errors.missingName());
if (!Array.isArray(this.syntax) || this.syntax.length === 0) throw new Error(Errors.missingSyntax());
if (typeof this.accepts !== 'object' && typeof this.setValue !== 'function') throw new Error(Errors.missingSetValue());
}Branch IfStatement ✗ Positive was not executed (if) ✗ Negative was not executed (else)
if (!Array.isArray(this.syntax) || this.syntax.length === 0) throw new Error(Errors.missingSyntax());Branch LogicalExpression ✗ Was not returned ✗ Was not returned Branch IfStatement ✗ Positive was not executed (if) ✗ Negative was not executed (else)
if (typeof this.accepts !== 'object' && typeof this.setValue !== 'function') throw new Error(Errors.missingSetValue());Branch LogicalExpression ✗ Was not returned ✗ Was not returned Branch IfStatement ✗ Positive was not executed (if) ✗ Negative was not executed (else)
}Branch LogicalExpression ✗ Was not returned ✗ Was not returned Function (anonymous_59) ✗ Was not called
return this.value_;
},Function (anonymous_60) ✗ Was not called
var valueType = typeof value;
var pattern = this.accepts && this.accepts[valueType];
if (this.setValue) {
this.value_ = this.setValue(value);
return this.value_;
}
if (!pattern) throw new Error(Errors.unacceptableValueType(valueType, this.accepts));
if (valueType === 'boolean') {
if (pattern.indexOf(value) < 0) throw new Error(Errors.unacceptableBoolean(pattern));
this.value_ = value;
return this.value_;
}
if (valueType === 'number') {
if (value !== parseInt(value)) throw new Error(Errors.unacceptableNumber());
this.value_ = new Array(value + 1).join(' ');
return this.value_;
}
if (valueType = 'string') {
if (!value.match(pattern)) throw new Error(Errors.unacceptableString(pattern));
this.value_ = value;
return this.value_;
}
throw new Error(Errors.implementSetValue(valueType));
},Branch LogicalExpression ✗ Was not returned ✗ Was not returned Branch IfStatement ✗ Positive was not executed (if)
this.value_ = this.setValue(value);
return this.value_;
}✗ Negative was not executed (else)
if (!pattern) throw new Error(Errors.unacceptableValueType(valueType, this.accepts));Branch IfStatement ✗ Positive was not executed (if) ✗ Negative was not executed (else)
if (valueType === 'boolean') {Branch IfStatement ✗ Positive was not executed (if)
if (pattern.indexOf(value) < 0) throw new Error(Errors.unacceptableBoolean(pattern));
this.value_ = value;
return this.value_;
}✗ Negative was not executed (else)
if (valueType === 'number') {Branch IfStatement ✗ Positive was not executed (if) ✗ Negative was not executed (else)
this.value_ = value;Branch IfStatement ✗ Positive was not executed (if)
if (value !== parseInt(value)) throw new Error(Errors.unacceptableNumber());
this.value_ = new Array(value + 1).join(' ');
return this.value_;
}✗ Negative was not executed (else)
if (valueType = 'string') {Branch IfStatement ✗ Positive was not executed (if) ✗ Negative was not executed (else)
this.value_ = new Array(value + 1).join(' ');Branch IfStatement ✗ Positive was not executed (if)
if (!value.match(pattern)) throw new Error(Errors.unacceptableString(pattern));
this.value_ = value;
return this.value_;
}✗ Negative was not executed (else)
throw new Error(Errors.implementSetValue(valueType));Branch IfStatement ✗ Positive was not executed (if) ✗ Negative was not executed (else)
this.value_ = value;<)YzW6oLRDL^`vg~JIkmY
zJuva~*CywzW3A?tWnCj~OI_L>!AgOR
\n",
- "readmeFilename": "README.md",
- "gitHead": "dec99b7e4998ae8b11f8776770042a57277ca3dc",
- "bugs": {
- "url": "https://github.com/csscomb/core/issues"
- },
- "homepage": "https://github.com/csscomb/core",
- "_id": "csscomb-core@2.0.2",
- "scripts": {},
- "_shasum": "a4defe2368b0a7528f6552e147029f82cc938745",
- "_from": "csscomb-core@>=2.0.0-0 <2.1.0-0"
-}
diff --git a/node_modules/csscomb/node_modules/gonzales-pe/README.md b/node_modules/csscomb/node_modules/gonzales-pe/README.md
deleted file mode 100644
index 7319a3f..0000000
--- a/node_modules/csscomb/node_modules/gonzales-pe/README.md
+++ /dev/null
@@ -1,102 +0,0 @@
-Gonzales is a fast CSS parser.
-Gonzales PE is a rework with support of preprocessors.
-
-Currently those are supported: SCSS, Sass, LESS.
-
-For a plan of future work see [issue #4](https://github.com/tonyganch/gonzales-pe/issues/4).
-
-## Install
-
-To install globally:
-
- npm install gonzales-pe -g
-
-To install as a project dependency:
-
- npm install gonzales-pe
-
-To install dev branch:
-
- npm install git://github.com/tonyganch/gonzales-pe.git#dev
-
-To clone from github:
-
- git clone git@github.com:tonyganch/gonzales-pe.git
-
-## Build
-
-If you installed/cloned the repo from GitHub, make sure to build library files
-first.
-It can be done by running `make` in the module's root directory.
-`make` will build both Node.js and web versions (all files are comments-free
-but not compressed).
-If you need a minified version for production, feel free to use uglifier of
-your choice.
-
-## Use
-
-Require Gonzales in your project:
-
- var gonzales = require('gonzales-pe');
-
-Do something:
-
- var css = 'a { color: tomato }';
- console.log(gonzales.cssToAST(css));
-
-You can learn more about available methods on [Gonzales usage](doc/Gonzales-Usage.md) page.
-
-AST is described on [Gonzales AST description](doc/AST-Description.md) page.
-
-You can also invoke gonzales via a shell command (if you globally install it via `npm install gonzales-pe -g`)
-
-```
-gonzales myFile.css
-```
-
-Outputs the AST for that file. Example output:
-
-```
-['stylesheet',
- ['atrules',
- ['atkeyword',
- ['ident', 'import']],
- ['s', '
-']]]
-```
-
-## Test
-
-To run tests:
-
- npm test
-
-This command will build library files from sources and run tests on all files
-in syntax directories.
-
-Every test has 3 files: source stylesheet, expected AST and expected string
-compiled back from AST to css.
-
-If some tests fail, you can find information in test logs:
-
-- `log/test.log` contains all information from stdout;
-- `log/expected.txt` contains only expected text;
-- `log/result.txt` contains only result text.
-
-The last two are made for your convenience: you can use any diff app to see
-the defference between them.
-
-If you want to test one specific string or get a general idea of how Gonzales
-works, you can use `test/ast.js` file.
-Simply change the first two strings (`css` and `syntax` vars) and run:
-
- node test/ast.js
-
-Please remember to also run `make` every time you modify any source files.
-
-## Report
-
-If you find a bug or want to add a feature, welcome to [Issues](https://github.com/tonyganch/gonzales-pe/issues).
-
-If you are shy but have a question, feel free to [drop me a
-line](mailto:tonyganch+gonzales@gmail.com).
diff --git a/node_modules/csscomb/node_modules/gonzales-pe/bin/gonzales.js b/node_modules/csscomb/node_modules/gonzales-pe/bin/gonzales.js
deleted file mode 100755
index adfe102..0000000
--- a/node_modules/csscomb/node_modules/gonzales-pe/bin/gonzales.js
+++ /dev/null
@@ -1,11 +0,0 @@
-var gonzales = require('../lib/gonzales'),
- fs = require('fs'),
- filename = process.argv[2];
-
-if (!filename) {
- console.log('Please supply a filename. Usage "gonzales file"');
- process.exit();
-}
-
-console.log(gonzales.astToTree(gonzales.cssToAST(fs.readFileSync(filename).toString())));
-
diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/ast-to-src.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/ast-to-src.js
deleted file mode 100644
index ced440a..0000000
--- a/node_modules/csscomb/node_modules/gonzales-pe/lib/ast-to-src.js
+++ /dev/null
@@ -1,14 +0,0 @@
-module.exports = function astToSrc(options) {
- var ast, syntax, stringify;
-
- ast = typeof options === 'string' ? options : options.ast;
- syntax = options.syntax || 'css';
-
- try {
- stringify = require('./' + syntax + '/stringify');
- } catch (e) {
- return console.error('Syntax "' + syntax + '" is not supported yet, sorry');
- }
-
- return stringify(ast);
-}
diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/ast-to-string.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/ast-to-string.js
deleted file mode 100644
index 9409119..0000000
--- a/node_modules/csscomb/node_modules/gonzales-pe/lib/ast-to-string.js
+++ /dev/null
@@ -1,28 +0,0 @@
-module.exports = (function() {
- function dummySpaces(num) {
- return ' '
- .substr(0, num * 2);
- }
-
- return function astToString(tree, level) {
- level = level || 0;
- var spaces, string;
-
- if (level) {
- spaces = dummySpaces(level);
- string = '\n' + spaces + '[';
- } else {
- string = '[';
- }
-
- tree.forEach(function(node) {
- if (typeof node.ln !== 'undefined') return;
- string += Array.isArray(node) ?
- astToString(node, level + 1) :
- ('\'' + node.toString() + '\'');
- string += ', ';
- });
-
- return string.substr(0, string.length - 2) + ']';
- };
-})();
diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/css/mark.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/css/mark.js
deleted file mode 100644
index 426b97e..0000000
--- a/node_modules/csscomb/node_modules/gonzales-pe/lib/css/mark.js
+++ /dev/null
@@ -1,117 +0,0 @@
-var TokenType = require('../token-types');
-
-module.exports = (function() {
- /**
- * Mark whitespaces and comments
- */
- function markSC(tokens) {
- var tokensLength = tokens.length;
- var ws = -1, // flag for whitespaces
- sc = -1, // flag for whitespaces and comments
- t; // current token
-
- // For every token in the token list, mark spaces and line breaks
- // as spaces (set both `ws` and `sc` flags). Mark multiline comments
- // with `sc` flag.
- // If there are several spaces or tabs or line breaks or multiline
- // comments in a row, group them: take the last one's index number
- // and save it to the first token in the group as a reference
- // (e.g., `ws_last = 7` for a group of whitespaces or `sc_last = 9`
- // for a group of whitespaces and comments):
- for (var i = 0; i < tokensLength; i++) {
- t = tokens[i];
- switch (t.type) {
- case TokenType.Space:
- case TokenType.Tab:
- case TokenType.Newline:
- t.ws = true;
- t.sc = true;
-
- if (ws === -1) ws = i;
- if (sc === -1) sc = i;
-
- break;
- case TokenType.CommentML:
- if (ws !== -1) {
- tokens[ws].ws_last = i - 1;
- ws = -1;
- }
-
- t.sc = true;
-
- break;
- default:
- if (ws !== -1) {
- tokens[ws].ws_last = i - 1;
- ws = -1;
- }
-
- if (sc !== -1) {
- tokens[sc].sc_last = i - 1;
- sc = -1;
- }
- }
- }
-
- if (ws !== -1) tokens[ws].ws_last = i - 1;
- if (sc !== -1) tokens[sc].sc_last = i - 1;
- }
-
- /**
- * Pair brackets
- */
- function markBrackets(tokens) {
- var tokensLength = tokens.length;
- var ps = [], // parenthesis
- sbs = [], // square brackets
- cbs = [], // curly brackets
- t; // current token
-
- // For every token in the token list, if we meet an opening (left)
- // bracket, push its index number to a corresponding array.
- // If we then meet a closing (right) bracket, look at the corresponding
- // array. If there are any elements (records about previously met
- // left brackets), take a token of the last left bracket (take
- // the last index number from the array and find a token with
- // this index number) and save right bracket's index as a reference:
- for (var i = 0; i < tokens.length; i++) {
- t = tokens[i];
- switch(t.type) {
- case TokenType.LeftParenthesis:
- ps.push(i);
- break;
- case TokenType.RightParenthesis:
- if (ps.length) {
- t.left = ps.pop();
- tokens[t.left].right = i;
- }
- break;
- case TokenType.LeftSquareBracket:
- sbs.push(i);
- break;
- case TokenType.RightSquareBracket:
- if (sbs.length) {
- t.left = sbs.pop();
- tokens[t.left].right = i;
- }
- break;
- case TokenType.LeftCurlyBracket:
- cbs.push(i);
- break;
- case TokenType.RightCurlyBracket:
- if (cbs.length) {
- t.left = cbs.pop();
- tokens[t.left].right = i;
- }
- break;
- }
- }
- }
-
- return function(tokens) {
- // Mark paired brackets:
- markBrackets(tokens);
- // Mark whitespaces and comments:
- markSC(tokens);
- }
-})();
diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/css/node-types.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/css/node-types.js
deleted file mode 100644
index b9d74c7..0000000
--- a/node_modules/csscomb/node_modules/gonzales-pe/lib/css/node-types.js
+++ /dev/null
@@ -1,49 +0,0 @@
-module.exports = {
- ArgumentsType: 'arguments',
- AtkeywordType: 'atkeyword',
- AtrulebType: 'atruleb',
- AtrulerType: 'atruler',
- AtrulerqType: 'atrulerq',
- AtrulersType: 'atrulers',
- AtrulesType: 'atrules',
- AttribType: 'attrib',
- AttrselectorType: 'attrselector',
- BlockType: 'block',
- BracesType: 'braces',
- ClassType: 'class',
- CombinatorType: 'combinator',
- CommentMLType: 'commentML',
- DeclarationType: 'declaration',
- DeclDelimType: 'declDelim',
- DelimType: 'delim',
- DimensionType: 'dimension',
- FilterType: 'filter',
- FiltervType: 'filterv',
- FunctionType: 'function',
- FunctionExpressionType: 'functionExpression',
- IdentType: 'ident',
- ImportantType: 'important',
- NamespaceType: 'namespace',
- NthType: 'nth',
- NthselectorType: 'nthselector',
- NumberType: 'number',
- OperatorType: 'operator',
- PercentageType: 'percentage',
- ProgidType: 'progid',
- PropertyType: 'property',
- PropertyDelimType: 'propertyDelim',
- PseudocType: 'pseudoc',
- PseudoeType: 'pseudoe',
- RawType: 'raw',
- RulesetType: 'ruleset',
- SType: 's',
- SelectorType: 'selector',
- ShashType: 'shash',
- SimpleselectorType: 'simpleselector',
- StringType: 'string',
- StylesheetType: 'stylesheet',
- UnaryType: 'unary',
- UriType: 'uri',
- ValueType: 'value',
- VhashType: 'vhash'
-};
diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/css/rules.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/css/rules.js
deleted file mode 100644
index 6fac5c6..0000000
--- a/node_modules/csscomb/node_modules/gonzales-pe/lib/css/rules.js
+++ /dev/null
@@ -1,2514 +0,0 @@
-var TokenType = require('../token-types');
-var NodeType = require('./node-types');
-
-module.exports = (function() {
- var tokens, tokensLength, pos;
-
- var rules = {
- 'arguments': function() { return checkArguments(pos) && getArguments(); },
- 'atkeyword': function() { return checkAtkeyword(pos) && getAtkeyword(); },
- 'atruleb': function() { return checkAtruleb(pos) && getAtruleb(); },
- 'atruler': function() { return checkAtruler(pos) && getAtruler(); },
- 'atrulerq': function() { return checkAtrulerq(pos) && getAtrulerq(); },
- 'atrulers': function() { return checkAtrulers(pos) && getAtrulers(); },
- 'atrules': function() { return checkAtrules(pos) && getAtrules(); },
- 'attrib': function() { return checkAttrib(pos) && getAttrib(); },
- 'attrselector': function() { return checkAttrselector(pos) && getAttrselector(); },
- 'block': function() { return checkBlock(pos) && getBlock(); },
- 'braces': function() { return checkBraces(pos) && getBraces(); },
- 'class': function() { return checkClass(pos) && getClass(); },
- 'combinator': function() { return checkCombinator(pos) && getCombinator(); },
- 'commentML': function() { return checkCommentML(pos) && getCommentML(); },
- 'declaration': function() { return checkDeclaration(pos) && getDeclaration(); },
- 'declDelim': function() { return checkDeclDelim(pos) && getDeclDelim(); },
- 'delim': function() { return checkDelim(pos) && getDelim(); },
- 'dimension': function() { return checkDimension(pos) && getDimension(); },
- 'filter': function() { return checkFilter(pos) && getFilter(); },
- 'filterv': function() { return checkFilterv(pos) && getFilterv(); },
- 'functionExpression': function() { return checkFunctionExpression(pos) && getFunctionExpression(); },
- 'function': function() { return checkFunction(pos) && getFunction(); },
- 'ident': function() { return checkIdent(pos) && getIdent(); },
- 'important': function() { return checkImportant(pos) && getImportant(); },
- 'namespace': function() { return checkNamespace(pos) && getNamespace(); },
- 'nth': function() { return checkNth(pos) && getNth(); },
- 'nthselector': function() { return checkNthselector(pos) && getNthselector(); },
- 'number': function() { return checkNumber(pos) && getNumber(); },
- 'operator': function() { return checkOperator(pos) && getOperator(); },
- 'percentage': function() { return checkPercentage(pos) && getPercentage(); },
- 'progid': function() { return checkProgid(pos) && getProgid(); },
- 'property': function() { return checkProperty(pos) && getProperty(); },
- 'propertyDelim': function() { return checkPropertyDelim(pos) && getPropertyDelim(); },
- 'pseudoc': function() { return checkPseudoc(pos) && getPseudoc(); },
- 'pseudoe': function() { return checkPseudoe(pos) && getPseudoe(); },
- 'ruleset': function() { return checkRuleset(pos) && getRuleset(); },
- 's': function() { return checkS(pos) && getS(); },
- 'selector': function() { return checkSelector(pos) && getSelector(); },
- 'shash': function() { return checkShash(pos) && getShash(); },
- 'simpleselector': function() { return checkSimpleSelector(pos) && getSimpleSelector(); },
- 'string': function() { return checkString(pos) && getString(); },
- 'stylesheet': function() { return checkStylesheet(pos) && getStylesheet(); },
- 'unary': function() { return checkUnary(pos) && getUnary(); },
- 'uri': function() { return checkUri(pos) && getUri(); },
- 'value': function() { return checkValue(pos) && getValue(); },
- 'vhash': function() { return checkVhash(pos) && getVhash(); }
- };
-
- /**
- * Stop parsing and display error
- * @param {Number=} i Token's index number
- */
- function throwError(i) {
- var ln = i ? tokens[i].ln : tokens[pos].ln;
-
- throw {line: ln, syntax: 'css'};
- }
-
- /**
- * @param {Object} exclude
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkExcluding(exclude, i) {
- var start = i;
-
- while(i < tokensLength) {
- if (exclude[tokens[i++].type]) break;
- }
-
- return i - start - 2;
- }
-
- /**
- * @param {Number} start
- * @param {Number} finish
- * @returns {String}
- */
- function joinValues(start, finish) {
- var s = '';
-
- for (var i = start; i < finish + 1; i++) {
- s += tokens[i].value;
- }
-
- return s;
- }
-
- /**
- * @param {Number} start
- * @param {Number} num
- * @returns {String}
- */
- function joinValues2(start, num) {
- if (start + num - 1 >= tokensLength) return;
-
- var s = '';
-
- for (var i = 0; i < num; i++) {
- s += tokens[start + i].value;
- }
-
- return s;
- }
-
-
-/////////////////////////////////////
-/////////////////////////////////////
-/////////////////////////////////////
-
-
- /**
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkAny(i) {
- return checkBraces(i) ||
- checkString(i) ||
- checkPercentage(i) ||
- checkDimension(i) ||
- checkNumber(i) ||
- checkUri(i) ||
- checkFunctionExpression(i) ||
- checkFunction(i) ||
- checkIdent(i) ||
- checkClass(i) ||
- checkUnary(i);
- }
-
- /**
- * @returns {Array}
- */
- function getAny() {
- if (checkBraces(pos)) return getBraces();
- else if (checkString(pos)) return getString();
- else if (checkPercentage(pos)) return getPercentage();
- else if (checkDimension(pos)) return getDimension();
- else if (checkNumber(pos)) return getNumber();
- else if (checkUri(pos)) return getUri();
- else if (checkFunctionExpression(pos)) return getFunctionExpression();
- else if (checkFunction(pos)) return getFunction();
- else if (checkIdent(pos)) return getIdent();
- else if (checkClass(pos)) return getClass();
- else if (checkUnary(pos)) return getUnary();
- }
-
- /**
- * Check if token is part of an @-word (e.g. `@import`, `@include`)
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkAtkeyword(i) {
- var l;
-
- // Check that token is `@`:
- if (i >= tokensLength ||
- tokens[i++].type !== TokenType.CommercialAt) return 0;
-
- return (l = checkIdent(i)) ? l + 1 : 0;
- }
-
- /**
- * Get node with @-word
- * @returns {Array} `['atkeyword', ['ident', x]]` where `x` is
- * an identifier without
- * `@` (e.g. `import`, `include`)
- */
- function getAtkeyword() {
- var startPos = pos,
- x;
-
- pos++;
-
- x = [NodeType.AtkeywordType, getIdent()];
-
- return x;
- }
-
- /**
- * Check if token is part of an attribute selector (e.g. `[attr]`,
- * `[attr='panda']`)
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkAttrib(i) {
- if (i >= tokensLength ||
- tokens[i].type !== TokenType.LeftSquareBracket ||
- !tokens[i].right) return 0;
-
- return tokens[i].right - i + 1;
- }
-
- /**
- * Get node with an attribute selector
- * @returns {Array} `['attrib', ['ident', x], ['attrselector', y]*, [z]*]`
- * where `x` is attribute's name, `y` is operator (if there is any)
- * and `z` is attribute's value (if there is any)
- */
- function getAttrib() {
- if (checkAttrib1(pos)) return getAttrib1();
- if (checkAttrib2(pos)) return getAttrib2();
- }
-
- /**
- * Check if token is part of an attribute selector of the form `[attr='value']`
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkAttrib1(i) {
- var start = i,
- l;
-
- if (i++ >= tokensLength) return 0;
-
- if (l = checkSC(i)) i += l;
-
- if (l = checkIdent(i)) i += l;
- else return 0;
-
- if (l = checkSC(i)) i += l;
-
- if (l = checkAttrselector(i)) i += l;
- else return 0;
-
- if (l = checkSC(i)) i += l;
-
- if (l = checkIdent(i) || checkString(i)) i += l;
- else return 0;
-
- if (l = checkSC(i)) i += l;
-
- return tokens[i].type === TokenType.RightSquareBracket ? i - start : 0;
- }
-
- /**
- * Get node with an attribute selector of the form `[attr='value']`
- * @returns {Array} `['attrib', ['ident', x], ['attrselector', y], [z]]`
- * where `x` is attribute's name, `y` is operator and `z` is attribute's
- * value
- */
- function getAttrib1() {
- var startPos = pos,
- x;
-
- pos++;
-
- x = [NodeType.AttribType]
- .concat(getSC())
- .concat([getIdent()])
- .concat(getSC())
- .concat([getAttrselector()])
- .concat(getSC())
- .concat([checkString(pos)? getString() : getIdent()])
- .concat(getSC());
-
- pos++;
-
- return x;
- }
-
- /**
- * Check if token is part of an attribute selector of the form `[attr]`
- * Attribute can not be empty, e.g. `[]`.
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkAttrib2(i) {
- var start = i,
- l;
-
- if (i++ >= tokensLength) return 0;
-
- if (l = checkSC(i)) i += l;
-
- if (l = checkIdent(i)) i += l;
- else return 0;
-
- if (l = checkSC(i)) i += l;
-
- return tokens[i].type === TokenType.RightSquareBracket ? i - start : 0;
- }
-
- /**
- * Get node with an attribute selector of the form `[attr]`
- * @returns {Array} `['attrib', ['ident', x]]` where `x` is attribute's name
- */
- function getAttrib2() {
- var startPos = pos,
- x;
-
- pos++;
-
- x = [NodeType.AttribType]
- .concat(getSC())
- .concat([getIdent()])
- .concat(getSC());
-
- pos++;
-
- return x;
- }
-
- /**
- * Check if token is part of an attribute selector operator (`=`, `~=`,
- * `^=`, `$=`, `*=` or `|=`)
- * @param {Number} i Token's index number
- * @returns {Number} Length of operator (`0` if token is not part of an
- * operator, `1` or `2` if it is).
- */
- function checkAttrselector(i) {
- if (i >= tokensLength) return 0;
-
- if (tokens[i].type === TokenType.EqualsSign) return 1;
-
- // TODO: Add example or remove
- if (tokens[i].type === TokenType.VerticalLine &&
- (!tokens[i + 1] || tokens[i + 1].type !== TokenType.EqualsSign))
- return 1;
-
- if (!tokens[i + 1] || tokens[i + 1].type !== TokenType.EqualsSign) return 0;
-
- switch(tokens[i].type) {
- case TokenType.Tilde:
- case TokenType.CircumflexAccent:
- case TokenType.DollarSign:
- case TokenType.Asterisk:
- case TokenType.VerticalLine:
- return 2;
- }
-
- return 0;
- }
-
- /**
- * Get node with an attribute selector operator (`=`, `~=`, `^=`, `$=`,
- * `*=` or `|=`)
- * @returns {Array} `['attrselector', x]` where `x` is an operator.
- */
- function getAttrselector() {
- var startPos = pos,
- s = tokens[pos++].value,
- x;
-
- if (tokens[pos] && tokens[pos].type === TokenType.EqualsSign) s += tokens[pos++].value;
-
- x = [NodeType.AttrselectorType, s];
-
- return x;
- }
-
- /**
- * Check if token is a part of an @-rule
- * @param {Number} i Token's index number
- * @returns {Number} Length of @-rule
- */
- function checkAtrule(i) {
- var l;
-
- if (i >= tokensLength) return 0;
-
- // If token already has a record of being part of an @-rule,
- // return the @-rule's length:
- if (tokens[i].atrule_l !== undefined) return tokens[i].atrule_l;
-
- // If token is part of an @-rule, save the rule's type to token:
- if (l = checkAtruler(i)) tokens[i].atrule_type = 1; // @-rule with ruleset
- else if (l = checkAtruleb(i)) tokens[i].atrule_type = 2; // block @-rule
- else if (l = checkAtrules(i)) tokens[i].atrule_type = 3; // single-line @-rule
- else return 0;
-
- // If token is part of an @-rule, save the rule's length to token:
- tokens[i].atrule_l = l;
-
- return l;
- }
-
- /**
- * Get node with @-rule
- * @returns {Array}
- */
- function getAtrule() {
- switch (tokens[pos].atrule_type) {
- case 1: return getAtruler(); // @-rule with ruleset
- case 2: return getAtruleb(); // block @-rule
- case 3: return getAtrules(); // single-line @-rule
- }
- }
-
- /**
- * Check if token is part of a block @-rule
- * @param {Number} i Token's index number
- * @returns {Number} Length of the @-rule
- */
- function checkAtruleb(i) {
- var start = i,
- l;
-
- if (i >= tokensLength) return 0;
-
- if (l = checkAtkeyword(i)) i += l;
- else return 0;
-
- if (l = checkTsets(i)) i += l;
-
- if (l = checkBlock(i)) i += l;
- else return 0;
-
- return i - start;
- }
-
- /**
- * Get node with a block @-rule
- * @returns {Array} `['atruleb', ['atkeyword', x], y, ['block', z]]`
- */
- function getAtruleb() {
- var startPos = pos,
- x;
-
- x = [NodeType.AtrulebType, getAtkeyword()]
- .concat(getTsets())
- .concat([getBlock()]);
-
- return x;
- }
-
- /**
- * Check if token is part of an @-rule with ruleset
- * @param {Number} i Token's index number
- * @returns {Number} Length of the @-rule
- */
- function checkAtruler(i) {
- var start = i,
- l;
-
- if (i >= tokensLength) return 0;
-
- if (l = checkAtkeyword(i)) i += l;
- else return 0;
-
- if (l = checkAtrulerq(i)) i += l;
-
- if (i < tokensLength && tokens[i].type === TokenType.LeftCurlyBracket) i++;
- else return 0;
-
- if (l = checkAtrulers(i)) i += l;
-
- if (i < tokensLength && tokens[i].type === TokenType.RightCurlyBracket) i++;
- else return 0;
-
- return i - start;
- }
-
- /**
- * Get node with an @-rule with ruleset
- * @returns {Array} ['atruler', ['atkeyword', x], y, z]
- */
- function getAtruler() {
- var startPos = pos,
- x;
-
- x = [NodeType.AtrulerType, getAtkeyword(), getAtrulerq()];
-
- pos++;
-
- x.push(getAtrulers());
-
- pos++;
-
- return x;
- }
-
- /**
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkAtrulerq(i) {
- return checkTsets(i);
- }
-
- /**
- * @returns {Array} `['atrulerq', x]`
- */
- function getAtrulerq() {
- var startPos = pos,
- x;
-
- x = [NodeType.AtrulerqType].concat(getTsets());
-
- return x;
- }
-
- /**
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkAtrulers(i) {
- var start = i,
- l;
-
- if (i >= tokensLength) return 0;
-
- if (l = checkSC(i)) i += l;
-
- while (l = checkRuleset(i) || checkAtrule(i) || checkSC(i)) {
- i += l;
- }
-
- tokens[i].atrulers_end = 1;
-
- if (l = checkSC(i)) i += l;
-
- return i - start;
- }
-
- /**
- * @returns {Array} `['atrulers', x]`
- */
- function getAtrulers() {
- var startPos = pos,
- x;
-
- x = [NodeType.AtrulersType].concat(getSC());
-
- while (!tokens[pos].atrulers_end) {
- if (checkSC(pos)) x = x.concat(getSC());
- else if (checkAtrule(pos)) x.push(getAtrule());
- else if (checkRuleset(pos)) x.push(getRuleset());
- }
-
- x = x.concat(getSC());
-
- return x;
- }
-
- /**
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkAtrules(i) {
- var start = i,
- l;
-
- if (i >= tokensLength) return 0;
-
- if (l = checkAtkeyword(i)) i += l;
- else return 0;
-
- if (l = checkTsets(i)) i += l;
-
- return i - start;
- }
-
- /**
- * @returns {Array} `['atrules', ['atkeyword', x], y]`
- */
- function getAtrules() {
- var startPos = pos,
- x;
-
- x = [NodeType.AtrulesType, getAtkeyword()].concat(getTsets());
-
- return x;
- }
-
- /**
- * Check if token is part of a block (e.g. `{...}`).
- * @param {Number} i Token's index number
- * @returns {Number} Length of the block
- */
- function checkBlock(i) {
- return i < tokensLength && tokens[i].type === TokenType.LeftCurlyBracket ?
- tokens[i].right - i + 1 : 0;
- }
-
- /**
- * Get node with a block
- * @returns {Array} `['block', x]`
- */
- function getBlock() {
- var startPos = pos,
- end = tokens[pos].right,
- x = [NodeType.BlockType];
-
- pos++;
-
-
- while (pos < end) {
- if (checkBlockdecl(pos)) x = x.concat(getBlockdecl());
- else throwError();
- }
-
- pos = end + 1;
-
- return x;
- }
-
- /**
- * Check if token is part of a declaration (property-value pair)
- * @param {Number} i Token's index number
- * @returns {Number} Length of the declaration
- */
- function checkBlockdecl(i) {
- var l;
-
- if (i >= tokensLength) return 0;
-
- if (l = checkBlockdecl1(i)) tokens[i].bd_type = 1;
- else if (l = checkBlockdecl2(i)) tokens[i].bd_type = 2;
- else if (l = checkBlockdecl3(i)) tokens[i].bd_type = 3;
- else if (l = checkBlockdecl4(i)) tokens[i].bd_type = 4;
- else return 0;
-
- return l;
- }
-
- /**
- * @returns {Array}
- */
- function getBlockdecl() {
- switch (tokens[pos].bd_type) {
- case 1: return getBlockdecl1();
- case 2: return getBlockdecl2();
- case 3: return getBlockdecl3();
- case 4: return getBlockdecl4();
- }
- }
-
- /**
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkBlockdecl1(i) {
- var start = i,
- l;
-
- if (l = checkSC(i)) i += l;
-
- if (l = checkFilter(i)) tokens[i].bd_kind = 1;
- else if (l = checkDeclaration(i)) tokens[i].bd_kind = 2;
- else if (l = checkAtrule(i)) tokens[i].bd_kind = 3;
- else return 0;
-
- i += l;
-
- if (l = checkSC(i)) i += l;
-
- if (i < tokensLength && (l = checkDeclDelim(i))) i += l;
- else return 0;
-
- if (l = checkSC(i)) i += l;
- else return 0;
-
- return i - start;
- }
-
- /**
- * sc*:s0 (atrule | ruleset | filter | declaration):x declDelim:y sc*:s1 -> concat(s0, [x], [y], s1)
- * @returns {Array}
- */
- function getBlockdecl1() {
- var sc = getSC(),
- x;
-
- switch (tokens[pos].bd_kind) {
- case 1:
- x = getFilter();
- break;
- case 2:
- x = getDeclaration();
- break;
- case 3:
- x = getAtrule();
- break;
- }
-
- return sc
- .concat([x])
- .concat(getSC())
- .concat([getDeclDelim()])
- .concat(getSC());
- }
-
- /**
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkBlockdecl2(i) {
- var start = i,
- l;
-
- if (l = checkSC(i)) i += l;
-
- if (l = checkFilter(i)) tokens[i].bd_kind = 1;
- else if (l = checkDeclaration(i)) tokens[i].bd_kind = 2;
- else if (l = checkAtrule(i)) tokens[i].bd_kind = 3;
- else return 0;
-
- i += l;
-
- if (l = checkSC(i)) i += l;
-
- return i - start;
- }
-
- /**
- * @returns {Array}
- */
- function getBlockdecl2() {
- var sc = getSC(),
- x;
-
- switch (tokens[pos].bd_kind) {
- case 1:
- x = getFilter();
- break;
- case 2:
- x = getDeclaration();
- break;
- case 3:
- x = getAtrule();
- break;
- }
-
- return sc
- .concat([x])
- .concat(getSC());
- }
-
- /**
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkBlockdecl3(i) {
- var start = i,
- l;
-
- if (l = checkSC(i)) i += l;
-
- if (l = checkDeclDelim(i)) i += l;
- else return 0;
-
- if (l = checkSC(i)) i += l;
-
- return i - start;
- }
-
- /**
- * @returns {Array} `[s0, ['declDelim'], s1]` where `s0` and `s1` are
- * are optional whitespaces.
- */
- function getBlockdecl3() {
- return getSC()
- .concat([getDeclDelim()])
- .concat(getSC());
- }
-
- /**
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkBlockdecl4(i) {
- return checkSC(i);
- }
-
- /**
- * @returns {Array}
- */
- function getBlockdecl4() {
- return getSC();
- }
-
- /**
- * Check if token is part of text inside parentheses or square brackets
- * (e.g. `(1)`)
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkBraces(i) {
- if (i >= tokensLength ||
- (tokens[i].type !== TokenType.LeftParenthesis &&
- tokens[i].type !== TokenType.LeftSquareBracket)) return 0;
-
- return tokens[i].right - i + 1;
- }
-
- /**
- * Get node with text inside parentheses or square brackets (e.g. `(1)`)
- * @returns {Array} `['braces', l, r, x*]` where `l` is a left bracket
- * (e.g. `'('`), `r` is a right bracket (e.g. `')'`) and `x` is
- * parsed text inside those brackets (if there is any)
- * (e.g. `['number', '1']`)
- */
- function getBraces() {
- var startPos = pos,
- left = pos,
- right = tokens[pos].right,
- x;
-
- pos++;
-
- var tsets = getTsets();
-
- pos++;
-
- x = [NodeType.BracesType, tokens[left].value, tokens[right].value]
- .concat(tsets);
-
- return x;
- }
-
- /**
- * Check if token is part of a class selector (e.g. `.abc`)
- * @param {Number} i Token's index number
- * @returns {Number} Length of the class selector
- */
- function checkClass(i) {
- var l;
-
- if (i >= tokensLength) return 0;
-
- if (tokens[i].class_l) return tokens[i].class_l;
-
- if (tokens[i++].type === TokenType.FullStop && (l = checkIdent(i))) {
- tokens[i].class_l = l + 1;
- return l + 1;
- }
-
- return 0;
- }
-
- /**
- * Get node with a class selector
- * @returns {Array} `['class', ['ident', x]]` where x is a class's
- * identifier (without `.`, e.g. `abc`).
- */
- function getClass() {
- var startPos = pos,
- x = [NodeType.ClassType];
-
- pos++;
-
- x.push(getIdent());
-
- return x;
- }
-
- /**
- * Check if token is a combinator (`+`, `>` or `~`)
- * @param {Number} i Token's index number
- * @returns {Number} Length of the combinator
- */
- function checkCombinator(i) {
- if (i >= tokensLength) return 0;
-
- switch (tokens[i].type) {
- case TokenType.PlusSign:
- case TokenType.GreaterThanSign:
- case TokenType.Tilde:
- return 1;
- }
-
- return 0;
- }
-
- /**
- * Get node with a combinator (`+`, `>` or `~`)
- * @returns {Array} `['combinator', x]` where `x` is a combinator
- * converted to string.
- */
- function getCombinator() {
- var startPos = pos,
- x;
-
- x = [NodeType.CombinatorType, tokens[pos++].value];
-
- return x;
- }
-
- /**
- * Check if token is a multiline comment.
- * @param {Number} i Token's index number
- * @returns {Number} `1` if token is a multiline comment, otherwise `0`
- */
- function checkCommentML(i) {
- return i < tokensLength && tokens[i].type === TokenType.CommentML ? 1 : 0;
- }
-
- /**
- * Get node with a multiline comment
- * @returns {Array} `['commentML', x]` where `x`
- * is the comment's text (without `/*` and `* /`).
- */
- function getCommentML() {
- var startPos = pos,
- s = tokens[pos].value.substring(2),
- l = s.length,
- x;
-
- if (s.charAt(l - 2) === '*' && s.charAt(l - 1) === '/') s = s.substring(0, l - 2);
-
- pos++;
-
- x = [NodeType.CommentMLType, s];
-
- return x;
- }
-
- /**
- * Check if token is part of a declaration (property-value pair)
- * @param {Number} i Token's index number
- * @returns {Number} Length of the declaration
- */
- function checkDeclaration(i) {
- var start = i,
- l;
-
- if (i >= tokensLength) return 0;
-
- if (l = checkProperty(i)) i += l;
- else return 0;
-
- if (l = checkSC(i)) i += l;
-
- if (l = checkPropertyDelim(i)) i++;
- else return 0;
-
- if (l = checkSC(i)) i += l;
-
- if (l = checkValue(i)) i += l;
- else return 0;
-
- return i - start;
- }
-
- /**
- * Get node with a declaration
- * @returns {Array} `['declaration', ['property', x], ['propertyDelim'],
- * ['value', y]]`
- */
- function getDeclaration() {
- var startPos = pos,
- x = [NodeType.DeclarationType];
-
- x.push(getProperty());
- x = x.concat(getSC());
- x.push(getPropertyDelim());
- x = x.concat(getSC());
- x.push(getValue());
-
- return x;
- }
-
- /**
- * Check if token is a semicolon
- * @param {Number} i Token's index number
- * @returns {Number} `1` if token is a semicolon, otherwise `0`
- */
- function checkDeclDelim(i) {
- return i < tokensLength && tokens[i].type === TokenType.Semicolon ? 1 : 0;
- }
-
- /**
- * Get node with a semicolon
- * @returns {Array} `['declDelim']`
- */
- function getDeclDelim() {
- var startPos = pos,
- x = [NodeType.DeclDelimType];
-
- pos++;
-
- return x;
- }
-
- /**
- * Check if token is a comma
- * @param {Number} i Token's index number
- * @returns {Number} `1` if token is a comma, otherwise `0`
- */
- function checkDelim(i) {
- return i < tokensLength && tokens[i].type === TokenType.Comma ? 1 : 0;
- }
-
- /**
- * Get node with a comma
- * @returns {Array} `['delim']`
- */
- function getDelim() {
- var startPos = pos,
- x = [NodeType.DelimType];
-
- pos++;
-
- return x;
- }
-
- /**
- * Check if token is part of a number with dimension unit (e.g. `10px`)
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkDimension(i) {
- var ln = checkNumber(i),
- li;
-
- if (i >= tokensLength ||
- !ln ||
- i + ln >= tokensLength) return 0;
-
- return (li = checkNmName2(i + ln)) ? ln + li : 0;
- }
-
- /**
- * Get node of a number with dimension unit
- * @returns {Array} `['dimension', ['number', x], ['ident', y]]` where
- * `x` is a number converted to string (e.g. `'10'`) and `y` is
- * a dimension unit (e.g. `'px'`).
- */
- function getDimension() {
- var startPos = pos,
- x = [NodeType.DimensionType, getNumber()],
- ident = [NodeType.IdentType, getNmName2()];
-
- x.push(ident);
-
- return x;
- }
-
- /**
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkFilter(i) {
- var start = i,
- l;
-
- if (i >= tokensLength) return 0;
-
- if (l = checkFilterp(i)) i += l;
- else return 0;
-
- if (tokens[i].type === TokenType.Colon) i++;
- else return 0;
-
- if (l = checkFilterv(i)) i += l;
- else return 0;
-
- return i - start;
- }
-
- /**
- * @returns {Array} `['filter', x, y]`
- */
- function getFilter() {
- var startPos = pos,
- x = [NodeType.FilterType, getFilterp()];
-
- pos++;
-
- x.push(getFilterv());
-
- return x;
- }
-
- /**
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkFilterp(i) {
- var start = i,
- l,
- x;
-
- if (i >= tokensLength) return 0;
-
- if (tokens[i].value === 'filter') l = 1;
- else {
- x = joinValues2(i, 2);
-
- if (x === '-filter' || x === '_filter' || x === '*filter') l = 2;
- else {
- x = joinValues2(i, 4);
-
- if (x === '-ms-filter') l = 4;
- else return 0;
- }
- }
-
- tokens[start].filterp_l = l;
-
- i += l;
-
- if (checkSC(i)) i += l;
-
- return i - start;
- }
-
- /**
- * @returns {Array}
- */
- function getFilterp() {
- var startPos = pos,
- ident = [NodeType.IdentType, joinValues2(pos, tokens[pos].filterp_l)],
- x;
-
- pos += tokens[pos].filterp_l;
-
- x = [NodeType.PropertyType, ident].concat(getSC());
-
- return x;
- }
-
- /**
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkFilterv(i) {
- var start = i,
- l;
-
- if (i >= tokensLength) return 0;
-
- if (l = checkSC(i)) i += l;
-
- if (l = checkProgid(i)) i += l;
- else return 0;
-
- while (l = checkProgid(i)) {
- i += l;
- }
-
- tokens[start].last_progid = i;
-
- if (i < tokensLength && (l = checkSC(i))) i += l;
-
- if (i < tokensLength && (l = checkImportant(i))) i += l;
-
- return i - start;
- }
-
- /**
- * progid+:x -> [#filterv].concat(x)
- * @returns {Array}
- */
- function getFilterv() {
- var startPos = pos,
- x = [NodeType.FiltervType],
- last_progid = tokens[pos].last_progid;
-
- x = x.concat(getSC());
-
- while (pos < last_progid) {
- x.push(getProgid());
- }
-
- if (checkSC(pos)) x = x.concat(getSC());
-
- if (pos < tokensLength && checkImportant(pos)) x.push(getImportant());
-
- return x;
- }
-
- /**
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkFunctionExpression(i) {
- var start = i;
-
- if (i >= tokensLength || tokens[i++].value !== 'expression' ||
- i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis) return 0;
-
- return tokens[i].right - start + 1;
- }
-
- /**
- * @returns {Array}
- */
- function getFunctionExpression() {
- var startPos = pos,
- x, e;
-
- pos++;
-
- e = joinValues(pos + 1, tokens[pos].right - 1);
-
- pos = tokens[pos].right + 1;
-
- x = [NodeType.FunctionExpressionType, e];
-
- return x;
- }
-
- /**
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkFunction(i) {
- var start = i,
- l;
-
- if (i >= tokensLength) return 0;
-
- if (l = checkIdent(i)) i +=l;
- else return 0;
-
- return i < tokensLength && tokens[i].type === TokenType.LeftParenthesis ?
- tokens[i].right - start + 1 : 0;
- }
-
- /**
- * @returns {Array}
- */
- function getFunction() {
- var startPos = pos,
- ident = getIdent(),
- x = [NodeType.FunctionType, ident],
- body;
-
- body = ident[1] === 'not' ? getNotArguments() : getArguments();
-
- x.push(body);
-
- return x;
- }
-
- /**
- * @returns {Array}
- */
- function getArguments() {
- var startPos = pos,
- x = [NodeType.ArgumentsType],
- body;
-
- pos++;
-
- while (pos < tokensLength && tokens[pos].type !== TokenType.RightParenthesis) {
- if (checkDeclaration(pos)) x.push(getDeclaration());
- else if (checkArgument(pos)) {
- body = getArgument();
- if (typeof body[0] === 'string') x.push(body);
- else x = x.concat(body);
- } else if (checkClass(pos)) x.push(getClass());
- else throwError();
- }
-
- pos++;
-
- return x;
- }
-
- /**
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkArgument(i) {
- return checkVhash(i) ||
- checkAny(i) ||
- checkSC(i) ||
- checkOperator(i);
- }
-
- /**
- * @returns {Array}
- */
- function getArgument() {
- if (checkVhash(pos)) return getVhash();
- else if (checkAny(pos)) return getAny();
- else if (checkSC(pos)) return getSC();
- else if (checkOperator(pos)) return getOperator();
- }
-
- /**
- * @returns {Array}
- */
- function getNotArguments() {
- var startPos = pos,
- x = [NodeType.ArgumentsType];
-
- pos++;
-
- while (pos < tokensLength && tokens[pos].type !== TokenType.RightParenthesis) {
- if (checkSimpleSelector(pos)) x.push(getSimpleSelector());
- else throwError();
- }
-
- pos++;
-
- return x;
- }
-
- /**
- * Check if token is part of an identifier
- * @param {Number} i Token's index number
- * @returns {Number} Length of the identifier
- */
- function checkIdent(i) {
- var start = i,
- wasIdent,
- l;
-
- if (i >= tokensLength) return 0;
-
- // Check if token is part of an identifier starting with `_`:
- if (tokens[i].type === TokenType.LowLine) return checkIdentLowLine(i);
-
- // If token is a character, `-`, `$` or `*`, skip it & continue:
- if (tokens[i].type === TokenType.HyphenMinus ||
- tokens[i].type === TokenType.Identifier ||
- tokens[i].type === TokenType.DollarSign ||
- tokens[i].type === TokenType.Asterisk) i++;
- else return 0;
-
- // Remember if previous token's type was identifier:
- wasIdent = tokens[i - 1].type === TokenType.Identifier;
-
- for (; i < tokensLength; i++) {
- if (i >= tokensLength) break;
-
- if (tokens[i].type !== TokenType.HyphenMinus &&
- tokens[i].type !== TokenType.LowLine) {
- if (tokens[i].type !== TokenType.Identifier &&
- (tokens[i].type !== TokenType.DecimalNumber || !wasIdent)) break;
- else wasIdent = true;
- }
- }
-
- if (!wasIdent && tokens[start].type !== TokenType.Asterisk) return 0;
-
- tokens[start].ident_last = i - 1;
-
- return i - start;
- }
-
- /**
- * Check if token is part of an identifier starting with `_`
- * @param {Number} i Token's index number
- * @returns {Number} Length of the identifier
- */
- function checkIdentLowLine(i) {
- var start = i;
-
- if (i++ >= tokensLength) return 0;
-
- for (; i < tokensLength; i++) {
- if (tokens[i].type !== TokenType.HyphenMinus &&
- tokens[i].type !== TokenType.DecimalNumber &&
- tokens[i].type !== TokenType.LowLine &&
- tokens[i].type !== TokenType.Identifier) break;
- }
-
- // Save index number of the last token of the identifier:
- tokens[start].ident_last = i - 1;
-
- return i - start;
- }
-
- /**
- * Get node with an identifier
- * @returns {Array} `['ident', x]` where `x` is identifier's name
- */
- function getIdent() {
- var startPos = pos,
- x = [NodeType.IdentType, joinValues(pos, tokens[pos].ident_last)];
-
- pos = tokens[pos].ident_last + 1;
-
- return x;
- }
-
- /**
- * Check if token is part of `!important` word
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkImportant(i) {
- var start = i,
- l;
-
- if (i >= tokensLength ||
- tokens[i++].type !== TokenType.ExclamationMark) return 0;
-
- if (l = checkSC(i)) i += l;
-
- return tokens[i].value === 'important' ? i - start + 1 : 0;
- }
-
- /**
- * Get node with `!important` word
- * @returns {Array} `['important', sc]` where `sc` is optional whitespace
- */
- function getImportant() {
- var startPos = pos,
- x = [NodeType.ImportantType];
-
- pos++;
-
- x = x.concat(getSC());
-
- pos++;
-
- return x;
- }
-
- /**
- * Check if token is a namespace sign (`|`)
- * @param {Number} i Token's index number
- * @returns {Number} `1` if token is `|`, `0` if not
- */
- function checkNamespace(i) {
- return i < tokensLength && tokens[i].type === TokenType.VerticalLine ? 1 : 0;
- }
-
- /**
- * Get node with a namespace sign
- * @returns {Array} `['namespace']`
- */
- function getNamespace() {
- var startPos = pos,
- x = [NodeType.NamespaceType];
-
- pos++;
-
- return x;
- }
-
- /**
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkNmName(i) {
- var start = i;
-
- if (i >= tokensLength) return 0;
-
- // start char / word
- if (tokens[i].type === TokenType.HyphenMinus ||
- tokens[i].type === TokenType.LowLine ||
- tokens[i].type === TokenType.Identifier ||
- tokens[i].type === TokenType.DecimalNumber) i++;
- else return 0;
-
- for (; i < tokensLength; i++) {
- if (tokens[i].type !== TokenType.HyphenMinus &&
- tokens[i].type !== TokenType.LowLine &&
- tokens[i].type !== TokenType.Identifier &&
- tokens[i].type !== TokenType.DecimalNumber) break;
- }
-
- tokens[start].nm_name_last = i - 1;
-
- return i - start;
- }
-
- /**
- * @returns {String}
- */
- function getNmName() {
- var s = joinValues(pos, tokens[pos].nm_name_last);
-
- pos = tokens[pos].nm_name_last + 1;
-
- return s;
- }
-
- /**
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkNmName2(i) {
- if (tokens[i].type === TokenType.Identifier) return 1;
- else if (tokens[i].type !== TokenType.DecimalNumber) return 0;
-
- i++;
-
- return i < tokensLength && tokens[i].type === TokenType.Identifier ? 2 : 1;
- }
-
- /**
- * @returns {String}
- */
- function getNmName2() {
- var s = tokens[pos].value;
-
- if (tokens[pos++].type === TokenType.DecimalNumber &&
- pos < tokensLength &&
- tokens[pos].type === TokenType.Identifier) s += tokens[pos++].value;
-
- return s;
- }
-
- /**
- * Check if token is part of an nth-selector's identifier (e.g. `2n+1`)
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkNth(i) {
- if (i >= tokensLength) return 0;
-
- return checkNth1(i) || checkNth2(i);
- }
-
- /**
- * Check if token is part of an nth-selector's identifier in the form of
- * sequence of decimals and n-s (e.g. `3`, `n`, `2n+1`)
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkNth1(i) {
- var start = i;
-
- for (; i < tokensLength; i++) {
- if (tokens[i].type !== TokenType.DecimalNumber &&
- tokens[i].value !== 'n') break;
- }
-
- if (i !== start) tokens[start].nth_last = i - 1;
-
- return i - start;
- }
-
- /**
- * Get node for nth-selector's identifier (e.g. `2n+1`)
- * @returns {Array} `['nth', x]` where `x` is identifier's text
- */
- function getNth() {
- var startPos = pos,
- x = [NodeType.NthType];
-
- if (tokens[pos].nth_last) {
- x.push(joinValues(pos, tokens[pos].nth_last));
- pos = tokens[pos].nth_last + 1;
- } else {
- x.push(tokens[pos++].value);
- }
-
- return x;
- }
-
- /**
- * Check if token is part of `even` or `odd` nth-selector's identifier
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkNth2(i) {
- return tokens[i].value === 'even' || tokens[i].value === 'odd' ? 1 : 0;
- }
-
- /**
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkNthf(i) {
- var start = i,
- l = 0;
-
- if (tokens[i++].type !== TokenType.Colon) return 0;
-
- // There was `:`:
- l++;
-
- if (tokens[i++].value !== 'nth' || tokens[i++].value !== '-') return 0;
-
- // There was either `nth-` or `last-`:
- l += 2;
-
- if ('child' === tokens[i].value) {
- l += 1;
- } else if ('last-child' === tokens[i].value +
- tokens[i + 1].value +
- tokens[i + 2].value) {
- l += 3;
- } else if ('of-type' === tokens[i].value +
- tokens[i + 1].value +
- tokens[i + 2].value) {
- l += 3;
- } else if ('last-of-type' === tokens[i].value +
- tokens[i + 1].value +
- tokens[i + 2].value +
- tokens[i + 3].value +
- tokens[i + 4].value) {
- l += 5;
- } else return 0;
-
- tokens[start + 1].nthf_last = start + l - 1;
-
- return l;
- }
-
- /**
- * @returns {String}
- */
- function getNthf() {
- pos++;
-
- var s = joinValues(pos, tokens[pos].nthf_last);
-
- pos = tokens[pos].nthf_last + 1;
-
- return s;
- }
-
- /**
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkNthselector(i) {
- var start = i,
- l;
-
- if (i >= tokensLength) return 0;
-
- if (l = checkNthf(i)) i += l;
- else return 0;
-
- if (tokens[i].type !== TokenType.LeftParenthesis || !tokens[i].right) return 0;
-
- l++;
-
- var rp = tokens[i++].right;
-
- while (i < rp) {
- if (l = checkSC(i) ||
- checkUnary(i) ||
- checkNth(i)) i += l;
- else return 0;
- }
-
- return rp - start + 1;
- }
-
- /**
- * @returns {Array}
- */
- function getNthselector() {
- var startPos = pos,
- nthf = [NodeType.IdentType, getNthf()],
- x = [NodeType.NthselectorType];
-
- x.push(nthf);
-
- pos++;
-
- while (tokens[pos].type !== TokenType.RightParenthesis) {
- if (checkSC(pos)) x = x.concat(getSC());
- else if (checkUnary(pos)) x.push(getUnary());
- else if (checkNth(pos)) x.push(getNth());
- }
-
- pos++;
-
- return x;
- }
-
- /**
- * Check if token is part of a number
- * @param {Number} i Token's index number
- * @returns {Number} Length of number
- */
- function checkNumber(i) {
- if (i >= tokensLength) return 0;
-
- if (tokens[i].number_l) return tokens[i].number_l;
-
- // `10`:
- if (i < tokensLength && tokens[i].type === TokenType.DecimalNumber &&
- (!tokens[i + 1] ||
- (tokens[i + 1] && tokens[i + 1].type !== TokenType.FullStop)))
- return (tokens[i].number_l = 1, tokens[i].number_l);
-
- // `10.`:
- if (i < tokensLength &&
- tokens[i].type === TokenType.DecimalNumber &&
- tokens[i + 1] && tokens[i + 1].type === TokenType.FullStop &&
- (!tokens[i + 2] || (tokens[i + 2].type !== TokenType.DecimalNumber)))
- return (tokens[i].number_l = 2, tokens[i].number_l);
-
- // `.10`:
- if (i < tokensLength &&
- tokens[i].type === TokenType.FullStop &&
- tokens[i + 1].type === TokenType.DecimalNumber)
- return (tokens[i].number_l = 2, tokens[i].number_l);
-
- // `10.10`:
- if (i < tokensLength &&
- tokens[i].type === TokenType.DecimalNumber &&
- tokens[i + 1] && tokens[i + 1].type === TokenType.FullStop &&
- tokens[i + 2] && tokens[i + 2].type === TokenType.DecimalNumber)
- return (tokens[i].number_l = 3, tokens[i].number_l);
-
- return 0;
- }
-
- /**
- * Get node with number
- * @returns {Array} `['number', x]` where `x` is a number converted
- * to string.
- */
- function getNumber() {
- var s = '',
- startPos = pos,
- l = tokens[pos].number_l,
- x = [NodeType.NumberType];
-
- for (var j = 0; j < l; j++) {
- s += tokens[pos + j].value;
- }
-
- pos += l;
-
- x.push(s);
-
- return x;
- }
-
- /**
- * Check if token is an operator (`/`, `,`, `:` or `=`).
- * @param {Number} i Token's index number
- * @returns {Number} `1` if token is an operator, otherwise `0`
- */
- function checkOperator(i) {
- if (i >= tokensLength) return 0;
-
- switch(tokens[i].type) {
- case TokenType.Solidus:
- case TokenType.Comma:
- case TokenType.Colon:
- case TokenType.EqualsSign:
- return 1;
- }
-
- return 0;
- }
-
- /**
- * Get node with an operator
- * @returns {Array} `['operator', x]` where `x` is an operator converted
- * to string.
- */
- function getOperator() {
- var startPos = pos,
- x = [NodeType.OperatorType, tokens[pos++].value];
-
- return x;
- }
-
- /**
- * Check if token is part of a number with percent sign (e.g. `10%`)
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkPercentage(i) {
- var x;
-
- if (i >= tokensLength) return 0;
-
- x = checkNumber(i);
-
- if (!x || i + x >= tokensLength) return 0;
-
- return tokens[i + x].type === TokenType.PercentSign ? x + 1 : 0;
- }
-
- /**
- * Get node of number with percent sign
- * @returns {Array} `['percentage', ['number', x]]` where `x` is a number
- * (without percent sign) converted to string.
- */
- function getPercentage() {
- var startPos = pos,
- x = [NodeType.PercentageType, getNumber()];
-
- pos++;
-
- return x;
- }
-
- /**
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkProgid(i) {
- var start = i,
- l;
-
- if (i >= tokensLength) return 0;
-
- if (l = checkSC(i)) i += l;
-
- if (joinValues2(i, 6) === 'progid:DXImageTransform.Microsoft.') i += 6;
- else return 0;
-
- if (l = checkIdent(i)) i += l;
- else return 0;
-
- if (l = checkSC(i)) i += l;
-
- if (tokens[i].type === TokenType.LeftParenthesis) {
- tokens[start].progid_end = tokens[i].right;
- i = tokens[i].right + 1;
- } else return 0;
-
- if (l = checkSC(i)) i += l;
-
- return i - start;
- }
-
- /**
- * @returns {Array}
- */
- function getProgid() {
- var startPos = pos,
- progid_end = tokens[pos].progid_end,
- x;
-
- x = [NodeType.ProgidType]
- .concat(getSC())
- .concat([_getProgid(progid_end)])
- .concat(getSC());
-
- return x;
- }
-
- /**
- * @param {Number} progid_end
- * @returns {Array}
- */
- function _getProgid(progid_end) {
- var startPos = pos,
- x = [NodeType.RawType, joinValues(pos, progid_end)];
-
- pos = progid_end + 1;
-
- return x;
- }
-
- /**
- * Check if token is part of a property
- * @param {Number} i Token's index number
- * @returns {Number} Length of the property
- */
- function checkProperty(i) {
- var start = i,
- l;
-
- if (i >= tokensLength) return 0;
-
- if (l = checkIdent(i)) i += l;
- else return 0;
-
- return i - start;
- }
-
- /**
- * Get node with a property
- * @returns {Array} `['property', x]`
- */
- function getProperty() {
- var startPos = pos,
- x = [NodeType.PropertyType];
-
- x.push(getIdent());
-
- return x;
- }
-
- /**
- * Check if token is a colon
- * @param {Number} i Token's index number
- * @returns {Number} `1` if token is a colon, otherwise `0`
- */
- function checkPropertyDelim(i) {
- return i < tokensLength && tokens[i].type === TokenType.Colon ? 1 : 0;
- }
-
- /**
- * Get node with a colon
- * @returns {Array} `['propertyDelim']`
- */
- function getPropertyDelim() {
- var startPos = pos,
- x = [NodeType.PropertyDelimType];
-
- pos++;
-
- return x;
- }
-
- /**
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkPseudo(i) {
- return checkPseudoe(i) ||
- checkPseudoc(i);
- }
-
- /**
- * @returns {Array}
- */
- function getPseudo() {
- if (checkPseudoe(pos)) return getPseudoe();
- if (checkPseudoc(pos)) return getPseudoc();
- }
-
- /**
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkPseudoe(i) {
- var l;
-
- if (i >= tokensLength || tokens[i++].type !== TokenType.Colon ||
- i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0;
-
- return (l = checkIdent(i)) ? l + 2 : 0;
- }
-
- /**
- * @returns {Array}
- */
- function getPseudoe() {
- var startPos = pos,
- x = [NodeType.PseudoeType];
-
- pos += 2;
-
- x.push(getIdent());
-
- return x;
- }
-
- /**
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkPseudoc(i) {
- var l;
-
- if (i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0;
-
- return (l = checkFunction(i) || checkIdent(i)) ? l + 1 : 0;
- }
-
- /**
- * @returns {Array}
- */
- function getPseudoc() {
- var startPos = pos,
- x = [NodeType.PseudocType];
-
- pos ++;
-
- x.push(checkFunction(pos) ? getFunction() : getIdent());
-
- return x;
- }
-
- /**
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkRuleset(i) {
- var start = i,
- l;
-
- if (i >= tokensLength) return 0;
-
- if (tokens[start].ruleset_l) return tokens[start].ruleset_l;
-
- while (i < tokensLength) {
- if (l = checkBlock(i)) {i += l; break;}
- else if (l = checkSelector(i)) i += l;
- else return 0;
- }
-
- tokens[start].ruleset_l = i - start;
-
- return i - start;
- }
-
- /**
- * @returns {Array}
- */
- function getRuleset() {
- var startPos = pos,
- x = [NodeType.RulesetType];
-
- while (pos < tokensLength) {
- if (checkBlock(pos)) {x.push(getBlock()); break;}
- else if (checkSelector(pos)) x.push(getSelector());
- else break;
- }
-
- return x;
- }
-
- /**
- * Check if token is marked as a space (if it's a space or a tab
- * or a line break).
- * @param i
- * @returns {Number} Number of spaces in a row starting with the given token.
- */
- function checkS(i) {
- return i < tokensLength && tokens[i].ws ? tokens[i].ws_last - i + 1 : 0;
- }
-
- /**
- * Get node with spaces
- * @returns {Array} `['s', x]` where `x` is a string containing spaces
- */
- function getS() {
- var startPos = pos,
- x = [NodeType.SType, joinValues(pos, tokens[pos].ws_last)];
-
- pos = tokens[pos].ws_last + 1;
-
- return x;
- }
-
- /**
- * Check if token is a space or a comment.
- * @param {Number} i Token's index number
- * @returns {Number} Number of similar (space or comment) tokens
- * in a row starting with the given token.
- */
- function checkSC(i) {
- var l,
- lsc = 0;
-
- while (i < tokensLength) {
- if (!(l = checkS(i)) &&
- !(l = checkCommentML(i))) break;
- i += l;
- lsc += l;
- }
-
- return lsc || 0;
- }
-
- /**
- * Get node with spaces and comments
- * @returns {Array} Array containing nodes with spaces (if there are any)
- * and nodes with comments (if there are any):
- * `[['s', x]*, ['comment', y]*]` where `x` is a string of spaces
- * and `y` is a comment's text (without `/*` and `* /`).
- */
- function getSC() {
- var sc = [];
-
- if (pos >= tokensLength) return sc;
-
- while (pos < tokensLength) {
- if (checkS(pos)) sc.push(getS());
- else if (checkCommentML(pos)) sc.push(getCommentML());
- else break;
- }
-
- return sc;
- }
-
- /**
- * Check if token is part of a selector
- * @param {Number} i Token's index number
- * @returns {Number} Length of the selector
- */
- function checkSelector(i) {
- var start = i,
- l;
-
- while (i < tokensLength) {
- if (l = checkSimpleSelector(i) || checkDelim(i)) i += l;
- else break;
- }
-
- if (i !== start) tokens[start].selector_end = i - 1;
-
- return i - start;
- }
-
- /**
- * @returns {Array}
- */
- function getSelector() {
- var startPos = pos,
- x = [NodeType.SelectorType],
- selector_end = tokens[pos].selector_end;
-
- while (pos <= selector_end) {
- x.push(checkDelim(pos) ? getDelim() : getSimpleSelector());
- }
-
- return x;
- }
-
- /**
- * Check if token is part of a hexadecimal number (e.g. `#fff`) inside
- * a simple selector
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkShash(i) {
- var l;
-
- if (i >= tokensLength || tokens[i].type !== TokenType.NumberSign) return 0;
-
- return (l = checkNmName(i + 1)) ? l + 1 : 0;
- }
-
- /**
- * Get node with a hexadecimal number (e.g. `#fff`) inside a simple
- * selector
- * @returns {Array} `['shash', x]` where `x` is a hexadecimal number
- * converted to string (without `#`, e.g. `fff`)
- */
- function getShash() {
- var startPos = pos,
- x = [NodeType.ShashType];
-
- pos++;
-
- x.push(getNmName());
-
- return x;
- }
-
- /**
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkSimpleSelector(i) {
- var start = i,
- l;
-
- while (i < tokensLength) {
- if (l = checkSimpleSelector1(i)) i += l;
- else break;
- }
-
- return i - start;
- }
-
- /**
- * @returns {Array}
- */
- function getSimpleSelector() {
- var startPos = pos,
- x = [NodeType.SimpleselectorType],
- t;
-
- while (pos < tokensLength) {
- if (!checkSimpleSelector1(pos)) break;
- t = getSimpleSelector1();
-
- if (typeof t[0] === 'string') x.push(t);
- else x = x.concat(t);
- }
-
- return x;
- }
-
- /**
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkSimpleSelector1(i) {
- return checkNthselector(i) ||
- checkCombinator(i) ||
- checkAttrib(i) ||
- checkPseudo(i) ||
- checkShash(i) ||
- checkAny(i) ||
- checkSC(i) ||
- checkNamespace(i);
- }
-
- /**
- * @returns {Array}
- */
- function getSimpleSelector1() {
- if (checkNthselector(pos)) return getNthselector();
- else if (checkCombinator(pos)) return getCombinator();
- else if (checkAttrib(pos)) return getAttrib();
- else if (checkPseudo(pos)) return getPseudo();
- else if (checkShash(pos)) return getShash();
- else if (checkAny(pos)) return getAny();
- else if (checkSC(pos)) return getSC();
- else if (checkNamespace(pos)) return getNamespace();
- }
-
- /**
- * Check if token is part of a string (text wrapped in quotes)
- * @param {Number} i Token's index number
- * @returns {Number} `1` if token is part of a string, `0` if not
- */
- function checkString(i) {
- return i < tokensLength && (tokens[i].type === TokenType.StringSQ || tokens[i].type === TokenType.StringDQ) ? 1 : 0;
- }
-
- /**
- * Get string's node
- * @returns {Array} `['string', x]` where `x` is a string (including
- * quotes).
- */
- function getString() {
- var startPos = pos,
- x = [NodeType.StringType, tokens[pos++].value];
-
- return x;
- }
-
- /**
- * Validate stylesheet: it should consist of any number (0 or more) of
- * rulesets (sets of rules with selectors), @-rules, whitespaces or
- * comments.
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkStylesheet(i) {
- var start = i,
- l;
-
- // Check every token:
- while (i < tokensLength) {
- if (l = checkSC(i) ||
- checkDeclDelim(i) ||
- checkAtrule(i) ||
- checkRuleset(i)) i += l;
- else throwError(i);
- }
-
- return i - start;
- }
-
- /**
- * @returns {Array} `['stylesheet', x]` where `x` is all stylesheet's
- * nodes.
- */
- function getStylesheet() {
- var startPos = pos,
- x = [NodeType.StylesheetType];
-
- while (pos < tokensLength) {
- if (checkSC(pos)) x = x.concat(getSC());
- else if (checkRuleset(pos)) x.push(getRuleset());
- else if (checkAtrule(pos)) x.push(getAtrule());
- else if (checkDeclDelim(pos)) x.push(getDeclDelim());
- else throwError();
- }
-
- return x;
- }
-
- /**
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkTset(i) {
- return checkVhash(i) ||
- checkAny(i) ||
- checkSC(i) ||
- checkOperator(i);
- }
-
- /**
- * @returns {Array}
- */
- function getTset() {
- if (checkVhash(pos)) return getVhash();
- else if (checkAny(pos)) return getAny();
- else if (checkSC(pos)) return getSC();
- else if (checkOperator(pos)) return getOperator();
- }
-
- /**
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkTsets(i) {
- var start = i,
- l;
-
- if (i >= tokensLength) return 0;
-
- while (l = checkTset(i)) {
- i += l;
- }
-
- return i - start;
- }
-
- /**
- * @returns {Array}
- */
- function getTsets() {
- var x = [],
- t;
-
- while (t = getTset()) {
- if (typeof t[0] === 'string') x.push(t);
- else x = x.concat(t);
- }
-
- return x;
- }
-
- /**
- * Check if token is an unary (arithmetical) sign (`+` or `-`)
- * @param {Number} i Token's index number
- * @returns {Number} `1` if token is an unary sign, `0` if not
- */
- function checkUnary(i) {
- return i < tokensLength && (tokens[i].type === TokenType.HyphenMinus || tokens[i].type === TokenType.PlusSign) ? 1 : 0;
- }
-
- /**
- * Get node with an unary (arithmetical) sign (`+` or `-`)
- * @returns {Array} `['unary', x]` where `x` is an unary sign
- * converted to string.
- */
- function getUnary() {
- var startPos = pos,
- x = [NodeType.UnaryType, tokens[pos++].value];
-
- return x;
- }
-
- /**
- * Check if token is part of URI (e.g. `url('/css/styles.css')`)
- * @param {Number} i Token's index number
- * @returns {Number} Length of URI
- */
- function checkUri(i) {
- var start = i;
-
- if (i >= tokensLength || tokens[i++].value !== 'url' ||
- i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis)
- return 0;
-
- return tokens[i].right - start + 1;
- }
-
- /**
- * Get node with URI
- * @returns {Array} `['uri', x]` where `x` is URI's nodes (without `url`
- * and braces, e.g. `['string', ''/css/styles.css'']`).
- */
- function getUri() {
- var startPos = pos,
- uriExcluding = {},
- uri,
- l,
- raw;
-
- pos += 2;
-
- uriExcluding[TokenType.Space] = 1;
- uriExcluding[TokenType.Tab] = 1;
- uriExcluding[TokenType.Newline] = 1;
- uriExcluding[TokenType.LeftParenthesis] = 1;
- uriExcluding[TokenType.RightParenthesis] = 1;
-
- if (checkUri1(pos)) {
- uri = [NodeType.UriType]
- .concat(getSC())
- .concat([getString()])
- .concat(getSC());
-
- pos++;
- } else {
- uri = [NodeType.UriType].concat(getSC()),
- l = checkExcluding(uriExcluding, pos),
- raw = [NodeType.RawType, joinValues(pos, pos + l)];
-
- uri.push(raw);
-
- pos += l + 1;
-
- uri = uri.concat(getSC());
-
- pos++;
- }
-
- return uri;
- }
-
- /**
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkUri1(i) {
- var start = i,
- l;
-
- if (i >= tokensLength) return 0;
-
- if (l = checkSC(i)) i += l;
-
- if (tokens[i].type !== TokenType.StringDQ && tokens[i].type !== TokenType.StringSQ) return 0;
-
- i++;
-
- if (l = checkSC(i)) i += l;
-
- return i - start;
- }
-
- /**
- * Check if token is part of a value
- * @param {Number} i Token's index number
- * @returns {Number} Length of the value
- */
- function checkValue(i) {
- var start = i,
- l, s, _i;
-
- while (i < tokensLength) {
- s = checkSC(i);
- _i = i + s;
-
- if (l = _checkValue(_i)) i += l + s;
- else break;
- }
-
- return i - start;
- }
-
- /**
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function _checkValue(i) {
- return checkVhash(i) ||
- checkAny(i) ||
- checkOperator(i) ||
- checkImportant(i);
- }
-
- /**
- * @returns {Array}
- */
- function getValue() {
- var startPos = pos,
- x = [NodeType.ValueType],
- s, _pos;
-
- while (pos < tokensLength) {
- s = checkSC(pos);
- _pos = pos + s;
-
- if (!_checkValue(_pos)) break;
-
- if (s) x = x.concat(getSC());
- x.push(_getValue());
- }
-
- return x;
- }
-
- /**
- * @returns {Array}
- */
- function _getValue() {
- if (checkVhash(pos)) return getVhash();
- else if (checkAny(pos)) return getAny();
- else if (checkOperator(pos)) return getOperator();
- else if (checkImportant(pos)) return getImportant();
- }
-
- /**
- * Check if token is part of a hexadecimal number (e.g. `#fff`) inside
- * some value
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkVhash(i) {
- var l;
-
- if (i >= tokensLength || tokens[i].type !== TokenType.NumberSign) return 0;
-
- return (l = checkNmName2(i + 1)) ? l + 1 : 0;
- }
-
- /**
- * Get node with a hexadecimal number (e.g. `#fff`) inside some value
- * @returns {Array} `['vhash', x]` where `x` is a hexadecimal number
- * converted to string (without `#`, e.g. `'fff'`).
- */
- function getVhash() {
- var startPos = pos,
- x = [NodeType.VhashType];
-
- pos++;
-
- x.push(getNmName2());
-
- return x;
- }
-
- return function(_tokens, rule) {
- tokens = _tokens;
- tokensLength = tokens.length;
- pos = 0;
-
- return rules[rule]();
- };
-})();
diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/css/stringify.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/css/stringify.js
deleted file mode 100644
index 166f77e..0000000
--- a/node_modules/csscomb/node_modules/gonzales-pe/lib/css/stringify.js
+++ /dev/null
@@ -1,97 +0,0 @@
-module.exports = function stringify(tree) {
- // TODO: Better error message
- if (!tree) throw new Error('We need tree to translate');
-
- var _m_simple = {
- 'attrselector': 1, 'combinator': 1, 'nth': 1, 'number': 1,
- 'operator': 1, 'raw': 1, 's': 1, 'string': 1, 'unary': 1
- },
- _m_composite = {
- 'atruleb': 1, 'atrulerq': 1, 'atrulers': 1, 'atrules': 1,
- 'declaration': 1, 'dimension': 1, 'filterv': 1, 'function': 1,
- 'ident': 1, 'selector': 1, 'progid': 1, 'property': 1,
- 'ruleset': 1, 'simpleselector': 1, 'stylesheet': 1, 'value': 1
- },
- _m_primitive = {
- 'declDelim': ';', 'delim': ',', 'namespace': '|',
- 'propertyDelim' : ':'
- };
-
- function _t(tree) {
- var t = tree[0];
- if (t in _m_primitive) return _m_primitive[t];
- else if (t in _m_simple) return _simple(tree);
- else if (t in _m_composite) return _composite(tree);
- return _unique[t](tree);
- }
-
- function _composite(t, i) {
- var s = '';
- i = i === undefined ? 1 : i;
- for (; i < t.length; i++) s += typeof t[i] === 'string' ? t[i] : _t(t[i]);
- return s;
- }
-
- function _simple(t) {
- return t[1];
- }
-
- var _unique = {
- 'arguments': function(t) {
- return '(' + _composite(t) + ')';
- },
- 'atkeyword': function(t) {
- return '@' + _t(t[1]);
- },
- 'atruler': function(t) {
- return _t(t[1]) + _t(t[2]) + '{' + _t(t[3]) + '}';
- },
- 'attrib': function(t) {
- return '[' + _composite(t) + ']';
- },
- 'block': function(t) {
- return '{' + _composite(t) + '}';
- },
- 'braces': function(t) {
- return t[1] + _composite(t, 3) + t[2];
- },
- 'class': function(t) {
- return '.' + _t(t[1]);
- },
- 'commentML': function (t) {
- return '/*' + t[1] + '*/';
- },
- 'filter': function(t) {
- return _t(t[1]) + ':' + _t(t[2]);
- },
- 'functionExpression': function(t) {
- return 'expression(' + t[1] + ')';
- },
- 'important': function(t) {
- return '!' + _composite(t) + 'important';
- },
- 'nthselector': function(t) {
- return ':' + _simple(t[1]) + '(' + _composite(t, 2) + ')';
- },
- 'percentage': function(t) {
- return _t(t[1]) + '%';
- },
- 'pseudoc': function(t) {
- return ':' + _t(t[1]);
- },
- 'pseudoe': function(t) {
- return '::' + _t(t[1]);
- },
- 'shash': function (t) {
- return '#' + t[1];
- },
- 'uri': function(t) {
- return 'url(' + _composite(t) + ')';
- },
- 'vhash': function(t) {
- return '#' + t[1];
- }
- };
-
- return _t(tree);
-}
diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/gonzales.ast-to-css.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/gonzales.ast-to-css.js
deleted file mode 100644
index 911aac3..0000000
--- a/node_modules/csscomb/node_modules/gonzales-pe/lib/gonzales.ast-to-css.js
+++ /dev/null
@@ -1,121 +0,0 @@
-function astToCSS(options) {
- var tree, hasInfo, syntax;
- if (!options) throw new Error('We need tree to translate');
- tree = typeof options === 'string' ? options : options.ast;
- hasInfo = typeof tree[0] === 'object';
- syntax = options.syntax || 'css';
- var _m_simple = {
- 'attrselector': 1, 'combinator': 1, 'ident': 1, 'nth': 1, 'number': 1,
- 'operator': 1, 'raw': 1, 's': 1, 'string': 1, 'unary': 1, 'unknown': 1
- },
- _m_composite = {
- 'atruleb': 1, 'atrulerq': 1, 'atrulers': 1, 'atrules': 1,'condition': 1,
- 'declaration': 1, 'dimension': 1, 'filterv': 1, 'include': 1,
- 'loop': 1, 'mixin': 1, 'selector': 1, 'progid': 1, 'property': 1,
- 'ruleset': 1, 'simpleselector': 1, 'stylesheet': 1, 'value': 1
- },
- _m_primitive = {
- 'cdc': 'cdc', 'cdo': 'cdo',
- 'declDelim': syntax === 'sass' ? '\n' : ';',
- 'delim': ',',
- 'namespace': '|', 'parentselector': '&', 'propertyDelim' : ':'
- };
- function _t(tree) {
- var t = tree[hasInfo? 1 : 0];
- if (t in _m_primitive) return _m_primitive[t];
- else if (t in _m_simple) return _simple(tree);
- else if (t in _m_composite) return _composite(tree);
- return _unique[t](tree);
- }
- function _composite(t, i) {
- var s = '';
- i = i === undefined ? (hasInfo? 2 : 1) : i;
- for (; i < t.length; i++) s += _t(t[i]);
- return s;
- }
- function _simple(t) {
- return t[hasInfo? 2 : 1];
- }
- var _unique = {
- 'arguments': function(t) {
- return '(' + _composite(t) + ')';
- },
- 'atkeyword': function(t) {
- return '@' + _t(t[hasInfo? 2 : 1]);
- },
- 'atruler': function(t) {
- return _t(t[hasInfo? 2 : 1]) + _t(t[hasInfo? 3 : 2]) + '{' + _t(t[hasInfo? 4 : 3]) + '}';
- },
- 'attrib': function(t) {
- return '[' + _composite(t) + ']';
- },
- 'block': function(t) {
- return syntax === 'sass' ? _composite(t) : '{' + _composite(t) + '}';
- },
- 'braces': function(t) {
- return t[hasInfo? 2 : 1] + _composite(t, hasInfo? 4 : 3) + t[hasInfo? 3 : 2];
- },
- 'class': function(t) {
- return '.' + _t(t[hasInfo? 2 : 1]);
- },
- 'commentML': function (t) {
- return '/*' + t[hasInfo? 2 : 1] + (syntax === 'sass' ? '' : '*/');
- },
- 'commentSL': function (t) {
- return '/' + '/' + t[hasInfo? 2 : 1];
- },
- 'default': function(t) {
- return '!' + _composite(t) + 'default';
- },
- 'escapedString': function(t) {
- return '~' + t[hasInfo? 2 : 1];
- },
- 'filter': function(t) {
- return _t(t[hasInfo? 2 : 1]) + ':' + _t(t[hasInfo? 3 : 2]);
- },
- 'functionExpression': function(t) {
- return 'expression(' + t[hasInfo? 2 : 1] + ')';
- },
- 'function': function(t) {
- return _simple(t[hasInfo? 2 : 1]) + '(' + _composite(t[hasInfo? 3: 2]) + ')';
- },
- 'important': function(t) {
- return '!' + _composite(t) + 'important';
- },
- 'interpolatedVariable': function(t) {
- return (syntax === 'less' ? '@{' : '#\{$') + _t(t[hasInfo? 2 : 1]) + '}';
- },
- 'nthselector': function(t) {
- return ':' + _simple(t[hasInfo? 2 : 1]) + '(' + _composite(t, hasInfo? 3 : 2) + ')';
- },
- 'percentage': function(t) {
- return _t(t[hasInfo? 2 : 1]) + '%';
- },
- 'placeholder': function(t) {
- return '%' + _t(t[hasInfo? 2 : 1]);
- },
- 'pseudoc': function(t) {
- return ':' + _t(t[hasInfo? 2 : 1]);
- },
- 'pseudoe': function(t) {
- return '::' + _t(t[hasInfo? 2 : 1]);
- },
- 'shash': function (t) {
- return '#' + t[hasInfo? 2 : 1];
- },
- 'uri': function(t) {
- return 'url(' + _composite(t) + ')';
- },
- 'variable': function(t) {
- return (syntax === 'less' ? '@' : '$') + _t(t[hasInfo? 2 : 1]);
- },
- 'variableslist': function(t) {
- return _t(t[hasInfo? 2 : 1]) + '...';
- },
- 'vhash': function(t) {
- return '#' + t[hasInfo? 2 : 1];
- }
- };
- return _t(tree);
-}
-exports.astToCSS = astToCSS;
diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/gonzales.css-to-ast.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/gonzales.css-to-ast.js
deleted file mode 100644
index 1d30504..0000000
--- a/node_modules/csscomb/node_modules/gonzales-pe/lib/gonzales.css-to-ast.js
+++ /dev/null
@@ -1,3832 +0,0 @@
-var cssToAST = (function() {
- var syntaxes = {},
- s,
- needInfo,
- tokens,
- tokensLength,
- tn = 0,
- ln = 1,
- pos = 0;
- function pushToken(type, value) {
- tokens.push({ tn: tn++, ln: ln, type: type, value: value });
- }
- function throwError(i) {
- var ln = i ? tokens[i].ln : tokens[pos].ln;
- throw new Error('Please check the validity of the CSS block starting from the line #' + ln);
- }
- function getInfo(i) {
- return { ln: tokens[i].ln, tn: tokens[i].tn };
- }
- function checkExcluding(exclude, i) {
- var start = i;
- while(i < tokensLength) {
- if (exclude[tokens[i++].type]) break;
- }
- return i - start - 2;
- }
- function joinValues(start, finish) {
- var s = '';
- for (var i = start; i < finish + 1; i++) {
- s += tokens[i].value;
- }
- return s;
- }
- function joinValues2(start, num) {
- if (start + num - 1 >= tokensLength) return;
- var s = '';
- for (var i = 0; i < num; i++) {
- s += tokens[start + i].value;
- }
- return s;
- }
-var TokenType = {
- StringSQ: 'StringSQ',
- StringDQ: 'StringDQ',
- CommentML: 'CommentML',
- CommentSL: 'CommentSL',
- Newline: 'Newline',
- Space: 'Space',
- Tab: 'Tab',
- ExclamationMark: 'ExclamationMark',
- QuotationMark: 'QuotationMark',
- NumberSign: 'NumberSign',
- DollarSign: 'DollarSign',
- PercentSign: 'PercentSign',
- Ampersand: 'Ampersand',
- Apostrophe: 'Apostrophe',
- LeftParenthesis: 'LeftParenthesis',
- RightParenthesis: 'RightParenthesis',
- Asterisk: 'Asterisk',
- PlusSign: 'PlusSign',
- Comma: 'Comma',
- HyphenMinus: 'HyphenMinus',
- FullStop: 'FullStop',
- Solidus: 'Solidus',
- Colon: 'Colon',
- Semicolon: 'Semicolon',
- LessThanSign: 'LessThanSign',
- EqualsSign: 'EqualsSign',
- GreaterThanSign: 'GreaterThanSign',
- QuestionMark: 'QuestionMark',
- CommercialAt: 'CommercialAt',
- LeftSquareBracket: 'LeftSquareBracket',
- ReverseSolidus: 'ReverseSolidus',
- RightSquareBracket: 'RightSquareBracket',
- CircumflexAccent: 'CircumflexAccent',
- LowLine: 'LowLine',
- LeftCurlyBracket: 'LeftCurlyBracket',
- VerticalLine: 'VerticalLine',
- RightCurlyBracket: 'RightCurlyBracket',
- Tilde: 'Tilde',
- Identifier: 'Identifier',
- DecimalNumber: 'DecimalNumber'
-};
-var NodeType = {
- ArgumentsType: 'arguments',
- AtkeywordType: 'atkeyword',
- AtrulebType: 'atruleb',
- AtrulerType: 'atruler',
- AtrulerqType: 'atrulerq',
- AtrulersType: 'atrulers',
- AtrulesType: 'atrules',
- AttribType: 'attrib',
- AttrselectorType: 'attrselector',
- BlockType: 'block',
- BracesType: 'braces',
- CdcType: 'cdc',
- CdoType: 'cdo',
- ClassType: 'class',
- CombinatorType: 'combinator',
- CommentMLType: 'commentML',
- CommentSLType: 'commentSL',
- ConditionType: 'condition',
- DeclarationType: 'declaration',
- DeclDelimType: 'declDelim',
- DefaultType: 'default',
- DelimType: 'delim',
- DimensionType: 'dimension',
- EscapedStringType: 'escapedString',
- FilterType: 'filter',
- FiltervType: 'filterv',
- FunctionType: 'function',
- FunctionBodyType: 'functionBody',
- FunctionExpressionType: 'functionExpression',
- IdentType: 'ident',
- ImportantType: 'important',
- IncludeType :'include',
- InterpolatedVariableType: 'interpolatedVariable',
- LoopType: 'loop',
- MixinType: 'mixin',
- NamespaceType: 'namespace',
- NthType: 'nth',
- NthselectorType: 'nthselector',
- NumberType: 'number',
- OperatorType: 'operator',
- ParentSelectorType: 'parentselector',
- PercentageType: 'percentage',
- PlaceholderType: 'placeholder',
- ProgidType: 'progid',
- PropertyType: 'property',
- PropertyDelimType: 'propertyDelim',
- PseudocType: 'pseudoc',
- PseudoeType: 'pseudoe',
- RawType: 'raw',
- RulesetType: 'ruleset',
- SType: 's',
- SelectorType: 'selector',
- ShashType: 'shash',
- SimpleselectorType: 'simpleselector',
- StringType: 'string',
- StylesheetType: 'stylesheet',
- UnaryType: 'unary',
- UnknownType: 'unknown',
- UriType: 'uri',
- ValueType: 'value',
- VariableType: 'variable',
- VariablesListType: 'variableslist',
- VhashType: 'vhash'
-};
-var getTokens = (function() {
- var Punctuation,
- urlMode = false,
- blockMode = 0;
- Punctuation = {
- ' ': TokenType.Space,
- '\n': TokenType.Newline,
- '\r': TokenType.Newline,
- '\t': TokenType.Tab,
- '!': TokenType.ExclamationMark,
- '"': TokenType.QuotationMark,
- '#': TokenType.NumberSign,
- '$': TokenType.DollarSign,
- '%': TokenType.PercentSign,
- '&': TokenType.Ampersand,
- '\'': TokenType.Apostrophe,
- '(': TokenType.LeftParenthesis,
- ')': TokenType.RightParenthesis,
- '*': TokenType.Asterisk,
- '+': TokenType.PlusSign,
- ',': TokenType.Comma,
- '-': TokenType.HyphenMinus,
- '.': TokenType.FullStop,
- '/': TokenType.Solidus,
- ':': TokenType.Colon,
- ';': TokenType.Semicolon,
- '<': TokenType.LessThanSign,
- '=': TokenType.EqualsSign,
- '>': TokenType.GreaterThanSign,
- '?': TokenType.QuestionMark,
- '@': TokenType.CommercialAt,
- '[': TokenType.LeftSquareBracket,
- ']': TokenType.RightSquareBracket,
- '^': TokenType.CircumflexAccent,
- '_': TokenType.LowLine,
- '{': TokenType.LeftCurlyBracket,
- '|': TokenType.VerticalLine,
- '}': TokenType.RightCurlyBracket,
- '~': TokenType.Tilde
- };
- function isDecimalDigit(c) {
- return '0123456789'.indexOf(c) >= 0;
- }
- function parseSpaces(css) {
- var start = pos;
- for (; pos < css.length; pos++) {
- if (css.charAt(pos) !== ' ') break;
- }
- pushToken(TokenType.Space, css.substring(start, pos));
- pos--;
- }
- function parseString(css, q) {
- var start = pos;
- for (pos = pos + 1; pos < css.length; pos++) {
- if (css.charAt(pos) === '\\') pos++;
- else if (css.charAt(pos) === q) break;
- }
- pushToken(q === '"' ? TokenType.StringDQ : TokenType.StringSQ, css.substring(start, pos + 1));
- }
- function parseDecimalNumber(css) {
- var start = pos;
- for (; pos < css.length; pos++) {
- if (!isDecimalDigit(css.charAt(pos))) break;
- }
- pushToken(TokenType.DecimalNumber, css.substring(start, pos));
- pos--;
- }
- function parseIdentifier(css) {
- var start = pos;
- while (css.charAt(pos) === '/') pos++;
- for (; pos < css.length; pos++) {
- if (css.charAt(pos) === '\\') pos++;
- else if (css.charAt(pos) in Punctuation) break;
- }
- var ident = css.substring(start, pos);
- urlMode = urlMode || ident === 'url';
- pushToken(TokenType.Identifier, ident);
- pos--;
- }
- function _getTokens(css, syntax) {
- var c,
- cn;
- tokens = [];
- pos = 0;
- tn = 0;
- ln = 1;
- for (pos = 0; pos < css.length; pos++) {
- c = css.charAt(pos);
- cn = css.charAt(pos + 1);
- if (c === '/' && cn === '*') {
- s.parseMLComment(css);
- }
- else if (!urlMode && c === '/' && cn === '/') {
- if (syntax === 'css' && blockMode > 0) parseIdentifier(css);
- else s.parseSLComment && s.parseSLComment(css);
- }
- else if (c === '"' || c === "'") {
- parseString(css, c);
- }
- else if (c === ' ') {
- parseSpaces(css)
- }
- else if (c in Punctuation) {
- pushToken(Punctuation[c], c);
- if (c === '\n' || c === '\r') ln++;
- if (c === ')') urlMode = false;
- if (c === '{') blockMode++;
- if (c === '}') blockMode--;
- }
- else if (isDecimalDigit(c)) {
- parseDecimalNumber(css);
- }
- else {
- parseIdentifier(css);
- }
- }
- }
- return function(s, syntax) {
- return _getTokens(s, syntax);
- };
-}());
-var rules = {
- 'arguments': function() { if (s.checkArguments(pos)) return s.getArguments() },
- 'atkeyword': function() { if (s.checkAtkeyword(pos)) return s.getAtkeyword() },
- 'atruleb': function() { if (s.checkAtruleb(pos)) return s.getAtruleb() },
- 'atruler': function() { if (s.checkAtruler(pos)) return s.getAtruler() },
- 'atrulerq': function() { if (s.checkAtrulerq(pos)) return s.getAtrulerq() },
- 'atrulers': function() { if (s.checkAtrulers(pos)) return s.getAtrulers() },
- 'atrules': function() { if (s.checkAtrules(pos)) return s.getAtrules() },
- 'attrib': function() { if (s.checkAttrib(pos)) return s.getAttrib() },
- 'attrselector': function() { if (s.checkAttrselector(pos)) return s.getAttrselector() },
- 'block': function() { if (s.checkBlock(pos)) return s.getBlock() },
- 'braces': function() { if (s.checkBraces(pos)) return s.getBraces() },
- 'class': function() { if (s.checkClass(pos)) return s.getClass() },
- 'combinator': function() { if (s.checkCombinator(pos)) return s.getCombinator() },
- 'commentML': function() { if (s.checkCommentML(pos)) return s.getCommentML() },
- 'commentSL': function() { if (s.checkCommentSL(pos)) return s.getCommentSL() },
- 'condition': function() { if (s.checkCondition(pos)) return s.getCondition() },
- 'declaration': function() { if (s.checkDeclaration(pos)) return s.getDeclaration() },
- 'declDelim': function() { if (s.checkDeclDelim(pos)) return s.getDeclDelim() },
- 'default': function () { if (s.checkDefault(pos)) return s.getDefault() },
- 'delim': function() { if (s.checkDelim(pos)) return s.getDelim() },
- 'dimension': function() { if (s.checkDimension(pos)) return s.getDimension() },
- 'escapedString': function() { if (s.checkEscapedString(pos)) return s.getEscapedString() },
- 'filter': function() { if (s.checkFilter(pos)) return s.getFilter() },
- 'filterv': function() { if (s.checkFilterv(pos)) return s.getFilterv() },
- 'functionExpression': function() { if (s.checkFunctionExpression(pos)) return s.getFunctionExpression() },
- 'function': function() { if (s.checkFunction(pos)) return s.getFunction() },
- 'ident': function() { if (s.checkIdent(pos)) return s.getIdent() },
- 'important': function() { if (s.checkImportant(pos)) return s.getImportant() },
- 'include': function () { if (s.checkInclude(pos)) return s.getInclude() },
- 'interpolatedVariable': function () { if (s.checkInterpolatedVariable(pos)) return s.getInterpolatedVariable() },
- 'loop': function() { if (s.checkLoop(pos)) return s.getLoop() },
- 'mixin': function () { if (s.checkMixin(pos)) return s.getMixin() },
- 'namespace': function() { if (s.checkNamespace(pos)) return s.getNamespace() },
- 'nth': function() { if (s.checkNth(pos)) return s.getNth() },
- 'nthselector': function() { if (s.checkNthselector(pos)) return s.getNthselector() },
- 'number': function() { if (s.checkNumber(pos)) return s.getNumber() },
- 'operator': function() { if (s.checkOperator(pos)) return s.getOperator() },
- 'parentselector': function () { if (s.checkParentSelector(pos)) return s.getParentSelector() },
- 'percentage': function() { if (s.checkPercentage(pos)) return s.getPercentage() },
- 'placeholder': function() { if (s.checkPlaceholder(pos)) return s.getPlaceholder() },
- 'progid': function() { if (s.checkProgid(pos)) return s.getProgid() },
- 'property': function() { if (s.checkProperty(pos)) return s.getProperty() },
- 'propertyDelim': function() { if (s.checkPropertyDelim(pos)) return s.getPropertyDelim() },
- 'pseudoc': function() { if (s.checkPseudoc(pos)) return s.getPseudoc() },
- 'pseudoe': function() { if (s.checkPseudoe(pos)) return s.getPseudoe() },
- 'ruleset': function() { if (s.checkRuleset(pos)) return s.getRuleset() },
- 's': function() { if (s.checkS(pos)) return s.getS() },
- 'selector': function() { if (s.checkSelector(pos)) return s.getSelector() },
- 'shash': function() { if (s.checkShash(pos)) return s.getShash() },
- 'simpleselector': function() { if (s.checkSimpleSelector(pos)) return s.getSimpleSelector() },
- 'string': function() { if (s.checkString(pos)) return s.getString() },
- 'stylesheet': function() { if (s.checkStylesheet(pos)) return s.getStylesheet() },
- 'unary': function() { if (s.checkUnary(pos)) return s.getUnary() },
- 'unknown': function() { if (s.checkUnknown(pos)) return s.getUnknown() },
- 'uri': function() { if (s.checkUri(pos)) return s.getUri() },
- 'value': function() { if (s.checkValue(pos)) return s.getValue() },
- 'variable': function () { if (s.checkVariable(pos)) return s.getVariable() },
- 'variableslist': function () { if (s.checkVariablesList(pos)) return s.getVariablesList() },
- 'vhash': function() { if (s.checkVhash(pos)) return s.getVhash() }
-};
-syntaxes.css = {
- checkAny: function(i) {
- return this.checkBraces(i) ||
- this.checkString(i) ||
- this.checkPercentage(i) ||
- this.checkDimension(i) ||
- this.checkNumber(i) ||
- this.checkUri(i) ||
- this.checkFunctionExpression(i) ||
- this.checkFunction(i) ||
- this.checkIdent(i) ||
- this.checkClass(i) ||
- this.checkUnary(i);
- },
- getAny: function() {
- if (this.checkBraces(pos)) return this.getBraces();
- else if (this.checkString(pos)) return this.getString();
- else if (this.checkPercentage(pos)) return this.getPercentage();
- else if (this.checkDimension(pos)) return this.getDimension();
- else if (this.checkNumber(pos)) return this.getNumber();
- else if (this.checkUri(pos)) return this.getUri();
- else if (this.checkFunctionExpression(pos)) return this.getFunctionExpression();
- else if (this.checkFunction(pos)) return this.getFunction();
- else if (this.checkIdent(pos)) return this.getIdent();
- else if (this.checkClass(pos)) return this.getClass();
- else if (this.checkUnary(pos)) return this.getUnary();
- },
- checkAtkeyword: function(i) {
- var l;
- if (i >= tokensLength ||
- tokens[i++].type !== TokenType.CommercialAt) return 0;
- return (l = this.checkIdent(i)) ? l + 1 : 0;
- },
- getAtkeyword: function() {
- var startPos = pos,
- x;
- pos++;
- x = [NodeType.AtkeywordType, this.getIdent()];
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkAttrib: function(i) {
- if (i >= tokensLength ||
- tokens[i].type !== TokenType.LeftSquareBracket ||
- !tokens[i].right) return 0;
- return tokens[i].right - i + 1;
- },
- getAttrib: function() {
- if (this.checkAttrib1(pos)) return this.getAttrib1();
- if (this.checkAttrib2(pos)) return this.getAttrib2();
- },
- checkAttrib1: function(i) {
- var start = i,
- l;
- if (i++ >= tokensLength) return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkIdent(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkAttrselector(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkIdent(i) || this.checkString(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- return tokens[i].type === TokenType.RightSquareBracket ? i - start : 0;
- },
- getAttrib1: function() {
- var startPos = pos,
- x;
- pos++;
- x = [NodeType.AttribType]
- .concat(this.getSC())
- .concat([this.getIdent()])
- .concat(this.getSC())
- .concat([this.getAttrselector()])
- .concat(this.getSC())
- .concat([this.checkString(pos)? this.getString() : this.getIdent()])
- .concat(this.getSC());
- pos++;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkAttrib2: function(i) {
- var start = i,
- l;
- if (i++ >= tokensLength) return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkIdent(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- return tokens[i].type === TokenType.RightSquareBracket ? i - start : 0;
- },
- getAttrib2: function() {
- var startPos = pos,
- x;
- pos++;
- x = [NodeType.AttribType]
- .concat(this.getSC())
- .concat([this.getIdent()])
- .concat(this.getSC());
- pos++;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkAttrselector: function(i) {
- if (i >= tokensLength) return 0;
- if (tokens[i].type === TokenType.EqualsSign) return 1;
- if (tokens[i].type === TokenType.VerticalLine &&
- (!tokens[i + 1] || tokens[i + 1].type !== TokenType.EqualsSign))
- return 1;
- if (!tokens[i + 1] || tokens[i + 1].type !== TokenType.EqualsSign) return 0;
- switch(tokens[i].type) {
- case TokenType.Tilde:
- case TokenType.CircumflexAccent:
- case TokenType.DollarSign:
- case TokenType.Asterisk:
- case TokenType.VerticalLine:
- return 2;
- }
- return 0;
- },
- getAttrselector: function() {
- var startPos = pos,
- s = tokens[pos++].value,
- x;
- if (tokens[pos] && tokens[pos].type === TokenType.EqualsSign) s += tokens[pos++].value;
- x = [NodeType.AttrselectorType, s];
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkAtrule: function(i) {
- var l;
- if (i >= tokensLength) return 0;
- if (tokens[i].atrule_l !== undefined) return tokens[i].atrule_l;
- if (l = this.checkAtruler(i)) tokens[i].atrule_type = 1;
- else if (l = this.checkAtruleb(i)) tokens[i].atrule_type = 2;
- else if (l = this.checkAtrules(i)) tokens[i].atrule_type = 3;
- else return 0;
- tokens[i].atrule_l = l;
- return l;
- },
- getAtrule: function() {
- switch (tokens[pos].atrule_type) {
- case 1: return this.getAtruler();
- case 2: return this.getAtruleb();
- case 3: return this.getAtrules();
- }
- },
- checkAtruleb: function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkAtkeyword(i)) i += l;
- else return 0;
- if (l = this.checkTsets(i)) i += l;
- if (l = this.checkBlock(i)) i += l;
- else return 0;
- return i - start;
- },
- getAtruleb: function() {
- var startPos = pos,
- x;
- x = [NodeType.AtrulebType, this.getAtkeyword()]
- .concat(this.getTsets())
- .concat([this.getBlock()]);
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkAtruler: function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkAtkeyword(i)) i += l;
- else return 0;
- if (l = this.checkAtrulerq(i)) i += l;
- if (i < tokensLength && tokens[i].type === TokenType.LeftCurlyBracket) i++;
- else return 0;
- if (l = this.checkAtrulers(i)) i += l;
- if (i < tokensLength && tokens[i].type === TokenType.RightCurlyBracket) i++;
- else return 0;
- return i - start;
- },
- getAtruler: function() {
- var startPos = pos,
- x;
- x = [NodeType.AtrulerType, this.getAtkeyword(), this.getAtrulerq()];
- pos++;
- x.push(this.getAtrulers());
- pos++;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkAtrulerq: function(i) {
- return this.checkTsets(i);
- },
- getAtrulerq: function() {
- var startPos = pos,
- x;
- x = [NodeType.AtrulerqType].concat(this.getTsets());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkAtrulers: function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkSC(i)) i += l;
- while (l = this.checkRuleset(i) || this.checkAtrule(i) || this.checkSC(i)) {
- i += l;
- }
- tokens[i].atrulers_end = 1;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- },
- getAtrulers: function() {
- var startPos = pos,
- x;
- x = [NodeType.AtrulersType].concat(this.getSC());
- while (!tokens[pos].atrulers_end) {
- if (this.checkSC(pos)) x = x.concat(this.getSC());
- else if (this.checkRuleset(pos)) x.push(this.getRuleset());
- else x.push(this.getAtrule());
- }
- x = x.concat(this.getSC());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkAtrules: function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkAtkeyword(i)) i += l;
- else return 0;
- if (l = this.checkTsets(i)) i += l;
- return i - start;
- },
- getAtrules: function() {
- var startPos = pos,
- x;
- x = [NodeType.AtrulesType, this.getAtkeyword()].concat(this.getTsets());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkBlock: function(i) {
- return i < tokensLength && tokens[i].type === TokenType.LeftCurlyBracket ?
- tokens[i].right - i + 1 : 0;
- },
- getBlock: function() {
- var startPos = pos,
- end = tokens[pos].right,
- x = [NodeType.BlockType];
- pos++;
- while (pos < end) {
- if (this.checkBlockdecl(pos)) x = x.concat(this.getBlockdecl());
- else throwError();
- }
- pos = end + 1;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkBlockdecl: function(i) {
- var l;
- if (i >= tokensLength) return 0;
- if (l = this.checkBlockdecl1(i)) tokens[i].bd_type = 1;
- else if (l = this.checkBlockdecl2(i)) tokens[i].bd_type = 2;
- else if (l = this.checkBlockdecl3(i)) tokens[i].bd_type = 3;
- else if (l = this.checkBlockdecl4(i)) tokens[i].bd_type = 4;
- else return 0;
- return l;
- },
- getBlockdecl: function() {
- switch (tokens[pos].bd_type) {
- case 1: return this.getBlockdecl1();
- case 2: return this.getBlockdecl2();
- case 3: return this.getBlockdecl3();
- case 4: return this.getBlockdecl4();
- }
- },
- checkBlockdecl1: function(i) {
- var start = i,
- l;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkFilter(i)) tokens[i].bd_kind = 1;
- else if (l = this.checkDeclaration(i)) tokens[i].bd_kind = 2;
- else if (l = this.checkAtrule(i)) tokens[i].bd_kind = 3;
- else return 0;
- i += l;
- if (i < tokensLength && (l = this.checkDeclDelim(i))) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- else return 0;
- return i - start;
- },
- getBlockdecl1: function() {
- var sc = this.getSC(),
- x;
- switch (tokens[pos].bd_kind) {
- case 1:
- x = this.getFilter();
- break;
- case 2:
- x = this.getDeclaration();
- break;
- case 3:
- x = this.getAtrule();
- break;
- }
- return sc
- .concat([x])
- .concat([this.getDeclDelim()])
- .concat(this.getSC());
- },
- checkBlockdecl2: function(i) {
- var start = i,
- l;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkFilter(i)) tokens[i].bd_kind = 1;
- else if (l = this.checkDeclaration(i)) tokens[i].bd_kind = 2;
- else if (l = this.checkAtrule(i)) tokens[i].bd_kind = 3;
- else return 0;
- i += l;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- },
- getBlockdecl2: function() {
- var sc = this.getSC(),
- x;
- switch (tokens[pos].bd_kind) {
- case 1:
- x = this.getFilter();
- break;
- case 2:
- x = this.getDeclaration();
- break;
- case 3:
- x = this.getAtrule();
- break;
- }
- return sc
- .concat([x])
- .concat(this.getSC());
- },
- checkBlockdecl3: function(i) {
- var start = i,
- l;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkDeclDelim(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- },
- getBlockdecl3: function() {
- return this.getSC()
- .concat([this.getDeclDelim()])
- .concat(this.getSC());
- },
- checkBlockdecl4: function(i) {
- return this.checkSC(i);
- },
- getBlockdecl4: function() {
- return this.getSC();
- },
- checkBraces: function(i) {
- if (i >= tokensLength ||
- (tokens[i].type !== TokenType.LeftParenthesis &&
- tokens[i].type !== TokenType.LeftSquareBracket)) return 0;
- return tokens[i].right - i + 1;
- },
- getBraces: function() {
- var startPos = pos,
- left = pos,
- right = tokens[pos].right,
- x;
- pos++;
- var tsets = this.getTsets();
- pos++;
- x = [NodeType.BracesType, tokens[left].value, tokens[right].value]
- .concat(tsets);
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkClass: function(i) {
- var l;
- if (i >= tokensLength) return 0;
- if (tokens[i].class_l) return tokens[i].class_l;
- if (tokens[i++].type === TokenType.FullStop && (l = this.checkIdent(i))) {
- tokens[i].class_l = l + 1;
- return l + 1;
- }
- return 0;
- },
- getClass: function() {
- var startPos = pos,
- x = [NodeType.ClassType];
- pos++;
- x.push(this.getIdent());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkCombinator: function(i) {
- if (i >= tokensLength) return 0;
- switch (tokens[i].type) {
- case TokenType.PlusSign:
- case TokenType.GreaterThanSign:
- case TokenType.Tilde:
- return 1;
- }
- return 0;
- },
- getCombinator: function() {
- var startPos = pos,
- x;
- x = [NodeType.CombinatorType, tokens[pos++].value];
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkCommentML: function(i) {
- return i < tokensLength && tokens[i].type === TokenType.CommentML ? 1 : 0;
- },
- getCommentML: function() {
- var startPos = pos,
- s = tokens[pos].value.substring(2),
- l = s.length,
- x;
- if (s.charAt(l - 2) === '*' && s.charAt(l - 1) === '/') s = s.substring(0, l - 2);
- pos++;
- x = [NodeType.CommentMLType, s];
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkDeclaration: function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkProperty(i)) i += l;
- else return 0;
- if (l = this.checkPropertyDelim(i)) i++;
- else return 0;
- if (l = this.checkValue(i)) i += l;
- else return 0;
- return i - start;
- },
- getDeclaration: function() {
- var startPos = pos,
- x = [NodeType.DeclarationType];
- x.push(this.getProperty());
- x.push(this.getPropertyDelim());
- x.push(this.getValue());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkDeclDelim: function(i) {
- return i < tokensLength && tokens[i].type === TokenType.Semicolon ? 1 : 0;
- },
- getDeclDelim: function() {
- var startPos = pos,
- x = [NodeType.DeclDelimType];
- pos++;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkDelim: function(i) {
- return i < tokensLength && tokens[i].type === TokenType.Comma ? 1 : 0;
- },
- getDelim: function() {
- var startPos = pos,
- x = [NodeType.DelimType];
- pos++;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkDimension: function(i) {
- var ln = this.checkNumber(i),
- li;
- if (i >= tokensLength ||
- !ln ||
- i + ln >= tokensLength) return 0;
- return (li = this.checkNmName2(i + ln)) ? ln + li : 0;
- },
- getDimension: function() {
- var startPos = pos,
- x = [NodeType.DimensionType, this.getNumber()],
- ident = [NodeType.IdentType, this.getNmName2()];
- if (needInfo) ident.unshift(getInfo(startPos));
- x.push(ident);
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkFilter: function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkFilterp(i)) i += l;
- else return 0;
- if (tokens[i].type === TokenType.Colon) i++;
- else return 0;
- if (l = this.checkFilterv(i)) i += l;
- else return 0;
- return i - start;
- },
- getFilter: function() {
- var startPos = pos,
- x = [NodeType.FilterType, this.getFilterp()];
- pos++;
- x.push(this.getFilterv());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkFilterp: function(i) {
- var start = i,
- l,
- x;
- if (i >= tokensLength) return 0;
- if (tokens[i].value === 'filter') l = 1;
- else {
- x = joinValues2(i, 2);
- if (x === '-filter' || x === '_filter' || x === '*filter') l = 2;
- else {
- x = joinValues2(i, 4);
- if (x === '-ms-filter') l = 4;
- else return 0;
- }
- }
- tokens[start].filterp_l = l;
- i += l;
- if (this.checkSC(i)) i += l;
- return i - start;
- },
- getFilterp: function() {
- var startPos = pos,
- ident = [NodeType.IdentType, joinValues2(pos, tokens[pos].filterp_l)],
- x;
- if (needInfo) ident.unshift(getInfo(startPos));
- pos += tokens[pos].filterp_l;
- x = [NodeType.PropertyType, ident].concat(this.getSC());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkFilterv: function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkProgid(i)) i += l;
- else return 0;
- while (l = this.checkProgid(i)) {
- i += l;
- }
- tokens[start].last_progid = i;
- if (i < tokensLength && (l = this.checkSC(i))) i += l;
- if (i < tokensLength && (l = this.checkImportant(i))) i += l;
- return i - start;
- },
- getFilterv: function() {
- var startPos = pos,
- x = [NodeType.FiltervType],
- last_progid = tokens[pos].last_progid;
- x = x.concat(this.getSC());
- while (pos < last_progid) {
- x.push(this.getProgid());
- }
- if (this.checkSC(pos)) x = x.concat(this.getSC());
- if (pos < tokensLength && this.checkImportant(pos)) x.push(this.getImportant());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkFunctionExpression: function(i) {
- var start = i;
- if (i >= tokensLength || tokens[i++].value !== 'expression' ||
- i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis) return 0;
- return tokens[i].right - start + 1;
- },
- getFunctionExpression: function() {
- var startPos = pos,
- x, e;
- pos++;
- e = joinValues(pos + 1, tokens[pos].right - 1);
- pos = tokens[pos].right + 1;
- x = [NodeType.FunctionExpressionType, e];
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkFunction: function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkIdent(i)) i +=l;
- else return 0;
- return i < tokensLength && tokens[i].type === TokenType.LeftParenthesis ?
- tokens[i].right - start + 1 : 0;
- },
- getFunction: function() {
- var startPos = pos,
- ident = this.getIdent(),
- x = [NodeType.FunctionType, ident],
- body;
- pos++;
- body = ident[needInfo ? 2 : 1] === 'not' ? this.getNotFunctionBody() : this.getFunctionBody();
- x.push(body);
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- getFunctionBody: function() {
- var startPos = pos,
- x = [NodeType.FunctionBodyType],
- body;
- while (tokens[pos].type !== TokenType.RightParenthesis) {
- if (this.checkDeclaration(pos)) x.push(this.getDeclaration());
- else if (this.checkTset(pos)) {
- body = this.getTset();
- if ((needInfo && typeof body[1] === 'string') || typeof body[0] === 'string') x.push(body);
- else x = x.concat(body);
- } else if (this.checkClass(pos)) x.push(this.getClass());
- else throwError();
- }
- pos++;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- getNotFunctionBody: function() {
- var startPos = pos,
- x = [NodeType.FunctionBodyType];
- while (tokens[pos].type !== TokenType.RightParenthesis) {
- if (this.checkSimpleSelector(pos)) x.push(this.getSimpleSelector());
- else throwError();
- }
- pos++;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkIdent: function(i) {
- var start = i,
- wasIdent,
- l;
- if (i >= tokensLength) return 0;
- if (tokens[i].type === TokenType.LowLine) return this.checkIdentLowLine(i);
- if (tokens[i].type === TokenType.HyphenMinus ||
- tokens[i].type === TokenType.Identifier ||
- tokens[i].type === TokenType.DollarSign ||
- tokens[i].type === TokenType.Asterisk) i++;
- else return 0;
- wasIdent = tokens[i - 1].type === TokenType.Identifier;
- for (; i < tokensLength; i++) {
- if (i >= tokensLength) break;
- if (tokens[i].type !== TokenType.HyphenMinus &&
- tokens[i].type !== TokenType.LowLine) {
- if (tokens[i].type !== TokenType.Identifier &&
- (tokens[i].type !== TokenType.DecimalNumber || !wasIdent)) break;
- else wasIdent = true;
- }
- }
- if (!wasIdent && tokens[start].type !== TokenType.Asterisk) return 0;
- tokens[start].ident_last = i - 1;
- return i - start;
- },
- checkIdentLowLine: function(i) {
- var start = i;
- if (i++ >= tokensLength) return 0;
- for (; i < tokensLength; i++) {
- if (tokens[i].type !== TokenType.HyphenMinus &&
- tokens[i].type !== TokenType.DecimalNumber &&
- tokens[i].type !== TokenType.LowLine &&
- tokens[i].type !== TokenType.Identifier) break;
- }
- tokens[start].ident_last = i - 1;
- return i - start;
- },
- getIdent: function() {
- var startPos = pos,
- x = [NodeType.IdentType, joinValues(pos, tokens[pos].ident_last)];
- pos = tokens[pos].ident_last + 1;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkImportant: function(i) {
- var start = i,
- l;
- if (i >= tokensLength ||
- tokens[i++].type !== TokenType.ExclamationMark) return 0;
- if (l = this.checkSC(i)) i += l;
- return tokens[i].value === 'important' ? i - start + 1 : 0;
- },
- getImportant: function() {
- var startPos = pos,
- x = [NodeType.ImportantType];
- pos++;
- x = x.concat(this.getSC());
- pos++;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkNamespace: function(i) {
- return i < tokensLength && tokens[i].type === TokenType.VerticalLine ? 1 : 0;
- },
- getNamespace: function() {
- var startPos = pos,
- x = [NodeType.NamespaceType];
- pos++;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkNmName: function(i) {
- var start = i;
- if (i >= tokensLength) return 0;
- if (tokens[i].type === TokenType.HyphenMinus ||
- tokens[i].type === TokenType.LowLine ||
- tokens[i].type === TokenType.Identifier ||
- tokens[i].type === TokenType.DecimalNumber) i++;
- else return 0;
- for (; i < tokensLength; i++) {
- if (tokens[i].type !== TokenType.HyphenMinus &&
- tokens[i].type !== TokenType.LowLine &&
- tokens[i].type !== TokenType.Identifier &&
- tokens[i].type !== TokenType.DecimalNumber) break;
- }
- tokens[start].nm_name_last = i - 1;
- return i - start;
- },
- getNmName: function() {
- var s = joinValues(pos, tokens[pos].nm_name_last);
- pos = tokens[pos].nm_name_last + 1;
- return s;
- },
- checkNmName2: function(i) {
- if (tokens[i].type === TokenType.Identifier) return 1;
- else if (tokens[i].type !== TokenType.DecimalNumber) return 0;
- i++;
- return i < tokensLength && tokens[i].type === TokenType.Identifier ? 2 : 1;
- },
- getNmName2: function() {
- var s = tokens[pos].value;
- if (tokens[pos++].type === TokenType.DecimalNumber &&
- pos < tokensLength &&
- tokens[pos].type === TokenType.Identifier) s += tokens[pos++].value;
- return s;
- },
- checkNth: function(i) {
- if (i >= tokensLength) return 0;
- return this.checkNth1(i) || this.checkNth2(i);
- },
- checkNth1: function(i) {
- var start = i;
- for (; i < tokensLength; i++) {
- if (tokens[i].type !== TokenType.DecimalNumber &&
- tokens[i].value !== 'n') break;
- }
- if (i !== start) tokens[start].nth_last = i - 1;
- return i - start;
- },
- getNth: function() {
- var startPos = pos,
- x = [NodeType.NthType];
- if (tokens[pos].nth_last) {
- x.push(joinValues(pos, tokens[pos].nth_last));
- pos = tokens[pos].nth_last + 1;
- } else {
- x.push(tokens[pos++].value);
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkNth2: function(i) {
- return tokens[i].value === 'even' || tokens[i].value === 'odd' ? 1 : 0;
- },
- checkNthf: function(i) {
- var start = i,
- l = 0;
- if (tokens[i++].type !== TokenType.Colon) return 0;
- l++;
- if (tokens[i++].value !== 'nth' || tokens[i++].value !== '-') return 0;
- l += 2;
- if ('child' === tokens[i].value) {
- l += 1;
- } else if ('last-child' === tokens[i].value +
- tokens[i + 1].value +
- tokens[i + 2].value) {
- l += 3;
- } else if ('of-type' === tokens[i].value +
- tokens[i + 1].value +
- tokens[i + 2].value) {
- l += 3;
- } else if ('last-of-type' === tokens[i].value +
- tokens[i + 1].value +
- tokens[i + 2].value +
- tokens[i + 3].value +
- tokens[i + 4].value) {
- l += 5;
- } else return 0;
- tokens[start + 1].nthf_last = start + l - 1;
- return l;
- },
- getNthf: function() {
- pos++;
- var s = joinValues(pos, tokens[pos].nthf_last);
- pos = tokens[pos].nthf_last + 1;
- return s;
- },
- checkNthselector: function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkNthf(i)) i += l;
- else return 0;
- if (tokens[i].type !== TokenType.LeftParenthesis || !tokens[i].right) return 0;
- l++;
- var rp = tokens[i++].right;
- while (i < rp) {
- if (l = this.checkSC(i) ||
- this.checkUnary(i) ||
- this.checkNth(i)) i += l;
- else return 0;
- }
- return rp - start + 1;
- },
- getNthselector: function() {
- var startPos = pos,
- nthf = [NodeType.IdentType, this.getNthf()],
- x = [NodeType.NthselectorType];
- if (needInfo) nthf.unshift(getInfo(startPos));
- x.push(nthf);
- pos++;
- while (tokens[pos].type !== TokenType.RightParenthesis) {
- if (this.checkSC(pos)) x = x.concat(this.getSC());
- else if (this.checkUnary(pos)) x.push(this.getUnary());
- else if (this.checkNth(pos)) x.push(this.getNth());
- }
- pos++;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkNumber: function(i) {
- if (i >= tokensLength) return 0;
- if (tokens[i].number_l) return tokens[i].number_l;
- if (i < tokensLength && tokens[i].type === TokenType.DecimalNumber &&
- (!tokens[i + 1] ||
- (tokens[i + 1] && tokens[i + 1].type !== TokenType.FullStop)))
- return (tokens[i].number_l = 1, tokens[i].number_l);
- if (i < tokensLength &&
- tokens[i].type === TokenType.DecimalNumber &&
- tokens[i + 1] && tokens[i + 1].type === TokenType.FullStop &&
- (!tokens[i + 2] || (tokens[i + 2].type !== TokenType.DecimalNumber)))
- return (tokens[i].number_l = 2, tokens[i].number_l);
- if (i < tokensLength &&
- tokens[i].type === TokenType.FullStop &&
- tokens[i + 1].type === TokenType.DecimalNumber)
- return (tokens[i].number_l = 2, tokens[i].number_l);
- if (i < tokensLength &&
- tokens[i].type === TokenType.DecimalNumber &&
- tokens[i + 1] && tokens[i + 1].type === TokenType.FullStop &&
- tokens[i + 2] && tokens[i + 2].type === TokenType.DecimalNumber)
- return (tokens[i].number_l = 3, tokens[i].number_l);
- return 0;
- },
- getNumber: function() {
- var s = '',
- startPos = pos,
- l = tokens[pos].number_l,
- x = [NodeType.NumberType];
- for (var j = 0; j < l; j++) {
- s += tokens[pos + j].value;
- }
- pos += l;
- x.push(s);
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkOperator: function(i) {
- if (i >= tokensLength) return 0;
- switch(tokens[i].type) {
- case TokenType.Solidus:
- case TokenType.Comma:
- case TokenType.Colon:
- case TokenType.EqualsSign:
- return 1;
- }
- return 0;
- },
- getOperator: function() {
- var startPos = pos,
- x = [NodeType.OperatorType, tokens[pos++].value];
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkPercentage: function(i) {
- var x;
- if (i >= tokensLength) return 0;
- x = this.checkNumber(i);
- if (!x || i + x >= tokensLength) return 0;
- return tokens[i + x].type === TokenType.PercentSign ? x + 1 : 0;
- },
- getPercentage: function() {
- var startPos = pos,
- x = [NodeType.PercentageType, this.getNumber()];
- pos++;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkProgid: function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkSC(i)) i += l;
- if (joinValues2(i, 6) === 'progid:DXImageTransform.Microsoft.') i += 6;
- else return 0;
- if (l = this.checkIdent(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (tokens[i].type === TokenType.LeftParenthesis) {
- tokens[start].progid_end = tokens[i].right;
- i = tokens[i].right + 1;
- } else return 0;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- },
- getProgid: function() {
- var startPos = pos,
- progid_end = tokens[pos].progid_end,
- x;
- x = [NodeType.ProgidType]
- .concat(this.getSC())
- .concat([this._getProgid(progid_end)])
- .concat(this.getSC());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- _getProgid: function(progid_end) {
- var startPos = pos,
- x = [NodeType.RawType, joinValues(pos, progid_end)];
- pos = progid_end + 1;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkProperty: function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkIdent(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- },
- getProperty: function() {
- var startPos = pos,
- x = [NodeType.PropertyType];
- x.push(this.getIdent());
- x = x.concat(this.getSC());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkPropertyDelim: function(i) {
- return i < tokensLength && tokens[i].type === TokenType.Colon ? 1 : 0;
- },
- getPropertyDelim: function() {
- var startPos = pos,
- x = [NodeType.PropertyDelimType];
- pos++;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkPseudo: function(i) {
- return this.checkPseudoe(i) ||
- this.checkPseudoc(i);
- },
- getPseudo: function() {
- if (this.checkPseudoe(pos)) return this.getPseudoe();
- if (this.checkPseudoc(pos)) return this.getPseudoc();
- },
- checkPseudoe: function(i) {
- var l;
- if (i >= tokensLength || tokens[i++].type !== TokenType.Colon ||
- i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0;
- return (l = this.checkIdent(i)) ? l + 2 : 0;
- },
- getPseudoe: function() {
- var startPos = pos,
- x = [NodeType.PseudoeType];
- pos += 2;
- x.push(this.getIdent());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkPseudoc: function(i) {
- var l;
- if (i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0;
- return (l = this.checkFunction(i) || this.checkIdent(i)) ? l + 1 : 0;
- },
- getPseudoc: function() {
- var startPos = pos,
- x = [NodeType.PseudocType];
- pos ++;
- x.push(this.checkFunction(pos) ? this.getFunction() : this.getIdent());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkRuleset: function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (tokens[start].ruleset_l) return tokens[start].ruleset_l;
- while (i < tokensLength) {
- if (l = this.checkBlock(i)) {i += l; break;}
- else if (l = this.checkSelector(i)) i += l;
- else return 0;
- }
- tokens[start].ruleset_l = i - start;
- return i - start;
- },
- getRuleset: function() {
- var startPos = pos,
- x = [NodeType.RulesetType];
- while (pos < tokensLength) {
- if (this.checkBlock(pos)) {x.push(this.getBlock()); break;}
- else if (this.checkSelector(pos)) x.push(this.getSelector());
- else break;
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkS: function(i) {
- return i < tokensLength && tokens[i].ws ? tokens[i].ws_last - i + 1 : 0;
- },
- getS: function() {
- var startPos = pos,
- x = [NodeType.SType, joinValues(pos, tokens[pos].ws_last)];
- pos = tokens[pos].ws_last + 1;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkSC: function(i) {
- var l,
- lsc = 0;
- while (i < tokensLength) {
- if (!(l = this.checkS(i)) &&
- !(l = this.checkCommentML(i))) break;
- i += l;
- lsc += l;
- }
- return lsc || 0;
- },
- getSC: function() {
- var sc = [];
- if (pos >= tokensLength) return sc;
- while (pos < tokensLength) {
- if (this.checkS(pos)) sc.push(this.getS());
- else if (this.checkCommentML(pos)) sc.push(this.getCommentML());
- else break;
- }
- return sc;
- },
- checkSelector: function(i) {
- var start = i,
- l;
- while (i < tokensLength) {
- if (l = this.checkSimpleSelector(i) || this.checkDelim(i)) i += l;
- else break;
- }
- if (i !== start) tokens[start].selector_end = i - 1;
- return i - start;
- },
- getSelector: function() {
- var startPos = pos,
- x = [NodeType.SelectorType],
- selector_end = tokens[pos].selector_end;
- while (pos <= selector_end) {
- x.push(this.checkDelim(pos) ? this.getDelim() : this.getSimpleSelector());
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkShash: function(i) {
- var l;
- if (i >= tokensLength || tokens[i].type !== TokenType.NumberSign) return 0;
- return (l = this.checkNmName(i + 1)) ? l + 1 : 0;
- },
- getShash: function() {
- var startPos = pos,
- x = [NodeType.ShashType];
- pos++;
- x.push(this.getNmName());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkSimpleSelector: function(i) {
- var start = i,
- l;
- while (i < tokensLength) {
- if (l = this.checkSimpleSelector1(i)) i += l;
- else break;
- }
- return i - start;
- },
- getSimpleSelector: function() {
- var startPos = pos,
- x = [NodeType.SimpleselectorType],
- t;
- while (pos < tokensLength) {
- if (!this.checkSimpleSelector1(pos)) break;
- t = this.getSimpleSelector1();
- if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t);
- else x = x.concat(t);
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkSimpleSelector1: function(i) {
- return this.checkNthselector(i) ||
- this.checkCombinator(i) ||
- this.checkAttrib(i) ||
- this.checkPseudo(i) ||
- this.checkShash(i) ||
- this.checkAny(i) ||
- this.checkSC(i) ||
- this.checkNamespace(i);
- },
- getSimpleSelector1: function() {
- if (this.checkNthselector(pos)) return this.getNthselector();
- else if (this.checkCombinator(pos)) return this.getCombinator();
- else if (this.checkAttrib(pos)) return this.getAttrib();
- else if (this.checkPseudo(pos)) return this.getPseudo();
- else if (this.checkShash(pos)) return this.getShash();
- else if (this.checkAny(pos)) return this.getAny();
- else if (this.checkSC(pos)) return this.getSC();
- else if (this.checkNamespace(pos)) return this.getNamespace();
- },
- checkString: function(i) {
- return i < tokensLength && (tokens[i].type === TokenType.StringSQ || tokens[i].type === TokenType.StringDQ) ? 1 : 0;
- },
- getString: function() {
- var startPos = pos,
- x = [NodeType.StringType, tokens[pos++].value];
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkStylesheet: function(i) {
- var start = i,
- l;
- while (i < tokensLength) {
- if (l = this.checkSC(i) ||
- this.checkDeclDelim(i) ||
- this.checkAtrule(i) ||
- this.checkRuleset(i) ||
- this.checkUnknown(i)) i += l;
- else throwError(i);
- }
- return i - start;
- },
- getStylesheet: function() {
- var startPos = pos,
- x = [NodeType.StylesheetType];
- while (pos < tokensLength) {
- if (this.checkSC(pos)) x = x.concat(this.getSC());
- else if (this.checkRuleset(pos)) x.push(this.getRuleset());
- else if (this.checkAtrule(pos)) x.push(this.getAtrule());
- else if (this.checkDeclDelim(pos)) x.push(this.getDeclDelim());
- else if (this.checkUnknown(pos)) x.push(this.getUnknown());
- else throwError();
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkTset: function(i) {
- return this.checkVhash(i) ||
- this.checkAny(i) ||
- this.checkSC(i) ||
- this.checkOperator(i);
- },
- getTset: function() {
- if (this.checkVhash(pos)) return this.getVhash();
- else if (this.checkAny(pos)) return this.getAny();
- else if (this.checkSC(pos)) return this.getSC();
- else if (this.checkOperator(pos)) return this.getOperator();
- },
- checkTsets: function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- while (l = this.checkTset(i)) {
- i += l;
- }
- return i - start;
- },
- getTsets: function() {
- var x = [],
- t;
- while (t = this.getTset()) {
- if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t);
- else x = x.concat(t);
- }
- return x;
- },
- checkUnary: function(i) {
- return i < tokensLength && (tokens[i].type === TokenType.HyphenMinus || tokens[i].type === TokenType.PlusSign) ? 1 : 0;
- },
- getUnary: function() {
- var startPos = pos,
- x = [NodeType.UnaryType, tokens[pos++].value];
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkUnknown: function(i) {
- return i < tokensLength && tokens[i].type === TokenType.CommentSL ? 1 : 0;
- },
- getUnknown: function() {
- var startPos = pos,
- x = [NodeType.UnknownType, tokens[pos++].value];
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkUri: function(i) {
- var start = i;
- if (i >= tokensLength || tokens[i++].value !== 'url' ||
- i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis)
- return 0;
- return tokens[i].right - start + 1;
- },
- getUri: function() {
- var startPos = pos,
- uriExcluding = {},
- uri,
- l,
- raw;
- pos += 2;
- uriExcluding[TokenType.Space] = 1;
- uriExcluding[TokenType.Tab] = 1;
- uriExcluding[TokenType.Newline] = 1;
- uriExcluding[TokenType.LeftParenthesis] = 1;
- uriExcluding[TokenType.RightParenthesis] = 1;
- if (this.checkUri1(pos)) {
- uri = [NodeType.UriType]
- .concat(this.getSC())
- .concat([this.getString()])
- .concat(this.getSC());
- pos++;
- } else {
- uri = [NodeType.UriType].concat(this.getSC()),
- l = checkExcluding(uriExcluding, pos),
- raw = [NodeType.RawType, joinValues(pos, pos + l)];
- if (needInfo) raw.unshift(getInfo(startPos));
- uri.push(raw);
- pos += l + 1;
- uri = uri.concat(this.getSC());
- pos++;
- }
- return needInfo ? (uri.unshift(getInfo(startPos)), uri) : uri;
- },
- checkUri1: function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkSC(i)) i += l;
- if (tokens[i].type !== TokenType.StringDQ && tokens[i].type !== TokenType.StringSQ) return 0;
- i++;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- },
- checkValue: function(i) {
- var start = i,
- l;
- while (i < tokensLength) {
- if (l = this._checkValue(i)) i += l;
- else break;
- }
- return i - start;
- },
- _checkValue: function(i) {
- return this.checkSC(i) ||
- this.checkVhash(i) ||
- this.checkAny(i) ||
- this.checkOperator(i) ||
- this.checkImportant(i);
- },
- getValue: function() {
- var startPos = pos,
- x = [NodeType.ValueType],
- t,
- _pos;
- while (pos < tokensLength) {
- _pos = pos;
- if (!this._checkValue(pos)) break;
- t = this._getValue();
- if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t);
- else x = x.concat(t);
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- _getValue: function() {
- if (this.checkSC(pos)) return this.getSC();
- else if (this.checkVhash(pos)) return this.getVhash();
- else if (this.checkAny(pos)) return this.getAny();
- else if (this.checkOperator(pos)) return this.getOperator();
- else if (this.checkImportant(pos)) return this.getImportant();
- },
- checkVhash: function(i) {
- var l;
- if (i >= tokensLength || tokens[i].type !== TokenType.NumberSign) return 0;
- return (l = this.checkNmName2(i + 1)) ? l + 1 : 0;
- },
- getVhash: function() {
- var startPos = pos,
- x = [NodeType.VhashType];
- pos++;
- x.push(this.getNmName2());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- markSC: function() {
- var ws = -1,
- sc = -1,
- t;
- for (var i = 0; i < tokensLength; i++) {
- t = tokens[i];
- switch (t.type) {
- case TokenType.Space:
- case TokenType.Tab:
- case TokenType.Newline:
- t.ws = true;
- t.sc = true;
- if (ws === -1) ws = i;
- if (sc === -1) sc = i;
- break;
- case TokenType.CommentML:
- if (ws !== -1) {
- tokens[ws].ws_last = i - 1;
- ws = -1;
- }
- t.sc = true;
- break;
- default:
- if (ws !== -1) {
- tokens[ws].ws_last = i - 1;
- ws = -1;
- }
- if (sc !== -1) {
- tokens[sc].sc_last = i - 1;
- sc = -1;
- }
- }
- }
- if (ws !== -1) tokens[ws].ws_last = i - 1;
- if (sc !== -1) tokens[sc].sc_last = i - 1;
- },
- markBrackets: function() {
- var ps = [],
- sbs = [],
- cbs = [],
- t;
- for (var i = 0; i < tokens.length; i++) {
- t = tokens[i];
- switch(t.type) {
- case TokenType.LeftParenthesis:
- ps.push(i);
- break;
- case TokenType.RightParenthesis:
- if (ps.length) {
- t.left = ps.pop();
- tokens[t.left].right = i;
- }
- break;
- case TokenType.LeftSquareBracket:
- sbs.push(i);
- break;
- case TokenType.RightSquareBracket:
- if (sbs.length) {
- t.left = sbs.pop();
- tokens[t.left].right = i;
- }
- break;
- case TokenType.LeftCurlyBracket:
- cbs.push(i);
- break;
- case TokenType.RightCurlyBracket:
- if (cbs.length) {
- t.left = cbs.pop();
- tokens[t.left].right = i;
- }
- break;
- }
- }
- },
- parseMLComment: function(css) {
- var start = pos;
- for (pos = pos + 2; pos < css.length; pos++) {
- if (css.charAt(pos) === '*' && css.charAt(pos + 1) === '/') {
- pos++;
- break;
- }
- }
- pushToken(TokenType.CommentML, css.substring(start, pos + 1));
- },
- parseSLComment: function(css) {
- var start = pos;
- for (pos = pos + 2; pos < css.length; pos++) {
- if (css.charAt(pos) === '\n' || css.charAt(pos) === '\r') {
- break;
- }
- }
- pushToken(TokenType.CommentSL, css.substring(start, pos));
- pos--;
- }
-};
-(function() {
- var scss = Object.create(syntaxes.css);
- scss.checkAny = function(i) {
- return this.checkBraces(i) ||
- this.checkString(i) ||
- this.checkVariablesList(i) ||
- this.checkVariable(i) ||
- this.checkPlaceholder(i) ||
- this.checkPercentage(i) ||
- this.checkDimension(i) ||
- this.checkNumber(i) ||
- this.checkUri(i) ||
- this.checkFunctionExpression(i) ||
- this.checkFunction(i) ||
- this.checkIdent(i) ||
- this.checkClass(i) ||
- this.checkUnary(i);
- };
- scss.getAny = function() {
- if (this.checkBraces(pos)) return this.getBraces();
- else if (this.checkString(pos)) return this.getString();
- else if (this.checkVariablesList(pos)) return this.getVariablesList();
- else if (this.checkVariable(pos)) return this.getVariable();
- else if (this.checkPlaceholder(pos)) return this.getPlaceholder();
- else if (this.checkPercentage(pos)) return this.getPercentage();
- else if (this.checkDimension(pos)) return this.getDimension();
- else if (this.checkNumber(pos)) return this.getNumber();
- else if (this.checkUri(pos)) return this.getUri();
- else if (this.checkFunctionExpression(pos)) return this.getFunctionExpression();
- else if (this.checkFunction(pos)) return this.getFunction();
- else if (this.checkIdent(pos)) return this.getIdent();
- else if (this.checkClass(pos)) return this.getClass();
- else if (this.checkUnary(pos)) return this.getUnary();
- };
- scss.checkArguments = function (i) {
- var start = i,
- l;
- if (i >= tokensLength ||
- tokens[i].type !== TokenType.LeftParenthesis) return 0;
- i++;
- while (i < tokens[start].right) {
- if (l = this.checkArgument(i)) i +=l;
- else return 0;
- }
- return tokens[start].right - start + 1;
- };
- scss.getArguments = function() {
- var startPos = pos,
- arguments = [],
- x;
- pos++;
- while (x = this.getArgument()) {
- if ((needInfo && typeof x[1] === 'string') || typeof x[0] === 'string') arguments.push(x);
- else arguments = arguments.concat(x);
- }
- pos++;
- x = [NodeType.ArgumentsType].concat(arguments);
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkArgument = function(i) {
- return this.checkDeclaration(i) ||
- this.checkVariablesList(i) ||
- this.checkVariable(i) ||
- this.checkSC(i) ||
- this.checkDelim(i) ||
- this.checkDeclDelim(i) ||
- this.checkString(i) ||
- this.checkPercentage(i) ||
- this.checkDimension(i) ||
- this.checkNumber(i) ||
- this.checkUri(i) ||
- this.checkIdent(i) ||
- this.checkVhash(i);
- };
- scss.getArgument = function() {
- if (this.checkDeclaration(pos)) return this.getDeclaration();
- else if (this.checkVariablesList(pos)) return this.getVariablesList();
- else if (this.checkVariable(pos)) return this.getVariable();
- else if (this.checkSC(pos)) return this.getSC();
- else if (this.checkDelim(pos)) return this.getDelim();
- else if (this.checkDeclDelim(pos)) return this.getDeclDelim();
- else if (this.checkString(pos)) return this.getString();
- else if (this.checkPercentage(pos)) return this.getPercentage();
- else if (this.checkDimension(pos)) return this.getDimension();
- else if (this.checkNumber(pos)) return this.getNumber();
- else if (this.checkUri(pos)) return this.getUri();
- else if (this.checkIdent(pos)) return this.getIdent();
- else if (this.checkVhash(pos)) return this.getVhash();
- };
- scss.checkBlockdecl1 = function(i) {
- var start = i,
- l;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkCondition(i)) tokens[i].bd_kind = 1;
- else if (l = this.checkInclude(i)) tokens[i].bd_kind = 2;
- else if (l = this.checkLoop(i)) tokens[i].bd_kind = 3;
- else if (l = this.checkFilter(i)) tokens[i].bd_kind = 4;
- else if (l = this.checkDeclaration(i)) tokens[i].bd_kind = 5;
- else if (l = this.checkAtrule(i)) tokens[i].bd_kind = 6;
- else if (l = this.checkRuleset(i)) tokens[i].bd_kind = 7;
- else return 0;
- i += l;
- if (i < tokensLength && (l = this.checkDeclDelim(i))) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- else return 0;
- return i - start;
- };
- scss.getBlockdecl1 = function() {
- var sc = this.getSC(),
- x;
- switch (tokens[pos].bd_kind) {
- case 1:
- x = this.getCondition();
- break;
- case 2:
- x = this.getInclude();
- break;
- case 3:
- x = this.getLoop();
- break;
- case 4:
- x = this.getFilter();
- break;
- case 5:
- x = this.getDeclaration();
- break;
- case 6:
- x = this.getAtrule();
- break;
- case 7:
- x = this.getRuleset();
- break;
- }
- return sc
- .concat([x])
- .concat([this.getDeclDelim()])
- .concat(this.getSC());
- };
- scss.checkBlockdecl2 = function(i) {
- var start = i,
- l;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkCondition(i)) tokens[i].bd_kind = 1;
- else if (l = this.checkInclude(i)) tokens[i].bd_kind = 2;
- else if (l = this.checkLoop(i)) tokens[i].bd_kind = 3;
- else if (l = this.checkFilter(i)) tokens[i].bd_kind = 4;
- else if (l = this.checkDeclaration(i)) tokens[i].bd_kind = 5;
- else if (l = this.checkAtrule(i)) tokens[i].bd_kind = 6;
- else if (l = this.checkRuleset(i)) tokens[i].bd_kind = 7;
- else return 0;
- i += l;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- };
- scss.getBlockdecl2 = function() {
- var sc = this.getSC(),
- x;
- switch (tokens[pos].bd_kind) {
- case 1:
- x = this.getCondition();
- break;
- case 2:
- x = this.getInclude();
- break;
- case 3:
- x = this.getLoop();
- break;
- case 4:
- x = this.getFilter();
- break;
- case 5:
- x = this.getDeclaration();
- break;
- case 6:
- x = this.getAtrule();
- break;
- case 7:
- x = this.getRuleset();
- break;
- }
- return sc
- .concat([x])
- .concat(this.getSC());
- };
- scss.checkClass = function(i) {
- var l;
- if (i >= tokensLength) return 0;
- if (tokens[i].class_l) return tokens[i].class_l;
- if (tokens[i++].type === TokenType.FullStop &&
- (l = this.checkInterpolatedVariable(i) || this.checkIdent(i))) {
- tokens[i].class_l = l + 1;
- return l + 1;
- }
- return 0;
- };
- scss.getClass = function() {
- var startPos = pos,
- x = [NodeType.ClassType];
- pos++;
- x.push(this.checkInterpolatedVariable(pos) ? this.getInterpolatedVariable() : this.getIdent());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkCommentSL = function(i) {
- return i < tokensLength && tokens[i].type === TokenType.CommentSL ? 1 : 0;
- };
- scss.getCommentSL = function() {
- var startPos = pos,
- x;
- x = [NodeType.CommentSLType, tokens[pos++].value.substring(2)];
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkCondition = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkAtkeyword(i)) i += l;
- else return 0;
- if (['if', 'else'].indexOf(tokens[start + 1].value) < 0) return 0;
- while (i < tokensLength) {
- if (l = this.checkBlock(i)) break;
- else if (l = this.checkVariable(i) ||
- this.checkIdent(i) ||
- this.checkSC(i) ||
- this.checkNumber(i) ||
- this.checkOperator(i) ||
- this.checkCombinator(i) ||
- this.checkString(i)) i += l;
- else return 0;
- }
- return i - start;
- };
- scss.getCondition = function() {
- var startPos = pos,
- x = [NodeType.ConditionType];
- x.push(this.getAtkeyword());
- while (pos < tokensLength) {
- if (this.checkBlock(pos)) break;
- else if (this.checkVariable(pos)) x.push(this.getVariable());
- else if (this.checkIdent(pos)) x.push(this.getIdent());
- else if (this.checkNumber(pos)) x.push(this.getNumber());
- else if (this.checkOperator(pos)) x.push(this.getOperator());
- else if (this.checkCombinator(pos)) x.push(this.getCombinator());
- else if (this.checkSC(pos)) x = x.concat(this.getSC());
- else if (this.checkString(pos)) x.push(this.getString());
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkDefault = function(i) {
- var start = i,
- l;
- if (i >= tokensLength ||
- tokens[i++].type !== TokenType.ExclamationMark) return 0;
- if (l = this.checkSC(i)) i += l;
- return tokens[i].value === 'default' ? i - start + 1 : 0;
- };
- scss.getDefault = function() {
- var startPos = pos,
- x = [NodeType.DefaultType],
- sc;
- pos++;
- sc = this.getSC();
- pos++;
- x = x.concat(sc);
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkIdent = function(i) {
- var start = i,
- wasIdent,
- l;
- if (i >= tokensLength) return 0;
- if (tokens[i].type === TokenType.LowLine) return this.checkIdentLowLine(i);
- if (tokens[i].type === TokenType.HyphenMinus ||
- tokens[i].type === TokenType.Identifier ||
- tokens[i].type === TokenType.DollarSign ||
- tokens[i].type === TokenType.Asterisk) i++;
- else return 0;
- wasIdent = tokens[i - 1].type === TokenType.Identifier;
- for (; i < tokensLength; i++) {
- if (l = this.checkInterpolatedVariable(i)) i += l;
- if (i >= tokensLength) break;
- if (tokens[i].type !== TokenType.HyphenMinus &&
- tokens[i].type !== TokenType.LowLine) {
- if (tokens[i].type !== TokenType.Identifier &&
- (tokens[i].type !== TokenType.DecimalNumber || !wasIdent)) break;
- else wasIdent = true;
- }
- }
- if (!wasIdent && tokens[start].type !== TokenType.Asterisk) return 0;
- tokens[start].ident_last = i - 1;
- return i - start;
- };
- scss.checkInclude = function(i) {
- var l;
- if (i >= tokensLength) return 0;
- if (l = this.checkInclude1(i)) tokens[i].include_type = 1;
- else if (l = this.checkInclude2(i)) tokens[i].include_type = 2;
- else if (l = this.checkInclude3(i)) tokens[i].include_type = 3;
- else if (l = this.checkInclude4(i)) tokens[i].include_type = 4;
- return l;
- };
- scss.getInclude = function() {
- switch (tokens[pos].include_type) {
- case 1: return this.getInclude1();
- case 2: return this.getInclude2();
- case 3: return this.getInclude3();
- case 4: return this.getInclude4();
- }
- };
- scss.checkInclude1 = function(i) {
- var start = i,
- l;
- if (l = this.checkAtkeyword(i)) i += l;
- else return 0;
- if (['include', 'extend'].indexOf(tokens[start + 1].value) < 0) return 0;
- if (l = this.checkSC(i)) i += l;
- else return 0;
- if (l = this.checkIncludeSelector(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkArguments(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkBlock(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- };
- scss.getInclude1 = function() {
- var startPos = pos,
- x = [NodeType.IncludeType];
- x.push(this.getAtkeyword());
- x = x.concat(this.getSC());
- x.push(this.getIncludeSelector());
- x = x.concat(this.getSC());
- x.push(this.getArguments());
- x = x.concat(this.getSC());
- x.push(this.getBlock());
- x = x.concat(this.getSC());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkInclude2 = function(i) {
- var start = i,
- l;
- if (l = this.checkAtkeyword(i)) i += l;
- else return 0;
- if (['include', 'extend'].indexOf(tokens[start + 1].value) < 0) return 0;
- if (l = this.checkSC(i)) i += l;
- else return 0;
- if (l = this.checkIncludeSelector(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkArguments(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- };
- scss.getInclude2 = function() {
- var startPos = pos,
- x = [NodeType.IncludeType];
- x.push(this.getAtkeyword());
- x = x.concat(this.getSC());
- x.push(this.getIncludeSelector());
- x = x.concat(this.getSC());
- x.push(this.getArguments());
- x = x.concat(this.getSC());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkInclude3 = function(i) {
- var start = i,
- l;
- if (l = this.checkAtkeyword(i)) i += l;
- else return 0;
- if (['include', 'extend'].indexOf(tokens[start + 1].value) < 0) return 0;
- if (l = this.checkSC(i)) i += l;
- else return 0;
- if (l = this.checkIncludeSelector(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkBlock(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- };
- scss.getInclude3 = function() {
- var startPos = pos,
- x = [NodeType.IncludeType];
- x.push(this.getAtkeyword());
- x = x.concat(this.getSC());
- x.push(this.getIncludeSelector());
- x = x.concat(this.getSC());
- x.push(this.getBlock());
- x = x.concat(this.getSC());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkInclude4 = function(i) {
- var start = i,
- l;
- if (l = this.checkAtkeyword(i)) i += l;
- else return 0;
- if (['include', 'extend'].indexOf(tokens[start + 1].value) < 0) return 0;
- if (l = this.checkSC(i)) i += l;
- else return 0;
- if (l = this.checkIncludeSelector(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- };
- scss.getInclude4 = function() {
- var startPos = pos,
- x = [NodeType.IncludeType];
- x.push(this.getAtkeyword());
- x = x.concat(this.getSC());
- x.push(this.getIncludeSelector());
- x = x.concat(this.getSC());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkIncludeSelector = function(i) {
- var start = i,
- l;
- while (i < tokensLength) {
- if (l = this.checkSimpleSelector2(i)) i += l;
- else break;
- }
- return i - start;
- };
- scss.getIncludeSelector = function() {
- var startPos = pos,
- x = [NodeType.SimpleselectorType],
- t;
- while (pos < tokensLength && this.checkSimpleSelector2(pos)) {
- t = this.getSimpleSelector2();
- if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t);
- else x = x.concat(t);
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkInterpolatedVariable = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (tokens[i].type !== TokenType.NumberSign ||
- !tokens[i + 1] || tokens[i + 1].type !== TokenType.LeftCurlyBracket ||
- !tokens[i + 2] || tokens[i + 2].type !== TokenType.DollarSign) return 0;
- i += 3;
- if (l = this.checkIdent(i)) i += l;
- else return 0;
- return tokens[i].type === TokenType.RightCurlyBracket ? i - start + 1 : 0;
- };
- scss.getInterpolatedVariable = function() {
- var startPos = pos,
- x = [NodeType.InterpolatedVariableType];
- pos += 3;
- x.push(this.getIdent());
- pos++;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkLoop = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkAtkeyword(i)) i += l;
- else return 0;
- if (['for', 'each', 'while'].indexOf(tokens[start + 1].value) < 0) return 0;
- while (i < tokensLength) {
- if (l = this.checkBlock(i)) {
- i += l;
- break;
- } else if (l = this.checkVariable(i) ||
- this.checkIdent(i) ||
- this.checkSC(i) ||
- this.checkNumber(i) ||
- this.checkOperator(i) ||
- this.checkCombinator(i) ||
- this.checkString(i)) i += l;
- else return 0;
- }
- return i - start;
- };
- scss.getLoop = function() {
- var startPos = pos,
- x = [NodeType.LoopType];
- x.push(this.getAtkeyword());
- while (pos < tokensLength) {
- if (this.checkBlock(pos)) {
- x.push(this.getBlock());
- break;
- }
- else if (this.checkVariable(pos)) x.push(this.getVariable());
- else if (this.checkIdent(pos)) x.push(this.getIdent());
- else if (this.checkNumber(pos)) x.push(this.getNumber());
- else if (this.checkOperator(pos)) x.push(this.getOperator());
- else if (this.checkCombinator(pos)) x.push(this.getCombinator());
- else if (this.checkSC(pos)) x = x.concat(this.getSC());
- else if (this.checkString(pos)) x.push(this.getString());
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkMixin = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if ((l = this.checkAtkeyword(i)) && tokens[i + 1].value === 'mixin') i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkIdent(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkArguments(i)) i += l;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkBlock(i)) i += l;
- else return 0;
- return i - start;
- };
- scss.getMixin = function() {
- var startPos = pos,
- x = [NodeType.MixinType, this.getAtkeyword()];
- x = x.concat(this.getSC());
- if (this.checkIdent(pos)) x.push(this.getIdent());
- x = x.concat(this.getSC());
- if (this.checkArguments(pos)) x.push(this.getArguments());
- x = x.concat(this.getSC());
- if (this.checkBlock(pos)) x.push(this.getBlock());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkOperator = function(i) {
- if (i >= tokensLength) return 0;
- switch(tokens[i].type) {
- case TokenType.Solidus:
- case TokenType.Comma:
- case TokenType.Colon:
- case TokenType.EqualsSign:
- case TokenType.LessThanSign:
- case TokenType.GreaterThanSign:
- case TokenType.Asterisk:
- return 1;
- }
- return 0;
- };
- scss.checkParentSelector = function(i) {
- return i < tokensLength && tokens[i].type === TokenType.Ampersand ? 1 : 0;
- };
- scss.getParentSelector = function() {
- var startPos = pos,
- x = [NodeType.ParentSelectorType, '&'];
- pos++;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkPlaceholder = function(i) {
- var l;
- if (i >= tokensLength) return 0;
- if (tokens[i].placeholder_l) return tokens[i].placeholder_l;
- if (tokens[i].type === TokenType.PercentSign && (l = this.checkIdent(i + 1))) {
- tokens[i].placeholder_l = l + 1;
- return l + 1;
- } else return 0;
- };
- scss.getPlaceholder = function() {
- var startPos = pos,
- x = [NodeType.PlaceholderType];
- pos++;
- x.push(this.getIdent());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkProperty = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkVariable(i) || this.checkIdent(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- };
- scss.getProperty = function() {
- var startPos = pos,
- x = [NodeType.PropertyType];
- x.push(this.checkVariable(pos) ? this.getVariable() : this.getIdent());
- x = x.concat(this.getSC());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkPseudoe = function(i) {
- var l;
- if (i >= tokensLength || tokens[i++].type !== TokenType.Colon ||
- i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0;
- return (l = this.checkInterpolatedVariable(i) || this.checkIdent(i)) ? l + 2 : 0;
- };
- scss.getPseudoe = function() {
- var startPos = pos,
- x = [NodeType.PseudoeType];
- pos += 2;
- x.push(this.checkInterpolatedVariable(pos) ? this.getInterpolatedVariable() : this.getIdent());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkPseudoc = function(i) {
- var l;
- if (i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0;
- return (l = this.checkInterpolatedVariable(i) || this.checkFunction(i) || this.checkIdent(i)) ? l + 1 : 0;
- };
- scss.getPseudoc = function() {
- var startPos = pos,
- x = [NodeType.PseudocType];
- pos ++;
- if (this.checkInterpolatedVariable(pos)) x.push(this.getInterpolatedVariable());
- else if (this.checkFunction(pos)) x.push(this.getFunction());
- else x.push(this.getIdent());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkSC = function(i) {
- if (i >= tokensLength) return 0;
- var l,
- lsc = 0,
- ln = tokens[i].ln;
- while (i < tokensLength) {
- if (!(l = this.checkS(i)) &&
- !(l = this.checkCommentML(i)) &&
- !(l = this.checkCommentSL(i))) break;
- i += l;
- lsc += l;
- }
- return lsc || 0;
- };
- scss.getSC = function() {
- var sc = [];
- if (pos >= tokensLength) return sc;
- while (pos < tokensLength) {
- if (this.checkS(pos)) sc.push(this.getS());
- else if (this.checkCommentML(pos)) sc.push(this.getCommentML());
- else if (this.checkCommentSL(pos)) sc.push(this.getCommentSL());
- else break;
- }
- return sc;
- };
- scss.checkSimpleSelector1 = function(i) {
- return this.checkParentSelector(i) ||
- this.checkNthselector(i) ||
- this.checkCombinator(i) ||
- this.checkAttrib(i) ||
- this.checkPseudo(i) ||
- this.checkShash(i) ||
- this.checkAny(i) ||
- this.checkSC(i) ||
- this.checkNamespace(i);
- };
- scss.getSimpleSelector1 = function() {
- if (this.checkParentSelector(pos)) return this.getParentSelector();
- else if (this.checkNthselector(pos)) return this.getNthselector();
- else if (this.checkCombinator(pos)) return this.getCombinator();
- else if (this.checkAttrib(pos)) return this.getAttrib();
- else if (this.checkPseudo(pos)) return this.getPseudo();
- else if (this.checkShash(pos)) return this.getShash();
- else if (this.checkAny(pos)) return this.getAny();
- else if (this.checkSC(pos)) return this.getSC();
- else if (this.checkNamespace(pos)) return this.getNamespace();
- };
- scss.checkSimpleSelector2 = function(i) {
- return this.checkParentSelector(i) ||
- this.checkNthselector(i) ||
- this.checkAttrib(i) ||
- this.checkPseudo(i) ||
- this.checkShash(i) ||
- this.checkPlaceholder(i) ||
- this.checkIdent(i) ||
- this.checkClass(i);
- };
- scss.getSimpleSelector2 = function() {
- if (this.checkParentSelector(pos)) return this.getParentSelector();
- else if (this.checkNthselector(pos)) return this.getNthselector();
- else if (this.checkAttrib(pos)) return this.getAttrib();
- else if (this.checkPseudo(pos)) return this.getPseudo();
- else if (this.checkShash(pos)) return this.getShash();
- else if (this.checkPlaceholder(pos)) return this.getPlaceholder();
- else if (this.checkIdent(pos)) return this.getIdent();
- else if (this.checkClass(pos)) return this.getClass();
- };
- scss.checkStylesheet = function(i) {
- var start = i,
- l;
- while (i < tokensLength) {
- if (l = this.checkSC(i) ||
- this.checkDeclaration(i) ||
- this.checkDeclDelim(i) ||
- this.checkInclude(i) ||
- this.checkMixin(i) ||
- this.checkLoop(i) ||
- this.checkAtrule(i) ||
- this.checkRuleset(i)) i += l;
- else throwError(i);
- }
- return i - start;
- };
- scss.getStylesheet = function() {
- var startPos = pos,
- x = [NodeType.StylesheetType];
- while (pos < tokensLength) {
- if (this.checkSC(pos)) x = x.concat(this.getSC());
- else if (this.checkRuleset(pos)) x.push(this.getRuleset());
- else if (this.checkInclude(pos)) x.push(this.getInclude());
- else if (this.checkMixin(pos)) x.push(this.getMixin());
- else if (this.checkLoop(pos)) x.push(this.getLoop());
- else if (this.checkAtrule(pos)) x.push(this.getAtrule());
- else if (this.checkDeclaration(pos)) x.push(this.getDeclaration());
- else if (this.checkDeclDelim(pos)) x.push(this.getDeclDelim());
- else throwError();
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkValue = function(i) {
- var start = i,
- l;
- while (i < tokensLength) {
- if (l = this._checkValue(i)) i += l;
- if (!l || this.checkBlock(i - l)) break;
- }
- return i - start;
- };
- scss._checkValue = function(i) {
- return this.checkSC(i) ||
- this.checkInterpolatedVariable(i) ||
- this.checkVariable(i) ||
- this.checkVhash(i) ||
- this.checkBlock(i) ||
- this.checkAny(i) ||
- this.checkAtkeyword(i) ||
- this.checkOperator(i) ||
- this.checkImportant(i) ||
- this.checkDefault(i);
- };
- scss.getValue = function() {
- var startPos = pos,
- x = [NodeType.ValueType],
- t, _pos;
- while (pos < tokensLength) {
- _pos = pos;
- if (!this._checkValue(pos)) break;
- t = this._getValue();
- if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t);
- else x = x.concat(t);
- if (this.checkBlock(_pos)) break;
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss._getValue = function() {
- if (this.checkSC(pos)) return this.getSC();
- else if (this.checkInterpolatedVariable(pos)) return this.getInterpolatedVariable();
- else if (this.checkVariable(pos)) return this.getVariable();
- else if (this.checkVhash(pos)) return this.getVhash();
- else if (this.checkBlock(pos)) return this.getBlock();
- else if (this.checkAny(pos)) return this.getAny();
- else if (this.checkAtkeyword(pos)) return this.getAtkeyword();
- else if (this.checkOperator(pos)) return this.getOperator();
- else if (this.checkImportant(pos)) return this.getImportant();
- else if (this.checkDefault(pos)) return this.getDefault();
- };
- scss.checkVariable = function(i) {
- var l;
- if (i >= tokensLength || tokens[i].type !== TokenType.DollarSign) return 0;
- return (l = this.checkIdent(i + 1)) ? l + 1 : 0;
- };
- scss.getVariable = function() {
- var startPos = pos,
- x = [NodeType.VariableType];
- pos++;
- x.push(this.getIdent());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkVariablesList = function(i) {
- var d = 0,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkVariable(i)) i+= l;
- else return 0;
- while (i < tokensLength && tokens[i].type === TokenType.FullStop) {
- d++;
- i++;
- }
- return d === 3 ? l + d : 0;
- };
- scss.getVariablesList = function() {
- var startPos = pos,
- x = [NodeType.VariablesListType, this.getVariable()];
- pos += 3;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.markSC = function() {
- var ws = -1,
- sc = -1,
- t;
- for (var i = 0; i < tokensLength; i++) {
- t = tokens[i];
- switch (t.type) {
- case TokenType.Space:
- case TokenType.Tab:
- case TokenType.Newline:
- t.ws = true;
- t.sc = true;
- if (ws === -1) ws = i;
- if (sc === -1) sc = i;
- break;
- case TokenType.CommentML:
- case TokenType.CommentSL:
- if (ws !== -1) {
- tokens[ws].ws_last = i - 1;
- ws = -1;
- }
- t.sc = true;
- break;
- default:
- if (ws !== -1) {
- tokens[ws].ws_last = i - 1;
- ws = -1;
- }
- if (sc !== -1) {
- tokens[sc].sc_last = i - 1;
- sc = -1;
- }
- }
- }
- if (ws !== -1) tokens[ws].ws_last = i - 1;
- if (sc !== -1) tokens[sc].sc_last = i - 1;
- };
- syntaxes.scss = scss;
-})();
-(function() {
- var sass = Object.create(syntaxes.scss);
- sass.checkBlock = function(i) {
- return i < tokensLength && tokens[i].block_end ?
- tokens[i].block_end - i + 1 : 0;
- };
- sass.getBlock = function() {
- var startPos = pos,
- end = tokens[pos].block_end,
- x = [NodeType.BlockType];
- while (pos < end) {
- if (this.checkBlockdecl(pos)) x = x.concat(this.getBlockdecl());
- else throwError();
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- sass.getCommentML = function() {
- var startPos = pos,
- s = tokens[pos].value.substring(2),
- l = s.length,
- x;
- pos++;
- x = [NodeType.CommentMLType, s];
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- sass.checkDeclaration = function(i) {
- return this.checkDeclaration1(i) || this.checkDeclaration2(i);
- };
- sass.getDeclaration = function() {
- return this.checkDeclaration1(pos) ? this.getDeclaration1() : this.getDeclaration2();
- };
- sass.checkDeclaration1 = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkProperty(i)) i += l;
- else return 0;
- if (l = this.checkPropertyDelim(i)) i++;
- else return 0;
- if (l = this.checkValue(i)) i += l;
- else return 0;
- return i - start;
- };
- sass.getDeclaration1 = function() {
- var startPos = pos,
- x = [NodeType.DeclarationType];
- x.push(this.getProperty());
- x.push(this.getPropertyDelim());
- x.push(this.getValue());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- sass.checkDeclaration2 = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkPropertyDelim(i)) i++;
- else return 0;
- if (l = this.checkProperty(i)) i += l;
- else return 0;
- if (l = this.checkValue(i)) i += l;
- else return 0;
- return i - start;
- };
- sass.getDeclaration2 = function() {
- var startPos = pos,
- x = [NodeType.DeclarationType];
- x.push(this.getPropertyDelim());
- x.push(this.getProperty());
- x.push(this.getValue());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- sass.checkDeclDelim = function(i) {
- if (i >= tokensLength) return 0;
- return (tokens[i].type === TokenType.Newline ||
- tokens[i].type === TokenType.Semicolon) ? 1 : 0;
- };
- sass.checkFilterv = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkProgid(i)) i += l;
- else return 0;
- while (l = this.checkProgid(i)) {
- i += l;
- }
- tokens[start].last_progid = i;
- if (this.checkDeclDelim(i)) return i - start;
- if (i < tokensLength && (l = this.checkSC(i))) i += l;
- if (i < tokensLength && (l = this.checkImportant(i))) i += l;
- return i - start;
- };
- sass.getFilterv = function() {
- var startPos = pos,
- x = [NodeType.FiltervType],
- last_progid = tokens[pos].last_progid;
- while (pos < last_progid) {
- x.push(this.getProgid());
- }
- if (this.checkDeclDelim(pos)) return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- if (this.checkSC(pos)) x = x.concat(this.getSC());
- if (pos < tokensLength && this.checkImportant(pos)) x.push(this.getImportant());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- sass.checkInclude = function(i) {
- var l;
- if (i >= tokensLength) return 0;
- if (l = this.checkInclude1(i)) tokens[i].include_type = 1;
- else if (l = this.checkInclude2(i)) tokens[i].include_type = 2;
- else if (l = this.checkInclude3(i)) tokens[i].include_type = 3;
- else if (l = this.checkInclude4(i)) tokens[i].include_type = 4;
- else if (l = this.checkInclude5(i)) tokens[i].include_type = 5;
- else if (l = this.checkInclude6(i)) tokens[i].include_type = 6;
- else if (l = this.checkInclude7(i)) tokens[i].include_type = 7;
- else if (l = this.checkInclude8(i)) tokens[i].include_type = 8;
- return l;
- };
- sass.getInclude = function() {
- switch (tokens[pos].include_type) {
- case 1: return this.getInclude1();
- case 2: return this.getInclude2();
- case 3: return this.getInclude3();
- case 4: return this.getInclude4();
- case 5: return this.getInclude5();
- case 6: return this.getInclude6();
- case 7: return this.getInclude7();
- case 8: return this.getInclude8();
- }
- };
- sass.checkInclude5 = function(i) {
- var start = i,
- l;
- if (tokens[i].type === TokenType.PlusSign) i++;
- else return 0;
- if (l = this.checkIncludeSelector(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkArguments(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkBlock(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- };
- sass.getInclude5 = function() {
- var startPos = pos,
- x = [NodeType.IncludeType];
- x.push(this.getOperator());
- x.push(this.getIncludeSelector());
- x = x.concat(this.getSC());
- x.push(this.getArguments());
- x = x.concat(this.getSC());
- x.push(this.getBlock());
- x = x.concat(this.getSC());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- sass.checkInclude6 = function(i) {
- var start = i,
- l;
- if (tokens[i].type === TokenType.PlusSign) i++;
- else return 0;
- if (l = this.checkIncludeSelector(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkArguments(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- };
- sass.getInclude6 = function() {
- var startPos = pos,
- x = [NodeType.IncludeType];
- x.push(this.getOperator());
- x.push(this.getIncludeSelector());
- x = x.concat(this.getSC());
- x.push(this.getArguments());
- x = x.concat(this.getSC());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- sass.checkInclude7 = function(i) {
- var start = i,
- l;
- if (tokens[i].type === TokenType.PlusSign) i++;
- else return 0;
- if (l = this.checkIncludeSelector(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkBlock(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- };
- sass.getInclude7 = function() {
- var startPos = pos,
- x = [NodeType.IncludeType];
- x.push(this.getOperator());
- x.push(this.getIncludeSelector());
- x = x.concat(this.getSC());
- x.push(this.getBlock());
- x = x.concat(this.getSC());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- sass.checkInclude8 = function(i) {
- var start = i,
- l;
- if (tokens[i].type === TokenType.PlusSign) i++;
- else return 0;
- if (l = this.checkIncludeSelector(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- };
- sass.getInclude8 = function() {
- var startPos = pos,
- x = [NodeType.IncludeType];
- x.push(this.getOperator());
- x.push(this.getIncludeSelector());
- x = x.concat(this.getSC());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- sass.checkMixin = function(i) {
- return this.checkMixin1(i) || this.checkMixin2(i);
- };
- sass.getMixin = function() {
- return this.checkMixin1(pos) ? this.getMixin1() : this.getMixin2();
- };
- sass.checkMixin1 = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if ((l = this.checkAtkeyword(i)) && tokens[i + 1].value === 'mixin') i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkIdent(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkBlock(i)) i += l;
- else {
- if (l = this.checkArguments(i)) i += l;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkBlock(i)) i += l;
- else return 0;
- }
- return i - start;
- };
- sass.getMixin1 = function() {
- var startPos = pos,
- x = [NodeType.MixinType, this.getAtkeyword()];
- x = x.concat(this.getSC());
- if (this.checkIdent(pos)) x.push(this.getIdent());
- x = x.concat(this.getSC());
- if (this.checkBlock(pos)) x.push(this.getBlock());
- else {
- if (this.checkArguments(pos)) x.push(this.getArguments());
- x = x.concat(this.getSC());
- x.push(this.getBlock());
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- sass.checkMixin2 = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (tokens[i].type === TokenType.EqualsSign) i++;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkIdent(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkBlock(i)) i += l;
- else {
- if (l = this.checkArguments(i)) i += l;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkBlock(i)) i += l;
- else return 0;
- }
- return i - start;
- };
- sass.getMixin2 = function() {
- var startPos = pos,
- x = [NodeType.MixinType, this.getOperator()];
- x = x.concat(this.getSC());
- if (this.checkIdent(pos)) x.push(this.getIdent());
- x = x.concat(this.getSC());
- if (this.checkBlock(pos)) x.push(this.getBlock());
- else {
- if (this.checkArguments(pos)) x.push(this.getArguments());
- x = x.concat(this.getSC());
- x.push(this.getBlock());
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- sass.checkProgid = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkSC(i)) i += l;
- if (joinValues2(i, 6) === 'progid:DXImageTransform.Microsoft.') i += 6;
- else return 0;
- if (l = this.checkIdent(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (tokens[i].type === TokenType.LeftParenthesis) {
- tokens[start].progid_end = tokens[i].right;
- i = tokens[i].right + 1;
- } else return 0;
- return i - start;
- };
- sass.getProgid = function() {
- var startPos = pos,
- progid_end = tokens[pos].progid_end,
- x;
- x = [NodeType.ProgidType]
- .concat(this.getSC())
- .concat([this._getProgid(progid_end)]);
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- sass.checkSC = function(i) {
- if (!tokens[i]) return 0;
- var l,
- lsc = 0,
- ln = tokens[i].ln;
- while (i < tokensLength) {
- if (tokens[i].ln !== ln) break;
- if (!(l = this.checkS(i)) &&
- !(l = this.checkCommentML(i)) &&
- !(l = this.checkCommentSL(i))) break;
- i += l;
- lsc += l;
- }
- return lsc || 0;
- };
- sass.getSC = function() {
- var sc = [],
- ln;
- if (pos >= tokensLength) return sc;
- ln = tokens[pos].ln;
- while (pos < tokensLength) {
- if (tokens[pos].ln !== ln) break;
- else if (this.checkS(pos)) sc.push(this.getS());
- else if (this.checkCommentML(pos)) sc.push(this.getCommentML());
- else if (this.checkCommentSL(pos)) sc.push(this.getCommentSL());
- else break;
- }
- return sc;
- };
- sass.checkSelector = function(i) {
- var start = i,
- l, ln;
- if (i >= tokensLength) return 0;
- ln = tokens[i].ln;
- while (i < tokensLength) {
- if (tokens[i].ln !== ln) break;
- if ((l = this.checkDeclDelim(i) && this.checkBlock(i + l)) || this.checkSC(i)) i += l;
- if (l = this.checkSimpleSelector(i) || this.checkDelim(i)) i += l;
- else break;
- }
- tokens[start].selector_end = i - 1;
- return i - start;
- };
- sass.getSelector = function() {
- var startPos = pos,
- x = [NodeType.SelectorType],
- selector_end = tokens[pos].selector_end,
- ln = tokens[pos].ln;
- while (pos <= selector_end) {
- if (tokens[pos].ln !== ln) break;
- if ((l = this.checkDeclDelim(pos)) && this.checkBlock(pos + l)) x.push(this.getDeclDelim());
- else if (this.checkSC(pos)) x = x.concat(this.getSC());
- x.push(this.checkDelim(pos) ? this.getDelim() : this.getSimpleSelector());
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- sass.checkSimpleSelector = function(i) {
- if (i >= tokensLength) return 0;
- var start = i,
- l,
- ln = tokens[i].ln;
- while (i < tokensLength) {
- if (tokens[i].ln !== ln) break;
- if (l = this.checkSimpleSelector1(i)) i += l;
- else break;
- }
- return (i - start) || 0;
- };
- sass.getSimpleSelector = function() {
- var startPos = pos,
- x = [NodeType.SimpleselectorType],
- t,
- ln = tokens[pos].ln;
- while (pos < tokensLength) {
- if (tokens[pos].ln !== ln ||
- !this.checkSimpleSelector1(pos)) break;
- t = this.getSimpleSelector1();
- if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t);
- else x = x.concat(t);
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- sass.checkValue = function(i) {
- var start = i,
- l;
- while (i < tokensLength) {
- if (this.checkDeclDelim(i)) break;
- if (l = this._checkValue(i)) i += l;
- if (!l || this.checkBlock(i - l)) break;
- }
- return i - start;
- };
- sass.getValue = function() {
- var startPos = pos,
- x = [NodeType.ValueType],
- t, _pos;
- while (pos < tokensLength) {
- _pos = pos;
- if (this.checkDeclDelim(pos)) break;
- if (!this._checkValue(pos)) break;
- t = this._getValue();
- if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t);
- else x = x.concat(t);
- if (this.checkBlock(_pos)) break;
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- sass._checkValue = function(i) {
- return this.checkS(i) ||
- this.checkCommentML(i) ||
- this.checkCommentSL(i) ||
- this.checkVhash(i) ||
- this.checkAny(i) ||
- this.checkOperator(i) ||
- this.checkImportant(i);
- };
- sass._getValue = function() {
- if (this.checkS(pos)) return this.getS();
- if (this.checkCommentML(pos)) return this.getCommentML();
- if (this.checkCommentSL(pos)) return this.getCommentSL();
- else if (this.checkVhash(pos)) return this.getVhash();
- else if (this.checkAny(pos)) return this.getAny();
- else if (this.checkOperator(pos)) return this.getOperator();
- else if (this.checkImportant(pos)) return this.getImportant();
- };
- sass.markSC = function() {
- var ws = -1,
- sc = -1,
- t;
- for (var i = 0; i < tokensLength; i++) {
- t = tokens[i];
- switch (t.type) {
- case TokenType.Space:
- case TokenType.Tab:
- t.ws = true;
- t.sc = true;
- if (ws === -1) ws = i;
- if (sc === -1) sc = i;
- break;
- case TokenType.Newline:
- t.ws = true;
- t.sc = true;
- ws = ws === -1 ? i : ws;
- sc = sc === -1 ? i : ws;
- tokens[ws].ws_last = i;
- tokens[sc].sc_last = i;
- ws = -1;
- sc = -1;
- break;
- case TokenType.CommentML:
- case TokenType.CommentSL:
- if (ws !== -1) {
- tokens[ws].ws_last = i - 1;
- ws = -1;
- }
- t.sc = true;
- break;
- default:
- if (ws !== -1) {
- tokens[ws].ws_last = i - 1;
- ws = -1;
- }
- if (sc !== -1) {
- tokens[sc].sc_last = i - 1;
- sc = -1;
- }
- }
- }
- if (ws !== -1) tokens[ws].ws_last = i - 1;
- if (sc !== -1) tokens[sc].sc_last = i - 1;
- };
- sass.markBlocks = function() {
- var blocks = [],
- currentLN = 1,
- currentIL = 0,
- prevIL = 0,
- i = 0,
- l = tokens.length,
- iw;
- for (; i != l; i++) {
- if (!tokens[i - 1]) continue;
- if (tokens[i].ln == currentLN) continue;
- else currentLN = tokens[i].ln;
- prevIL = currentIL;
- if (tokens[i].type !== TokenType.Space) currentIL = 0;
- else {
- if (!iw) iw = tokens[i].value.length;
- prevIL = currentIL;
- currentIL = tokens[i].value.length / iw;
- }
- if (prevIL === currentIL) continue;
- else if (currentIL > prevIL) {
- blocks.push(i);
- continue;
- } else {
- var il = prevIL;
- while (blocks.length > 0 && il !== currentIL) {
- tokens[blocks.pop()].block_end = i - 1;
- il--;
- }
- }
- }
- while (blocks.length > 0) {
- tokens[blocks.pop()].block_end = i - 1;
- }
- };
- sass.parseMLComment = function(css) {
- var start = pos;
- var il = 0;
- for (var _pos = pos - 1; _pos > -1; _pos--) {
- if (css.charAt(_pos) === ' ') il++;
- else break;
- }
- for (pos = pos + 2; pos < css.length; pos++) {
- if (css.charAt(pos) === '\n') {
- var _il = 0;
- for (var _pos = pos + 1; _pos < css.length; _pos++) {
- if (css.charAt(_pos) === ' ') _il++;
- else break;
- }
- if (_il > il) {
- pos = _pos;
- } else break;
- }
- }
- pushToken(TokenType.CommentML, css.substring(start, pos + 1));
- };
- sass.parseSLComment = function(css) {
- var start = pos;
- var il = 0;
- var onlyToken = false;
- for (var _pos = pos - 1; _pos > -1; _pos--) {
- if (css.charAt(_pos) === ' ') il++;
- else if (css.charAt(_pos) === '\n') {
- onlyToken = true;
- break;
- } else break;
- }
- if (_pos === -1) onlyToken = true;
- if (!onlyToken) {
- for (pos = pos + 2; pos < css.length; pos++) {
- if (css.charAt(pos) === '\n' || css.charAt(pos) === '\r') {
- break;
- }
- }
- } else {
- for (pos = pos + 2; pos < css.length; pos++) {
- if (css.charAt(pos) === '\n') {
- var _il = 0;
- for (var _pos = pos + 1; _pos < css.length; _pos++) {
- if (css.charAt(_pos) === ' ') _il++;
- else break;
- }
- if (_il > il) {
- pos = _pos;
- } else break;
- }
- }
- }
- pushToken(TokenType.CommentSL, css.substring(start, pos));
- pos--;
- };
- syntaxes.sass = sass;
-})();
-(function() {
- var less = Object.create(syntaxes.css);
- less.checkAny = function(i) {
- return this.checkBraces(i) ||
- this.checkString(i) ||
- this.checkVariablesList(i) ||
- this.checkVariable(i) ||
- this.checkPercentage(i) ||
- this.checkDimension(i) ||
- this.checkNumber(i) ||
- this.checkUri(i) ||
- this.checkFunctionExpression(i) ||
- this.checkFunction(i) ||
- this.checkIdent(i) ||
- this.checkClass(i) ||
- this.checkUnary(i);
- };
- less.getAny = function() {
- if (this.checkBraces(pos)) return this.getBraces();
- else if (this.checkString(pos)) return this.getString();
- else if (this.checkVariablesList(pos)) return this.getVariablesList();
- else if (this.checkVariable(pos)) return this.getVariable();
- else if (this.checkPercentage(pos)) return this.getPercentage();
- else if (this.checkDimension(pos)) return this.getDimension();
- else if (this.checkNumber(pos)) return this.getNumber();
- else if (this.checkUri(pos)) return this.getUri();
- else if (this.checkFunctionExpression(pos)) return this.getFunctionExpression();
- else if (this.checkFunction(pos)) return this.getFunction();
- else if (this.checkIdent(pos)) return this.getIdent();
- else if (this.checkClass(pos)) return this.getClass();
- else if (this.checkUnary(pos)) return this.getUnary();
- };
- less.checkArguments = function (i) {
- var start = i,
- l;
- if (i >= tokensLength ||
- tokens[i++].type !== TokenType.LeftParenthesis) return 0;
- while (i < tokens[start].right) {
- if (l = this.checkArgument(i)) i +=l;
- else return 0;
- }
- return tokens[start].right - start + 1;
- };
- less.getArguments = function() {
- var startPos = pos,
- arguments = [],
- x;
- pos++;
- while (x = this.getArgument()) {
- if ((needInfo && typeof x[1] === 'string') || typeof x[0] === 'string') arguments.push(x);
- else arguments = arguments.concat(x);
- }
- pos++;
- x = [NodeType.ArgumentsType].concat(arguments);
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.checkArgument = function(i) {
- return this.checkDeclaration(i) ||
- this.checkVariablesList(i) ||
- this.checkVariable(i) ||
- this.checkSC(i) ||
- this.checkDelim(i) ||
- this.checkDeclDelim(i) ||
- this.checkString(i) ||
- this.checkPercentage(i) ||
- this.checkDimension(i) ||
- this.checkNumber(i) ||
- this.checkUri(i) ||
- this.checkIdent(i) ||
- this.checkVhash(i);
- };
- less.getArgument = function() {
- if (this.checkDeclaration(pos)) return this.getDeclaration();
- else if (this.checkVariablesList(pos)) return this.getVariablesList();
- else if (this.checkVariable(pos)) return this.getVariable();
- else if (this.checkSC(pos)) return this.getSC();
- else if (this.checkDelim(pos)) return this.getDelim();
- else if (this.checkDeclDelim(pos)) return this.getDeclDelim();
- else if (this.checkString(pos)) return this.getString();
- else if (this.checkPercentage(pos)) return this.getPercentage();
- else if (this.checkDimension(pos)) return this.getDimension();
- else if (this.checkNumber(pos)) return this.getNumber();
- else if (this.checkUri(pos)) return this.getUri();
- else if (this.checkIdent(pos)) return this.getIdent();
- else if (this.checkVhash(pos)) return this.getVhash();
- };
- less.checkBlockdecl1 = function(i) {
- var start = i,
- l;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkCondition(i)) tokens[i].bd_kind = 1;
- else if (l = this.checkInclude(i)) tokens[i].bd_kind = 2;
- else if (l = this.checkFilter(i)) tokens[i].bd_kind = 3;
- else if (l = this.checkDeclaration(i)) tokens[i].bd_kind = 4;
- else if (l = this.checkAtrule(i)) tokens[i].bd_kind = 5;
- else if (l = this.checkRuleset(i)) tokens[i].bd_kind = 6;
- else return 0;
- i += l;
- if (i < tokensLength && (l = this.checkDeclDelim(i))) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- else return 0;
- return i - start;
- }
- less.getBlockdecl1 = function() {
- var sc = this.getSC(),
- x;
- switch (tokens[pos].bd_kind) {
- case 1:
- x = this.getCondition();
- break;
- case 2:
- x = this.getInclude();
- break;
- case 3:
- x = this.getFilter();
- break;
- case 4:
- x = this.getDeclaration();
- break;
- case 5:
- x = this.getAtrule();
- break;
- case 6:
- x = this.getRuleset();
- break;
- }
- return sc
- .concat([x])
- .concat([this.getDeclDelim()])
- .concat(this.getSC());
- };
- less.checkBlockdecl2 = function(i) {
- var start = i,
- l;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkCondition(i)) tokens[i].bd_kind = 1;
- else if (l = this.checkInclude(i)) tokens[i].bd_kind = 2;
- else if (l = this.checkFilter(i)) tokens[i].bd_kind = 3;
- else if (l = this.checkDeclaration(i)) tokens[i].bd_kind = 4;
- else if (l = this.checkAtrule(i)) tokens[i].bd_kind = 5;
- else if (l = this.checkRuleset(i)) tokens[i].bd_kind = 6;
- else return 0;
- i += l;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- };
- less.getBlockdecl2 = function() {
- var sc = this.getSC(),
- x;
- switch (tokens[pos].bd_kind) {
- case 1:
- x = this.getCondition();
- break;
- case 2:
- x = this.getInclude();
- break;
- case 3:
- x = this.getFilter();
- break;
- case 4:
- x = this.getDeclaration();
- break;
- case 5:
- x = this.getAtrule();
- break;
- case 6:
- x = this.getRuleset();
- break;
- }
- return sc
- .concat([x])
- .concat(this.getSC());
- };
- less.checkClass = function(i) {
- var l;
- if (i >= tokensLength) return 0;
- if (tokens[i].class_l) return tokens[i].class_l;
- if (tokens[i++].type === TokenType.FullStop &&
- (l = this.checkInterpolatedVariable(i) || this.checkIdent(i))) {
- tokens[i].class_l = l + 1;
- return l + 1;
- }
- return 0;
- };
- less.getClass = function() {
- var startPos = pos,
- x = [NodeType.ClassType];
- pos++;
- x.push(this.checkInterpolatedVariable(pos) ? this.getInterpolatedVariable() : this.getIdent());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.checkCommentSL = function(i) {
- return i < tokensLength && tokens[i].type === TokenType.CommentSL ? 1 : 0;
- };
- less.getCommentSL = function() {
- var startPos = pos,
- x;
- x = [NodeType.CommentSLType, tokens[pos++].value.substring(2)];
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.checkCondition = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if ((l = this.checkIdent(i)) && tokens[i].value === 'when') i += l;
- else return 0;
- while (i < tokensLength) {
- if (l = this.checkBlock(i)) break;
- if (l = this.checkFunction(i) |
- this.checkBraces(i) ||
- this.checkVariable(i) ||
- this.checkIdent(i) ||
- this.checkSC(i) ||
- this.checkNumber(i) ||
- this.checkDelim(i) ||
- this.checkOperator(i) ||
- this.checkCombinator(i) ||
- this.checkString(i)) i += l;
- else return 0;
- }
- return i - start;
- };
- less.getCondition = function() {
- var startPos = pos,
- x = [NodeType.ConditionType];
- x.push(this.getIdent());
- while (pos < tokensLength) {
- if (this.checkBlock(pos)) break;
- else if (this.checkFunction(pos)) x.push(this.getFunction());
- else if (this.checkBraces(pos)) x.push(this.getBraces());
- else if (this.checkVariable(pos)) x.push(this.getVariable());
- else if (this.checkIdent(pos)) x.push(this.getIdent());
- else if (this.checkNumber(pos)) x.push(this.getNumber());
- else if (this.checkDelim(pos)) x.push(this.getDelim());
- else if (this.checkOperator(pos)) x.push(this.getOperator());
- else if (this.checkCombinator(pos)) x.push(this.getCombinator());
- else if (this.checkSC(pos)) x = x.concat(this.getSC());
- else if (this.checkString(pos)) x.push(this.getString());
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.checkEscapedString = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (tokens[i].type === TokenType.Tilde && (l = this.checkString(i + 1))) return i + l - start;
- else return 0;
- };
- less.getEscapedString = function() {
- var startPos = pos,
- x = [NodeType.EscapedStringType];
- pos++;
- x.push(tokens[pos++].value);
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.checkFilterv = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkProgid(i) || this.checkEscapedString(i)) i += l;
- else return 0;
- while (l = this.checkProgid(i) || this.checkEscapedString(i)) {
- i += l;
- }
- tokens[start].last_progid = i;
- if (i < tokensLength && (l = this.checkSC(i))) i += l;
- if (i < tokensLength && (l = this.checkImportant(i))) i += l;
- return i - start;
- };
- less.getFilterv = function() {
- var startPos = pos,
- x = [NodeType.FiltervType],
- last_progid = tokens[pos].last_progid;
- x = x.concat(this.getSC());
- while (pos < last_progid) {
- x.push(this.checkProgid(pos) ? this.getProgid() : this.getEscapedString());
- }
- if (this.checkSC(pos)) x = x.concat(this.getSC());
- if (pos < tokensLength && this.checkImportant(pos)) x.push(this.getImportant());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- less.checkIdent = function(i) {
- var start = i,
- wasIdent,
- l;
- if (i >= tokensLength) return 0;
- if (tokens[i].type === TokenType.LowLine) return this.checkIdentLowLine(i);
- if (tokens[i].type === TokenType.HyphenMinus ||
- tokens[i].type === TokenType.Identifier ||
- tokens[i].type === TokenType.DollarSign ||
- tokens[i].type === TokenType.Asterisk) i++;
- else return 0;
- wasIdent = tokens[i - 1].type === TokenType.Identifier;
- for (; i < tokensLength; i++) {
- if (l = this.checkInterpolatedVariable(i)) i += l;
- if (i >= tokensLength) break;
- if (tokens[i].type !== TokenType.HyphenMinus &&
- tokens[i].type !== TokenType.LowLine) {
- if (tokens[i].type !== TokenType.Identifier &&
- (tokens[i].type !== TokenType.DecimalNumber || !wasIdent)) break;
- else wasIdent = true;
- }
- }
- if (!wasIdent && tokens[start].type !== TokenType.Asterisk) return 0;
- tokens[start].ident_last = i - 1;
- return i - start;
- };
- less.checkInclude = function(i) {
- var l;
- if (i >= tokensLength) return 0;
- if (l = this.checkInclude1(i)) tokens[i].include_type = 1;
- else if (l = this.checkInclude2(i)) tokens[i].include_type = 2;
- return l;
- };
- less.getInclude = function() {
- switch (tokens[pos].include_type) {
- case 1: return this.getInclude1();
- case 2: return this.getInclude2();
- }
- };
- less.checkInclude1 = function(i) {
- var start = i,
- l;
- if (l = this.checkClass(i) || this.checkShash(i)) i += l;
- else return 0;
- while (i < tokensLength) {
- if (l = this.checkClass(i) || this.checkShash(i) || this.checkSC(i)) i += l;
- else if (tokens[i].type == TokenType.GreaterThanSign) i++;
- else break;
- }
- if (l = this.checkArguments(i)) i += l;
- else return 0;
- if (i < tokensLength && (l = this.checkSC(i))) i += l;
- if (i < tokensLength && (l = this.checkImportant(i))) i += l;
- return i - start;
- };
- less.getInclude1 = function() {
- var startPos = pos,
- x = [NodeType.IncludeType];
- x.push(this.checkClass(pos) ? this.getClass() : this.getShash());
- while (pos < tokensLength) {
- if (this.checkClass(pos)) x.push(this.getClass());
- else if (this.checkShash(pos)) x.push(this.getShash());
- else if (this.checkSC(pos)) x = x.concat(this.getSC());
- else if (this.checkOperator(pos)) x.push(this.getOperator());
- else break;
- }
- x.push(this.getArguments());
- x = x.concat(this.getSC());
- if (this.checkImportant(pos)) x.push(this.getImportant());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.checkInclude2 = function(i) {
- var start = i,
- l;
- if (l = this.checkClass(i) || this.checkShash(i)) i += l;
- else return 0;
- while (i < tokensLength) {
- if (l = this.checkClass(i) || this.checkShash(i) || this.checkSC(i)) i += l;
- else if (tokens[i].type == TokenType.GreaterThanSign) i++;
- else break;
- }
- return i - start;
- };
- less.getInclude2 = function() {
- var startPos = pos,
- x = [NodeType.IncludeType];
- x.push(this.checkClass(pos) ? this.getClass() : this.getShash());
- while (pos < tokensLength) {
- if (this.checkClass(pos)) x.push(this.getClass());
- else if (this.checkShash(pos)) x.push(this.getShash());
- else if (this.checkSC(pos)) x = x.concat(this.getSC());
- else if (this.checkOperator(pos)) x.push(this.getOperator());
- else break;
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.checkIncludeSelector = function(i) {
- var start = i,
- l;
- while (i < tokensLength) {
- if (l = this.checkSimpleSelector2(i)) i += l;
- else break;
- }
- return i - start;
- };
- less.getIncludeSelector = function() {
- var startPos = pos,
- x = [NodeType.SimpleselectorType],
- t;
- while (pos < tokensLength && this.checkSimpleSelector2(pos)) {
- t = this.getSimpleSelector2();
- if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t);
- else x = x.concat(t);
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.checkInterpolatedVariable = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (tokens[i].type !== TokenType.CommercialAt ||
- !tokens[i + 1] || tokens[i + 1].type !== TokenType.LeftCurlyBracket) return 0;
- i += 2;
- if (l = this.checkIdent(i)) i += l;
- else return 0;
- return tokens[i].type === TokenType.RightCurlyBracket ? i - start + 1 : 0;
- };
- less.getInterpolatedVariable = function() {
- var startPos = pos,
- x = [NodeType.InterpolatedVariableType];
- pos += 2;
- x.push(this.getIdent());
- pos++;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.checkMixin = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkClass(i) || this.checkShash(i)) i +=l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkArguments(i)) i += l;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkBlock(i)) i += l;
- else return 0;
- return i - start;
- };
- less.getMixin = function() {
- var startPos = pos,
- x = [NodeType.MixinType];
- x.push(this.checkClass(pos) ? this.getClass() : this.getShash());
- x = x.concat(this.getSC());
- if (this.checkArguments(pos)) x.push(this.getArguments());
- x = x.concat(this.getSC());
- if (this.checkBlock(pos)) x.push(this.getBlock());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.checkOperator = function(i) {
- if (i >= tokensLength) return 0;
- switch(tokens[i].type) {
- case TokenType.Solidus:
- case TokenType.Comma:
- case TokenType.Colon:
- case TokenType.EqualsSign:
- case TokenType.LessThanSign:
- case TokenType.GreaterThanSign:
- case TokenType.Asterisk:
- return 1;
- }
- return 0;
- };
- less.checkParentSelector = function(i) {
- return i < tokensLength && tokens[i].type === TokenType.Ampersand ? 1 : 0;
- };
- less.getParentSelector = function() {
- var startPos = pos,
- x = [NodeType.ParentSelectorType, '&'];
- pos++;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.checkProperty = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkVariable(i) || this.checkIdent(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- };
- less.getProperty = function() {
- var startPos = pos,
- x = [NodeType.PropertyType];
- if (this.checkVariable(pos)) x.push(this.getVariable());
- else x.push(this.getIdent());
- x = x.concat(this.getSC());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.checkPseudoe = function(i) {
- var l;
- if (i >= tokensLength || tokens[i++].type !== TokenType.Colon ||
- i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0;
- return (l = this.checkInterpolatedVariable(i) || this.checkIdent(i)) ? l + 2 : 0;
- };
- less.getPseudoe = function() {
- var startPos = pos,
- x = [NodeType.PseudoeType];
- pos += 2;
- x.push(this.checkInterpolatedVariable(pos) ? this.getInterpolatedVariable() : this.getIdent());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.checkPseudoc = function(i) {
- var l;
- if (i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0;
- return (l = this.checkInterpolatedVariable(i) || this.checkFunction(i) || this.checkIdent(i)) ? l + 1 : 0;
- };
- less.getPseudoc = function() {
- var startPos = pos,
- x = [NodeType.PseudocType];
- pos ++;
- if (this.checkInterpolatedVariable(pos)) x.push(this.getInterpolatedVariable());
- else if (this.checkFunction(pos)) x.push(this.getFunction());
- else x.push(this.getIdent());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.checkSC = function(i) {
- if (i >= tokensLength) return 0;
- var l,
- lsc = 0,
- ln = tokens[i].ln;
- while (i < tokensLength) {
- if (!(l = this.checkS(i)) &&
- !(l = this.checkCommentML(i)) &&
- !(l = this.checkCommentSL(i))) break;
- i += l;
- lsc += l;
- }
- return lsc || 0;
- };
- less.getSC = function() {
- var sc = [],
- ln;
- if (pos >= tokensLength) return sc;
- ln = tokens[pos].ln;
- while (pos < tokensLength) {
- if (this.checkS(pos)) sc.push(this.getS());
- else if (this.checkCommentML(pos)) sc.push(this.getCommentML());
- else if (this.checkCommentSL(pos)) sc.push(this.getCommentSL());
- else break;
- }
- return sc;
- };
- less.checkSimpleSelector1 = function(i) {
- return this.checkParentSelector(i) ||
- this.checkNthselector(i) ||
- this.checkCombinator(i) ||
- this.checkAttrib(i) ||
- this.checkPseudo(i) ||
- this.checkShash(i) ||
- this.checkAny(i) ||
- this.checkSC(i) ||
- this.checkNamespace(i);
- };
- less.getSimpleSelector1 = function() {
- if (this.checkParentSelector(pos)) return this.getParentSelector();
- else if (this.checkNthselector(pos)) return this.getNthselector();
- else if (this.checkCombinator(pos)) return this.getCombinator();
- else if (this.checkAttrib(pos)) return this.getAttrib();
- else if (this.checkPseudo(pos)) return this.getPseudo();
- else if (this.checkShash(pos)) return this.getShash();
- else if (this.checkAny(pos)) return this.getAny();
- else if (this.checkSC(pos)) return this.getSC();
- else if (this.checkNamespace(pos)) return this.getNamespace();
- };
- less.checkSimpleSelector2 = function(i) {
- return this.checkParentSelector(i) ||
- this.checkNthselector(i) ||
- this.checkAttrib(i) ||
- this.checkPseudo(i) ||
- this.checkShash(i) ||
- this.checkIdent(i) ||
- this.checkClass(i);
- };
- less.getSimpleSelector2 = function() {
- if (this.checkParentSelector(pos)) return this.getParentSelector();
- else if (this.checkNthselector(pos)) return this.getNthselector();
- else if (this.checkAttrib(pos)) return this.getAttrib();
- else if (this.checkPseudo(pos)) return this.getPseudo();
- else if (this.checkShash(pos)) return this.getShash();
- else if (this.checkIdent(pos)) return this.getIdent();
- else if (this.checkClass(pos)) return this.getClass();
- };
- less.checkStylesheet = function(i) {
- var start = i,
- l;
- while (i < tokensLength) {
- if (l = this.checkSC(i) ||
- this.checkDeclaration(i) ||
- this.checkDeclDelim(i) ||
- this.checkInclude(i) ||
- this.checkMixin(i) ||
- this.checkAtrule(i) ||
- this.checkRuleset(i)) i += l;
- else throwError(i);
- }
- return i - start;
- };
- less.getStylesheet = function() {
- var startPos = pos,
- x = [NodeType.StylesheetType];
- while (pos < tokensLength) {
- if (this.checkSC(pos)) x = x.concat(this.getSC());
- else if (this.checkRuleset(pos)) x.push(this.getRuleset());
- else if (this.checkInclude(pos)) x.push(this.getInclude());
- else if (this.checkMixin(pos)) x.push(this.getMixin());
- else if (this.checkAtrule(pos)) x.push(this.getAtrule());
- else if (this.checkDeclaration(pos)) x.push(this.getDeclaration());
- else if (this.checkDeclDelim(pos)) x.push(this.getDeclDelim());
- else throwError();
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.checkValue = function(i) {
- var start = i,
- l;
- while (i < tokensLength) {
- if (l = this._checkValue(i)) i += l;
- if (!l || this.checkBlock(i - l)) break;
- }
- return i - start;
- };
- less._checkValue = function(i) {
- return this.checkSC(i) ||
- this.checkEscapedString(i) ||
- this.checkInterpolatedVariable(i) ||
- this.checkVariable(i) ||
- this.checkVhash(i) ||
- this.checkBlock(i) ||
- this.checkAny(i) ||
- this.checkAtkeyword(i) ||
- this.checkOperator(i) ||
- this.checkImportant(i);
- };
- less.getValue = function() {
- var startPos = pos,
- x = [NodeType.ValueType],
- t, _pos;
- while (pos < tokensLength) {
- _pos = pos;
- if (!this._checkValue(pos)) break;
- t = this._getValue();
- if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t);
- else x = x.concat(t);
- if (this.checkBlock(_pos)) break;
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less._getValue = function() {
- if (this.checkSC(pos)) return this.getSC();
- else if (this.checkEscapedString(pos)) return this.getEscapedString();
- else if (this.checkInterpolatedVariable(pos)) return this.getInterpolatedVariable();
- else if (this.checkVariable(pos)) return this.getVariable();
- else if (this.checkVhash(pos)) return this.getVhash();
- else if (this.checkBlock(pos)) return this.getBlock();
- else if (this.checkAny(pos)) return this.getAny();
- else if (this.checkAtkeyword(pos)) return this.getAtkeyword();
- else if (this.checkOperator(pos)) return this.getOperator();
- else if (this.checkImportant(pos)) return this.getImportant();
- };
- less.checkVariable = function(i) {
- var l;
- if (i >= tokensLength || tokens[i].type !== TokenType.CommercialAt) return 0;
- if (tokens[i - 1] &&
- tokens[i - 1].type === TokenType.CommercialAt &&
- tokens[i - 2] &&
- tokens[i - 2].type === TokenType.CommercialAt) return 0;
- return (l = this.checkVariable(i + 1) || this.checkIdent(i + 1)) ? l + 1 : 0;
- };
- less.getVariable = function() {
- var startPos = pos,
- x = [NodeType.VariableType];
- pos++;
- if (this.checkVariable(pos)) x.push(this.getVariable());
- else x.push(this.getIdent());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.checkVariablesList = function(i) {
- var d = 0,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkVariable(i)) i+= l;
- else return 0;
- while (tokens[i] && tokens[i].type === TokenType.FullStop) {
- d++;
- i++;
- }
- return d === 3 ? l + d : 0;
- };
- less.getVariablesList = function() {
- var startPos = pos,
- x = [NodeType.VariablesListType, this.getVariable()];
- pos += 3;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.markSC = function() {
- var ws = -1,
- sc = -1,
- t;
- for (var i = 0; i < tokensLength; i++) {
- t = tokens[i];
- switch (t.type) {
- case TokenType.Space:
- case TokenType.Tab:
- case TokenType.Newline:
- t.ws = true;
- t.sc = true;
- if (ws === -1) ws = i;
- if (sc === -1) sc = i;
- break;
- case TokenType.CommentML:
- case TokenType.CommentSL:
- if (ws !== -1) {
- tokens[ws].ws_last = i - 1;
- ws = -1;
- }
- t.sc = true;
- break;
- default:
- if (ws !== -1) {
- tokens[ws].ws_last = i - 1;
- ws = -1;
- }
- if (sc !== -1) {
- tokens[sc].sc_last = i - 1;
- sc = -1;
- }
- }
- }
- if (ws !== -1) tokens[ws].ws_last = i - 1;
- if (sc !== -1) tokens[sc].sc_last = i - 1;
- };
- syntaxes.less = less;
-})();
- return function(options) {
- var css, rule, syntax;
- if (!options) throw new Error('Please, pass a string to parse');
- css = typeof options === 'string'? options : options.css;
- if (!css) throw new Error('String can not be empty');
- rule = options.rule || 'stylesheet';
- needInfo = options.needInfo || false;
- syntax = options.syntax || 'css';
- if (!syntaxes[syntax]) throw new Error('Syntax "' + _syntax +
- '" is not currently supported, sorry');
- s = syntaxes[syntax];
- getTokens(css, syntax);
- tokensLength = tokens.length;
- pos = 0;
- s.markBrackets();
- s.markSC();
- s.markBlocks && s.markBlocks();
- return rules[rule]();
- }
-}());
-exports.cssToAST = cssToAST;
diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/gonzales.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/gonzales.js
deleted file mode 100644
index 3802a0a..0000000
--- a/node_modules/csscomb/node_modules/gonzales-pe/lib/gonzales.js
+++ /dev/null
@@ -1,5 +0,0 @@
-module.exports = {
- astToSrc: require('./ast-to-src'),
- astToString: require('./ast-to-string'),
- srcToAST: require('./src-to-ast')
-};
diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/js/mark.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/js/mark.js
deleted file mode 100644
index 426b97e..0000000
--- a/node_modules/csscomb/node_modules/gonzales-pe/lib/js/mark.js
+++ /dev/null
@@ -1,117 +0,0 @@
-var TokenType = require('../token-types');
-
-module.exports = (function() {
- /**
- * Mark whitespaces and comments
- */
- function markSC(tokens) {
- var tokensLength = tokens.length;
- var ws = -1, // flag for whitespaces
- sc = -1, // flag for whitespaces and comments
- t; // current token
-
- // For every token in the token list, mark spaces and line breaks
- // as spaces (set both `ws` and `sc` flags). Mark multiline comments
- // with `sc` flag.
- // If there are several spaces or tabs or line breaks or multiline
- // comments in a row, group them: take the last one's index number
- // and save it to the first token in the group as a reference
- // (e.g., `ws_last = 7` for a group of whitespaces or `sc_last = 9`
- // for a group of whitespaces and comments):
- for (var i = 0; i < tokensLength; i++) {
- t = tokens[i];
- switch (t.type) {
- case TokenType.Space:
- case TokenType.Tab:
- case TokenType.Newline:
- t.ws = true;
- t.sc = true;
-
- if (ws === -1) ws = i;
- if (sc === -1) sc = i;
-
- break;
- case TokenType.CommentML:
- if (ws !== -1) {
- tokens[ws].ws_last = i - 1;
- ws = -1;
- }
-
- t.sc = true;
-
- break;
- default:
- if (ws !== -1) {
- tokens[ws].ws_last = i - 1;
- ws = -1;
- }
-
- if (sc !== -1) {
- tokens[sc].sc_last = i - 1;
- sc = -1;
- }
- }
- }
-
- if (ws !== -1) tokens[ws].ws_last = i - 1;
- if (sc !== -1) tokens[sc].sc_last = i - 1;
- }
-
- /**
- * Pair brackets
- */
- function markBrackets(tokens) {
- var tokensLength = tokens.length;
- var ps = [], // parenthesis
- sbs = [], // square brackets
- cbs = [], // curly brackets
- t; // current token
-
- // For every token in the token list, if we meet an opening (left)
- // bracket, push its index number to a corresponding array.
- // If we then meet a closing (right) bracket, look at the corresponding
- // array. If there are any elements (records about previously met
- // left brackets), take a token of the last left bracket (take
- // the last index number from the array and find a token with
- // this index number) and save right bracket's index as a reference:
- for (var i = 0; i < tokens.length; i++) {
- t = tokens[i];
- switch(t.type) {
- case TokenType.LeftParenthesis:
- ps.push(i);
- break;
- case TokenType.RightParenthesis:
- if (ps.length) {
- t.left = ps.pop();
- tokens[t.left].right = i;
- }
- break;
- case TokenType.LeftSquareBracket:
- sbs.push(i);
- break;
- case TokenType.RightSquareBracket:
- if (sbs.length) {
- t.left = sbs.pop();
- tokens[t.left].right = i;
- }
- break;
- case TokenType.LeftCurlyBracket:
- cbs.push(i);
- break;
- case TokenType.RightCurlyBracket:
- if (cbs.length) {
- t.left = cbs.pop();
- tokens[t.left].right = i;
- }
- break;
- }
- }
- }
-
- return function(tokens) {
- // Mark paired brackets:
- markBrackets(tokens);
- // Mark whitespaces and comments:
- markSC(tokens);
- }
-})();
diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/js/node-types.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/js/node-types.js
deleted file mode 100644
index c0e46eb..0000000
--- a/node_modules/csscomb/node_modules/gonzales-pe/lib/js/node-types.js
+++ /dev/null
@@ -1,8 +0,0 @@
-module.exports = {
- FUNCTION_BODY: 'functionBody',
- FUNCTION_DECLARATION: 'functionDeclaration',
- PARAMS: 'params',
- PROGRAM: 'program',
- SPACE: 'space',
- TEXT: 'text'
-};
diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/js/rules.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/js/rules.js
deleted file mode 100644
index 36464d1..0000000
--- a/node_modules/csscomb/node_modules/gonzales-pe/lib/js/rules.js
+++ /dev/null
@@ -1,281 +0,0 @@
-var TokenType = require('../token-types');
-var NodeType = require('./node-types');
-
-module.exports = (function() {
- var tokens, tokensLength, pos;
-
- var rules = {
- 'functionBody': function() { return checkFunctionBody(pos) && getFunctionBody(); },
- 'functionDeclaration': function() { return checkFunctionDeclaration(pos) && getFunctionDeclaration(); },
- 'papams': function() { return checkParams(pos) && getParams(); },
- 'program': function() { return checkProgram(pos) && getProgram(); },
- 'space': function() { return checkSpace(pos) && getSpace(); },
- 'text': function() { return checkText(pos) && getText(); }
- };
-
- /**
- * Stop parsing and display error
- * @param {Number=} i Token's index number
- */
- function throwError(i) {
- var ln = i ? tokens[i].ln : tokens[pos].ln;
-
- throw {line: ln, syntax: 'js'};
- }
-
- /**
- * @param {Object} exclude
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkExcluding(exclude, i) {
- var start = i;
-
- while(i < tokensLength) {
- if (exclude[tokens[i++].type]) break;
- }
-
- return i - start - 2;
- }
-
- /**
- * @param {Number} start
- * @param {Number} finish
- * @returns {String}
- */
- function joinValues(start, finish) {
- var s = '';
-
- for (var i = start; i < finish + 1; i++) {
- s += tokens[i].value;
- }
-
- return s;
- }
-
- /**
- * @param {Number} start
- * @param {Number} num
- * @returns {String}
- */
- function joinValues2(start, num) {
- if (start + num - 1 >= tokensLength) return;
-
- var s = '';
-
- for (var i = 0; i < num; i++) {
- s += tokens[start + i].value;
- }
-
- return s;
- }
-
-
-/////////////////////////////////////
-/////////////////////////////////////
-/////////////////////////////////////
-
- function checkFunctionBody(i) {
- var start = i;
-
- if (i >= tokensLength) return 0;
-
- if (tokens[i].type === TokenType.LeftCurlyBracket) i = tokens[i].right + 1;
- else return 0;
-
- return i - start;
- }
-
- function getFunctionBody() {
- var startPos = pos,
- x = [NodeType.FUNCTION_BODY];
-
- // Skip `{`:
- pos++;
-
- x.push(joinValues(pos, tokens[pos].right - 1));
-
- // Skip `}`:
- pos++;
-
- return x;
- }
-
- /**
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkFunctionDeclaration(i) {
- var start = i,
- l;
-
- if (i >= tokensLength) return 0;
-
- if (tokens[i].value === 'function') i++;
- else return 0;
-
- if (l = checkSpace(i)) i += l;
- else return 0;
-
- if (tokens[i].type === TokenType.Identifier) i++;
- else return 0;
-
- if (l = checkSpace(i)) i += l;
-
- if (l = checkParams(i)) i += l;
- else return 0;
-
- if (l = checkSpace(i)) i += l;
-
- if (l = checkFunctionBody(i)) i += l;
- else return 0;
-
- return i - start;
- }
-
- /**
- * @returns {Array}
- */
- function getFunctionDeclaration() {
- var startPos = pos,
- x = [NodeType.FUNCTION_DECLARATION];
-
- // Skip `function` word:
- pos++;
-
- x.push(getSpace());
-
- // TODO: `getIdent`:
- x.push(['ident', tokens[pos].value]);
- pos++;
-
- if (checkSpace(pos)) x.push(getSpace());
-
- x.push(getParams());
-
- if (checkSpace(pos)) x.push(getSpace());
-
- x.push(getFunctionBody());
-
- return x;
- }
-
- function checkParams(i) {
- var start = i;
-
- if (tokens[i].type === TokenType.LeftParenthesis) i = tokens[i].right + 1;
- else return 0;
-
- return i - start;
- }
-
- function getParams() {
- var startPos = pos,
- x = [NodeType.PARAMS];
-
- // Skip `(`:
- pos++;
-
- x.push(joinValues(pos, tokens[pos].right - 1));
-
- // Skip `)`:
- pos++;
-
- return x;
- }
-
- /**
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkProgram(i) {
- var start = i,
- l;
-
- while (i < tokensLength) {
- if (l = checkFunctionDeclaration(i) || checkText(i)) i += l;
- else break;
- }
-
- return i - start;
- }
-
- /**
- * @returns {Array}
- */
- function getProgram() {
- var startPos = pos,
- x = [NodeType.PROGRAM];
-
- while (pos < tokensLength) {
- if (checkFunctionDeclaration(pos)) x.push(getFunctionDeclaration());
- else if (checkText(pos)) x.push(getText());
- else throwError();
- }
-
- return x;
- }
-
- /**
- * Check if token is marked as a space (if it's a space or a tab
- * or a line break).
- * @param i
- * @returns {Number} Number of spaces in a row starting with the given token.
- */
- function checkSpace(i) {
- return i < tokensLength && tokens[i].ws ?
- tokens[i].ws_last - i + 1 :
- 0;
- }
-
- /**
- * Get node with spaces
- * @returns {Array} `['s', x]` where `x` is a string containing spaces
- */
- function getSpace() {
- var startPos = pos,
- x = [NodeType.SPACE, joinValues(pos, tokens[pos].ws_last)];
-
- pos = tokens[pos].ws_last + 1;
-
- return x;
- }
-
-
- /**
- * @param {Number} i Token's index number
- * @returns {Number}
- */
- function checkText(i) {
- var start = i,
- l;
-
- if (i >= tokensLength) return 0;
-
- while (i < tokensLength && !checkFunctionDeclaration(i)) i++;
-
- return i - start;
- }
-
- /**
- * @returns {Array}
- */
- function getText() {
- var startPos = pos,
- x = [NodeType.TEXT];
-
- while (pos < tokensLength && !checkFunctionDeclaration(pos)) pos++;
-
- x.push(joinValues(startPos, pos - 1));
-
- return x;
- }
-
- return function(_tokens, rule) {
- tokens = _tokens;
- tokensLength = tokens.length;
- pos = 0;
-
- return rules[rule]();
- };
-})();
diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/js/stringify.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/js/stringify.js
deleted file mode 100644
index 0ed02c2..0000000
--- a/node_modules/csscomb/node_modules/gonzales-pe/lib/js/stringify.js
+++ /dev/null
@@ -1,48 +0,0 @@
-module.exports = function stringify(tree) {
- // TODO: Better error message
- if (!tree) throw new Error('We need tree to translate');
-
- var _m_simple = {
- 'ident': 1,
- 'space': 1,
- 'text': 1
- },
- _m_composite = {
- 'program': 1,
- },
- _m_primitive = {
- };
-
- function _t(tree) {
- var t = tree[0];
- if (t in _m_primitive) return _m_primitive[t];
- else if (t in _m_simple) return _simple(tree);
- else if (t in _m_composite) return _composite(tree);
- return _unique[t](tree);
- }
-
- function _composite(t, i) {
- var s = '';
- i = i === undefined ? 1 : i;
- for (; i < t.length; i++) s += typeof t[i] === 'string' ? t[i] : _t(t[i]);
- return s;
- }
-
- function _simple(t) {
- return t[1];
- }
-
- var _unique = {
- 'functionBody': function(t) {
- return '{' + t[1] + '}';
- },
- 'functionDeclaration': function(t) {
- return 'function' + _composite(t);
- },
- 'params': function(t) {
- return '(' + t[1] + ')';
- }
- };
-
- return _t(tree);
-};
diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/js/tokenizer.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/js/tokenizer.js
deleted file mode 100644
index f580f8b..0000000
--- a/node_modules/csscomb/node_modules/gonzales-pe/lib/js/tokenizer.js
+++ /dev/null
@@ -1,249 +0,0 @@
-module.exports = function(js) {
- var TokenType = require('../token-types');
-
- var tokens = [],
- urlMode = false,
- blockMode = 0,
- c, // current character
- cn, // next character
- pos = 0,
- tn = 0,
- ln = 1;
-
- var Punctuation = {
- ' ': TokenType.Space,
- '\n': TokenType.Newline,
- '\r': TokenType.Newline,
- '\t': TokenType.Tab,
- '!': TokenType.ExclamationMark,
- '"': TokenType.QuotationMark,
- '#': TokenType.NumberSign,
- '$': TokenType.DollarSign,
- '%': TokenType.PercentSign,
- '&': TokenType.Ampersand,
- '\'': TokenType.Apostrophe,
- '(': TokenType.LeftParenthesis,
- ')': TokenType.RightParenthesis,
- '*': TokenType.Asterisk,
- '+': TokenType.PlusSign,
- ',': TokenType.Comma,
- '-': TokenType.HyphenMinus,
- '.': TokenType.FullStop,
- '/': TokenType.Solidus,
- ':': TokenType.Colon,
- ';': TokenType.Semicolon,
- '<': TokenType.LessThanSign,
- '=': TokenType.EqualsSign,
- '>': TokenType.GreaterThanSign,
- '?': TokenType.QuestionMark,
- '@': TokenType.CommercialAt,
- '[': TokenType.LeftSquareBracket,
- ']': TokenType.RightSquareBracket,
- '^': TokenType.CircumflexAccent,
- '_': TokenType.LowLine,
- '{': TokenType.LeftCurlyBracket,
- '|': TokenType.VerticalLine,
- '}': TokenType.RightCurlyBracket,
- '~': TokenType.Tilde
- };
-
- /**
- * Add a token to the token list
- * @param {string} type
- * @param {string} value
- */
- function pushToken(type, value) {
- tokens.push({ tn: tn++, ln: ln, type: type, value: value });
- }
-
- /**
- * Check if a character is a decimal digit
- * @param {string} c Character
- * @returns {boolean}
- */
- function isDecimalDigit(c) {
- return '0123456789'.indexOf(c) >= 0;
- }
-
- /**
- * Parse spaces
- * @param {string} js Unparsed part of js string
- */
- function parseSpaces(js) {
- var start = pos;
-
- // Read the string until we meet a non-space character:
- for (; pos < js.length; pos++) {
- if (js.charAt(pos) !== ' ') break;
- }
-
- // Add a substring containing only spaces to tokens:
- pushToken(TokenType.Space, js.substring(start, pos));
- pos--;
- }
-
- /**
- * Parse a string within quotes
- * @param {string} js Unparsed part of js string
- * @param {string} q Quote (either `'` or `"`)
- */
- function parseString(js, q) {
- var start = pos;
-
- // Read the string until we meet a matching quote:
- for (pos = pos + 1; pos < js.length; pos++) {
- // Skip escaped quotes:
- if (js.charAt(pos) === '\\') pos++;
- else if (js.charAt(pos) === q) break;
- }
-
- // Add the string (including quotes) to tokens:
- pushToken(q === '"' ? TokenType.StringDQ : TokenType.StringSQ, js.substring(start, pos + 1));
- }
-
- /**
- * Parse numbers
- * @param {string} js Unparsed part of js string
- */
- function parseDecimalNumber(js) {
- var start = pos;
-
- // Read the string until we meet a character that's not a digit:
- for (; pos < js.length; pos++) {
- if (!isDecimalDigit(js.charAt(pos))) break;
- }
-
- // Add the number to tokens:
- pushToken(TokenType.DecimalNumber, js.substring(start, pos));
- pos--;
- }
-
- /**
- * Parse identifier
- * @param {string} js Unparsed part of js string
- */
- function parseIdentifier(js) {
- var start = pos;
-
- // Skip all opening slashes:
- while (js.charAt(pos) === '/') pos++;
-
- // Read the string until we meet a punctuation mark:
- for (; pos < js.length; pos++) {
- // Skip all '\':
- if (js.charAt(pos) === '\\') pos++;
- else if (js.charAt(pos) in Punctuation) break;
- }
-
- var ident = js.substring(start, pos);
-
- // Enter url mode if parsed substring is `url`:
- urlMode = urlMode || ident === 'url';
-
- // Add identifier to tokens:
- pushToken(TokenType.Identifier, ident);
- pos--;
- }
-
- /**
- * Parse a multiline comment
- * @param {string} js Unparsed part of js string
- */
- function parseMLComment(js) {
- var start = pos;
-
- // Read the string until we meet `*/`.
- // Since we already know first 2 characters (`/*`), start reading
- // from `pos + 2`:
- for (pos = pos + 2; pos < js.length; pos++) {
- if (js.charAt(pos) === '*' && js.charAt(pos + 1) === '/') {
- pos++;
- break;
- }
- }
-
- // Add full comment (including `/*` and `*/`) to the list of tokens:
- pushToken(TokenType.CommentML, js.substring(start, pos + 1));
- }
-
- function parseSLComment(js) {
- var start = pos;
-
- // Read the string until we meet line break.
- // Since we already know first 2 characters (`//`), start reading
- // from `pos + 2`:
- for (pos = pos + 2; pos < js.length; pos++) {
- if (js.charAt(pos) === '\n' || js.charAt(pos) === '\r') {
- break;
- }
- }
-
- // Add comment (including `//` and line break) to the list of tokens:
- pushToken(TokenType.CommentSL, js.substring(start, pos));
- pos--;
- }
-
- /**
- * Convert a js string to a list of tokens
- * @param {string} js js string
- * @returns {Array} List of tokens
- * @private
- */
- function getTokens(js) {
- // Parse string, character by character:
- for (pos = 0; pos < js.length; pos++) {
- c = js.charAt(pos);
- cn = js.charAt(pos + 1);
-
- // If we meet `/*`, it's a start of a multiline comment.
- // Parse following characters as a multiline comment:
- if (c === '/' && cn === '*') {
- parseMLComment(js);
- }
-
- // If we meet `//` and it is not a part of url:
- else if (!urlMode && c === '/' && cn === '/') {
- // If we're currently inside a block, treat `//` as a start
- // of identifier. Else treat `//` as a start of a single-line
- // comment:
- if (blockMode > 0) parseIdentifier(js);
- else parseSLComment(js);
- }
-
- // If current character is a double or single quote, it's a start
- // of a string:
- else if (c === '"' || c === "'") {
- parseString(js, c);
- }
-
- // If current character is a space:
- else if (c === ' ') {
- parseSpaces(js)
- }
-
- // If current character is a punctuation mark:
- else if (c in Punctuation) {
- // Add it to the list of tokens:
- pushToken(Punctuation[c], c);
- if (c === '\n' || c === '\r') ln++; // Go to next line
- if (c === ')') urlMode = false; // exit url mode
- if (c === '{') blockMode++; // enter a block
- if (c === '}') blockMode--; // exit a block
- }
-
- // If current character is a decimal digit:
- else if (isDecimalDigit(c)) {
- parseDecimalNumber(js);
- }
-
- // If current character is anything else:
- else {
- parseIdentifier(js);
- }
- }
-
- return tokens;
- }
-
- return getTokens(js);
-};
diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/less/node-types.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/less/node-types.js
deleted file mode 100644
index 5667642..0000000
--- a/node_modules/csscomb/node_modules/gonzales-pe/lib/less/node-types.js
+++ /dev/null
@@ -1,58 +0,0 @@
-module.exports = {
- ArgumentsType: 'arguments',
- AtkeywordType: 'atkeyword',
- AtrulebType: 'atruleb',
- AtrulerType: 'atruler',
- AtrulerqType: 'atrulerq',
- AtrulersType: 'atrulers',
- AtrulesType: 'atrules',
- AttribType: 'attrib',
- AttrselectorType: 'attrselector',
- BlockType: 'block',
- BracesType: 'braces',
- ClassType: 'class',
- CombinatorType: 'combinator',
- CommentMLType: 'commentML',
- CommentSLType: 'commentSL',
- ConditionType: 'condition',
- DeclarationType: 'declaration',
- DeclDelimType: 'declDelim',
- DelimType: 'delim',
- DimensionType: 'dimension',
- EscapedStringType: 'escapedString',
- FilterType: 'filter',
- FiltervType: 'filterv',
- FunctionType: 'function',
- FunctionExpressionType: 'functionExpression',
- IdentType: 'ident',
- ImportantType: 'important',
- IncludeType :'include',
- InterpolatedVariableType: 'interpolatedVariable',
- MixinType: 'mixin',
- NamespaceType: 'namespace',
- NthType: 'nth',
- NthselectorType: 'nthselector',
- NumberType: 'number',
- OperatorType: 'operator',
- ParentSelectorType: 'parentselector',
- PercentageType: 'percentage',
- ProgidType: 'progid',
- PropertyType: 'property',
- PropertyDelimType: 'propertyDelim',
- PseudocType: 'pseudoc',
- PseudoeType: 'pseudoe',
- RawType: 'raw',
- RulesetType: 'ruleset',
- SType: 's',
- SelectorType: 'selector',
- ShashType: 'shash',
- SimpleselectorType: 'simpleselector',
- StringType: 'string',
- StylesheetType: 'stylesheet',
- UnaryType: 'unary',
- UriType: 'uri',
- ValueType: 'value',
- VariableType: 'variable',
- VariablesListType: 'variableslist',
- VhashType: 'vhash'
-};
diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/less/stringify.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/less/stringify.js
deleted file mode 100644
index 0e6868a..0000000
--- a/node_modules/csscomb/node_modules/gonzales-pe/lib/less/stringify.js
+++ /dev/null
@@ -1,113 +0,0 @@
-module.exports = function stringify(tree) {
- // TODO: Better error message
- if (!tree) throw new Error('We need tree to translate');
-
- var _m_simple = {
- 'attrselector': 1, 'combinator': 1, 'nth': 1, 'number': 1,
- 'operator': 1, 'raw': 1, 's': 1, 'string': 1, 'unary': 1
- },
- _m_composite = {
- 'atruleb': 1, 'atrulerq': 1, 'atrulers': 1, 'atrules': 1,'condition': 1,
- 'declaration': 1, 'dimension': 1, 'filterv': 1, 'function': 1,
- 'ident': 1, 'include': 1, 'mixin': 1, 'selector': 1, 'progid': 1,
- 'property': 1, 'ruleset': 1, 'simpleselector': 1, 'stylesheet': 1,
- 'value': 1
- },
- _m_primitive = {
- 'declDelim': ';', 'delim': ',',
- 'namespace': '|', 'parentselector': '&', 'propertyDelim' : ':'
- };
-
- function _t(tree) {
- var t = tree[0];
- if (t in _m_primitive) return _m_primitive[t];
- else if (t in _m_simple) return _simple(tree);
- else if (t in _m_composite) return _composite(tree);
- return _unique[t](tree);
- }
-
- function _composite(t, i) {
- var s = '';
- i = i === undefined ? 1 : i;
- for (; i < t.length; i++) s += typeof t[i] === 'string' ? t[i] : _t(t[i]);
- return s;
- }
-
- function _simple(t) {
- return t[1];
- }
-
- var _unique = {
- 'arguments': function(t) {
- return '(' + _composite(t) + ')';
- },
- 'atkeyword': function(t) {
- return '@' + _t(t[1]);
- },
- 'atruler': function(t) {
- return _t(t[1]) + _t(t[2]) + '{' + _t(t[3]) + '}';
- },
- 'attrib': function(t) {
- return '[' + _composite(t) + ']';
- },
- 'block': function(t) {
- return '{' + _composite(t) + '}';
- },
- 'braces': function(t) {
- return t[1] + _composite(t, 3) + t[2];
- },
- 'class': function(t) {
- return '.' + _t(t[1]);
- },
- 'commentML': function (t) {
- return '/*' + t[1] + '*/';
- },
- 'commentSL': function (t) {
- return '/' + '/' + t[1];
- },
- 'escapedString': function(t) {
- return '~' + t[1];
- },
- 'filter': function(t) {
- return _t(t[1]) + ':' + _t(t[2]);
- },
- 'functionExpression': function(t) {
- return 'expression(' + t[1] + ')';
- },
- 'important': function(t) {
- return '!' + _composite(t) + 'important';
- },
- 'interpolatedVariable': function(t) {
- return '@{' + _t(t[1]) + '}';
- },
- 'nthselector': function(t) {
- return ':' + _simple(t[1]) + '(' + _composite(t, 2) + ')';
- },
- 'percentage': function(t) {
- return _t(t[1]) + '%';
- },
- 'pseudoc': function(t) {
- return ':' + _t(t[1]);
- },
- 'pseudoe': function(t) {
- return '::' + _t(t[1]);
- },
- 'shash': function (t) {
- return '#' + t[1];
- },
- 'uri': function(t) {
- return 'url(' + _composite(t) + ')';
- },
- 'variable': function(t) {
- return '@' + _t(t[1]);
- },
- 'variableslist': function(t) {
- return _t(t[1]) + '...';
- },
- 'vhash': function(t) {
- return '#' + t[1];
- }
- };
-
- return _t(tree);
-}
diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/sass/stringify.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/sass/stringify.js
deleted file mode 100644
index a1d05c5..0000000
--- a/node_modules/csscomb/node_modules/gonzales-pe/lib/sass/stringify.js
+++ /dev/null
@@ -1,117 +0,0 @@
-module.exports = function stringify(tree) {
- // TODO: Better error message
- if (!tree) throw new Error('We need tree to translate');
-
- var _m_simple = {
- 'attrselector': 1, 'combinator': 1, 'nth': 1, 'number': 1,
- 'operator': 1, 'raw': 1, 's': 1, 'string': 1, 'unary': 1
- },
- _m_composite = {
- 'atruleb': 1, 'atrulerq': 1, 'atrulers': 1, 'atrules': 1,'condition': 1,
- 'conditionalStatement': 1,
- 'declaration': 1, 'dimension': 1, 'filterv': 1, 'function': 1,
- 'ident': 1, 'include': 1,
- 'loop': 1, 'mixin': 1, 'selector': 1, 'progid': 1, 'property': 1,
- 'ruleset': 1, 'simpleselector': 1, 'stylesheet': 1, 'value': 1
- },
- _m_primitive = {
- 'declDelim': '\n', 'delim': ',',
- 'namespace': '|', 'parentselector': '&', 'propertyDelim' : ':'
- };
-
- function _t(tree) {
- var t = tree[0];
- if (t in _m_primitive) return _m_primitive[t];
- else if (t in _m_simple) return _simple(tree);
- else if (t in _m_composite) return _composite(tree);
- return _unique[t](tree);
- }
-
- function _composite(t, i) {
- var s = '';
- i = i === undefined ? 1 : i;
- for (; i < t.length; i++) s += typeof t[i] === 'string' ? t[i] : _t(t[i]);
- return s;
- }
-
- function _simple(t) {
- return t[1];
- }
-
- var _unique = {
- 'arguments': function(t) {
- return '(' + _composite(t) + ')';
- },
- 'atkeyword': function(t) {
- return '@' + _t(t[1]);
- },
- 'atruler': function(t) {
- return _t(t[1]) + _t(t[2]) + '{' + _t(t[3]) + '}';
- },
- 'attrib': function(t) {
- return '[' + _composite(t) + ']';
- },
- 'block': function(t) {
- return _composite(t);
- },
- 'braces': function(t) {
- return t[1] + _composite(t, 3) + t[2];
- },
- 'class': function(t) {
- return '.' + _t(t[1]);
- },
- 'commentML': function (t) {
- return '/*' + t[1];
- },
- 'commentSL': function (t) {
- return '/' + '/' + t[1];
- },
- 'default': function(t) {
- return '!' + _composite(t) + 'default';
- },
- 'filter': function(t) {
- return _t(t[1]) + ':' + _t(t[2]);
- },
- 'functionExpression': function(t) {
- return 'expression(' + t[1] + ')';
- },
- 'important': function(t) {
- return '!' + _composite(t) + 'important';
- },
- 'interpolation': function(t) {
- return '#{' + _t(t[1]) + '}';
- },
- 'nthselector': function(t) {
- return ':' + _simple(t[1]) + '(' + _composite(t, 2) + ')';
- },
- 'percentage': function(t) {
- return _t(t[1]) + '%';
- },
- 'placeholder': function(t) {
- return '%' + _t(t[1]);
- },
- 'pseudoc': function(t) {
- return ':' + _t(t[1]);
- },
- 'pseudoe': function(t) {
- return '::' + _t(t[1]);
- },
- 'shash': function (t) {
- return '#' + t[1];
- },
- 'uri': function(t) {
- return 'url(' + _composite(t) + ')';
- },
- 'variable': function(t) {
- return '$' + _t(t[1]);
- },
- 'variableslist': function(t) {
- return _t(t[1]) + '...';
- },
- 'vhash': function(t) {
- return '#' + t[1];
- }
- };
-
- return _t(tree);
-}
diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/scss/node-types.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/scss/node-types.js
deleted file mode 100644
index 3118be2..0000000
--- a/node_modules/csscomb/node_modules/gonzales-pe/lib/scss/node-types.js
+++ /dev/null
@@ -1,61 +0,0 @@
-module.exports = {
- ArgumentsType: 'arguments',
- AtkeywordType: 'atkeyword',
- AtrulebType: 'atruleb',
- AtrulerType: 'atruler',
- AtrulerqType: 'atrulerq',
- AtrulersType: 'atrulers',
- AtrulesType: 'atrules',
- AttribType: 'attrib',
- AttrselectorType: 'attrselector',
- BlockType: 'block',
- BracesType: 'braces',
- ClassType: 'class',
- CombinatorType: 'combinator',
- CommentMLType: 'commentML',
- CommentSLType: 'commentSL',
- ConditionType: 'condition',
- ConditionalStatementType: 'conditionalStatement',
- DeclarationType: 'declaration',
- DeclDelimType: 'declDelim',
- DefaultType: 'default',
- DelimType: 'delim',
- DimensionType: 'dimension',
- FilterType: 'filter',
- FiltervType: 'filterv',
- FunctionType: 'function',
- FunctionExpressionType: 'functionExpression',
- IdentType: 'ident',
- ImportantType: 'important',
- IncludeType :'include',
- InterpolationType: 'interpolation',
- LoopType: 'loop',
- MixinType: 'mixin',
- NamespaceType: 'namespace',
- NthType: 'nth',
- NthselectorType: 'nthselector',
- NumberType: 'number',
- OperatorType: 'operator',
- ParentSelectorType: 'parentselector',
- PercentageType: 'percentage',
- PlaceholderType: 'placeholder',
- ProgidType: 'progid',
- PropertyType: 'property',
- PropertyDelimType: 'propertyDelim',
- PseudocType: 'pseudoc',
- PseudoeType: 'pseudoe',
- RawType: 'raw',
- RulesetType: 'ruleset',
- SType: 's',
- SelectorType: 'selector',
- ShashType: 'shash',
- SimpleselectorType: 'simpleselector',
- StringType: 'string',
- StylesheetType: 'stylesheet',
- UnaryType: 'unary',
- UriType: 'uri',
- ValueType: 'value',
- VariableType: 'variable',
- VariablesListType: 'variableslist',
- VhashType: 'vhash'
-};
diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/scss/stringify.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/scss/stringify.js
deleted file mode 100644
index bed2718..0000000
--- a/node_modules/csscomb/node_modules/gonzales-pe/lib/scss/stringify.js
+++ /dev/null
@@ -1,117 +0,0 @@
-module.exports = function stringify(tree) {
- // TODO: Better error message
- if (!tree) throw new Error('We need tree to translate');
-
- var _m_simple = {
- 'attrselector': 1, 'combinator': 1, 'nth': 1, 'number': 1,
- 'operator': 1, 'raw': 1, 's': 1, 'string': 1, 'unary': 1
- },
- _m_composite = {
- 'atruleb': 1, 'atrulerq': 1, 'atrulers': 1, 'atrules': 1,'condition': 1,
- 'conditionalStatement': 1,
- 'declaration': 1, 'dimension': 1, 'filterv': 1, 'function': 1,
- 'ident': 1, 'include': 1,
- 'loop': 1, 'mixin': 1, 'selector': 1, 'progid': 1, 'property': 1,
- 'ruleset': 1, 'simpleselector': 1, 'stylesheet': 1, 'value': 1
- },
- _m_primitive = {
- 'declDelim': ';', 'delim': ',',
- 'namespace': '|', 'parentselector': '&', 'propertyDelim' : ':'
- };
-
- function _t(tree) {
- var t = tree[0];
- if (t in _m_primitive) return _m_primitive[t];
- else if (t in _m_simple) return _simple(tree);
- else if (t in _m_composite) return _composite(tree);
- return _unique[t](tree);
- }
-
- function _composite(t, i) {
- var s = '';
- i = i === undefined ? 1 : i;
- for (; i < t.length; i++) s += typeof t[i] === 'string' ? t[i] : _t(t[i]);
- return s;
- }
-
- function _simple(t) {
- return t[1];
- }
-
- var _unique = {
- 'arguments': function(t) {
- return '(' + _composite(t) + ')';
- },
- 'atkeyword': function(t) {
- return '@' + _t(t[1]);
- },
- 'atruler': function(t) {
- return _t(t[1]) + _t(t[2]) + '{' + _t(t[3]) + '}';
- },
- 'attrib': function(t) {
- return '[' + _composite(t) + ']';
- },
- 'block': function(t) {
- return '{' + _composite(t) + '}';
- },
- 'braces': function(t) {
- return t[1] + _composite(t, 3) + t[2];
- },
- 'class': function(t) {
- return '.' + _t(t[1]);
- },
- 'commentML': function (t) {
- return '/*' + t[1] + '*/';
- },
- 'commentSL': function (t) {
- return '/' + '/' + t[1];
- },
- 'default': function(t) {
- return '!' + _composite(t) + 'default';
- },
- 'filter': function(t) {
- return _t(t[1]) + ':' + _t(t[2]);
- },
- 'functionExpression': function(t) {
- return 'expression(' + t[1] + ')';
- },
- 'important': function(t) {
- return '!' + _composite(t) + 'important';
- },
- 'interpolation': function(t) {
- return '#{' + _t(t[1]) + '}';
- },
- 'nthselector': function(t) {
- return ':' + _simple(t[1]) + '(' + _composite(t, 2) + ')';
- },
- 'percentage': function(t) {
- return _t(t[1]) + '%';
- },
- 'placeholder': function(t) {
- return '%' + _t(t[1]);
- },
- 'pseudoc': function(t) {
- return ':' + _t(t[1]);
- },
- 'pseudoe': function(t) {
- return '::' + _t(t[1]);
- },
- 'shash': function (t) {
- return '#' + t[1];
- },
- 'uri': function(t) {
- return 'url(' + _composite(t) + ')';
- },
- 'variable': function(t) {
- return '$' + _t(t[1]);
- },
- 'variableslist': function(t) {
- return _t(t[1]) + '...';
- },
- 'vhash': function(t) {
- return '#' + t[1];
- }
- };
-
- return _t(tree);
-}
diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/src-to-ast.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/src-to-ast.js
deleted file mode 100644
index 9292d52..0000000
--- a/node_modules/csscomb/node_modules/gonzales-pe/lib/src-to-ast.js
+++ /dev/null
@@ -1,75 +0,0 @@
-module.exports = (function() {
- function throwError(e, src) {
- var line = e.line;
- var name = 'Parsing error';
- var version = require('../package.json').version;
- var message = formatErrorMessage(src, line, version);
- var error = {
- line: line,
- syntax: e.syntax,
- version: version,
- name: name,
- message: message
- }
- error.toString = function() {return this.name + ': ' + this.message;};
- throw error;
- }
-
- function formatErrorMessage(text, ln, version) {
- var message = ['Please check the validity of the block starting from line #' + ln];
-
- message.push('');
- var code = formatCodeFragment(text, ln);
- message = message.concat(code);
- message.push('');
-
- message.push('Gonzales PE version: ' + version);
-
- return message.join('\n');
- }
-
- function formatCodeFragment(text, lineNumber) {
- var lines = text.split(/\r\n|\r|\n/);
- var linesAround = 2;
- var result = [];
-
- for (var i = lineNumber - 1 - linesAround; i < lineNumber + linesAround; i++) {
- var line = lines[i];
- if (!line) continue;
- var ln = i + 1;
- var mark = ln === lineNumber ? '*' : ' ';
- result.push(ln + mark + '| ' + line);
- }
-
- return result;
- }
-
- return function(options) {
- var src, rule, syntax, getTokens, mark, rules, tokens, ast;
-
- if (!options || !options.src) throw new Error('Please, pass a string to parse');
-
- src = typeof options === 'string' ? options : options.src;
- syntax = options.syntax || 'css';
- rule = options.rule || (syntax === 'js' ? 'program' : 'stylesheet');
-
- var fs = require('fs');
- if (!fs.existsSync(__dirname + '/' + syntax))
- return console.error('Syntax "' + syntax + '" is not supported yet, sorry');
-
- getTokens = require('./' + syntax + '/tokenizer');
- mark = require('./' + syntax + '/mark');
- rules = require('./' + syntax + '/rules');
-
- tokens = getTokens(src);
- mark(tokens);
-
- try {
- ast = rules(tokens, rule);
- } catch (e) {
- throwError(e, src);
- }
-
- return ast;
- }
-})();
diff --git a/node_modules/csscomb/node_modules/gonzales-pe/package.json b/node_modules/csscomb/node_modules/gonzales-pe/package.json
deleted file mode 100644
index 3c74109..0000000
--- a/node_modules/csscomb/node_modules/gonzales-pe/package.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- "name": "gonzales-pe",
- "description": "Gonzales Preprocessor Edition (fast CSS parser)",
- "version": "3.0.0-10",
- "homepage": "http://github.com/tonyganch/gonzales-pe",
- "bugs": {
- "url": "http://github.com/tonyganch/gonzales-pe/issues"
- },
- "license": "MIT",
- "author": {
- "name": "Tony Ganch",
- "email": "tonyganch+github@gmail.com",
- "url": "http://tonyganch.com"
- },
- "main": "./lib/gonzales",
- "repository": {
- "type": "git",
- "url": "http://github.com/tonyganch/gonzales-pe.git"
- },
- "scripts": {
- "test": "(mkdir -p log && node ./test/mocha.js) | tee ./log/test.log"
- },
- "bin": {
- "gonzales": "./bin/gonzales.js"
- },
- "devDependencies": {
- "benchmark": "~1.0.0",
- "coffee-script": "~1.7.1",
- "microtime": "~0.3.3",
- "mocha": "~1.20.0"
- },
- "engines": {
- "node": ">=0.6.0"
- },
- "readme": "Gonzales is a fast CSS parser. \nGonzales PE is a rework with support of preprocessors. \n\nCurrently those are supported: SCSS, Sass, LESS.\n\nFor a plan of future work see [issue #4](https://github.com/tonyganch/gonzales-pe/issues/4).\n\n## Install\n\nTo install globally:\n\n npm install gonzales-pe -g\n\nTo install as a project dependency:\n\n npm install gonzales-pe\n\nTo install dev branch:\n\n npm install git://github.com/tonyganch/gonzales-pe.git#dev\n\nTo clone from github:\n\n git clone git@github.com:tonyganch/gonzales-pe.git\n\n## Build\n\nIf you installed/cloned the repo from GitHub, make sure to build library files\nfirst. \nIt can be done by running `make` in the module's root directory. \n`make` will build both Node.js and web versions (all files are comments-free\nbut not compressed). \nIf you need a minified version for production, feel free to use uglifier of\nyour choice.\n\n## Use\n\nRequire Gonzales in your project:\n\n var gonzales = require('gonzales-pe');\n\nDo something:\n\n var css = 'a { color: tomato }';\n console.log(gonzales.cssToAST(css));\n\nYou can learn more about available methods on [Gonzales usage](doc/Gonzales-Usage.md) page.\n\nAST is described on [Gonzales AST description](doc/AST-Description.md) page.\n\nYou can also invoke gonzales via a shell command (if you globally install it via `npm install gonzales-pe -g`)\n\n```\ngonzales myFile.css\n```\n\nOutputs the AST for that file. Example output:\n\n```\n['stylesheet',\n ['atrules',\n ['atkeyword',\n ['ident', 'import']],\n ['s', '\n']]]\n```\n\n## Test\n\nTo run tests:\n\n npm test\n\nThis command will build library files from sources and run tests on all files\nin syntax directories.\n\nEvery test has 3 files: source stylesheet, expected AST and expected string\ncompiled back from AST to css.\n\nIf some tests fail, you can find information in test logs:\n\n- `log/test.log` contains all information from stdout;\n- `log/expected.txt` contains only expected text;\n- `log/result.txt` contains only result text.\n\nThe last two are made for your convenience: you can use any diff app to see\nthe defference between them.\n\nIf you want to test one specific string or get a general idea of how Gonzales\nworks, you can use `test/ast.js` file. \nSimply change the first two strings (`css` and `syntax` vars) and run:\n\n node test/ast.js\n\nPlease remember to also run `make` every time you modify any source files.\n\n## Report\n\nIf you find a bug or want to add a feature, welcome to [Issues](https://github.com/tonyganch/gonzales-pe/issues).\n\nIf you are shy but have a question, feel free to [drop me a\nline](mailto:tonyganch+gonzales@gmail.com).\n",
- "readmeFilename": "README.md",
- "gitHead": "8d860d993f2a645644c0e5bc0d59951cdb64990b",
- "_id": "gonzales-pe@3.0.0-10",
- "_shasum": "6dac1b7e4070118042de92c6ff7a8fc346255dde",
- "_from": "gonzales-pe@>=3.0.0-0 <3.1.0-0"
-}
diff --git a/node_modules/csscomb/node_modules/gonzales-pe/web/gonzales.ast-to-css.js b/node_modules/csscomb/node_modules/gonzales-pe/web/gonzales.ast-to-css.js
deleted file mode 100644
index 170b6bf..0000000
--- a/node_modules/csscomb/node_modules/gonzales-pe/web/gonzales.ast-to-css.js
+++ /dev/null
@@ -1,120 +0,0 @@
-function astToCSS(options) {
- var tree, hasInfo, syntax;
- if (!options) throw new Error('We need tree to translate');
- tree = typeof options === 'string' ? options : options.ast;
- hasInfo = typeof tree[0] === 'object';
- syntax = options.syntax || 'css';
- var _m_simple = {
- 'attrselector': 1, 'combinator': 1, 'ident': 1, 'nth': 1, 'number': 1,
- 'operator': 1, 'raw': 1, 's': 1, 'string': 1, 'unary': 1, 'unknown': 1
- },
- _m_composite = {
- 'atruleb': 1, 'atrulerq': 1, 'atrulers': 1, 'atrules': 1,'condition': 1,
- 'declaration': 1, 'dimension': 1, 'filterv': 1, 'include': 1,
- 'loop': 1, 'mixin': 1, 'selector': 1, 'progid': 1, 'property': 1,
- 'ruleset': 1, 'simpleselector': 1, 'stylesheet': 1, 'value': 1
- },
- _m_primitive = {
- 'cdc': 'cdc', 'cdo': 'cdo',
- 'declDelim': syntax === 'sass' ? '\n' : ';',
- 'delim': ',',
- 'namespace': '|', 'parentselector': '&', 'propertyDelim' : ':'
- };
- function _t(tree) {
- var t = tree[hasInfo? 1 : 0];
- if (t in _m_primitive) return _m_primitive[t];
- else if (t in _m_simple) return _simple(tree);
- else if (t in _m_composite) return _composite(tree);
- return _unique[t](tree);
- }
- function _composite(t, i) {
- var s = '';
- i = i === undefined ? (hasInfo? 2 : 1) : i;
- for (; i < t.length; i++) s += _t(t[i]);
- return s;
- }
- function _simple(t) {
- return t[hasInfo? 2 : 1];
- }
- var _unique = {
- 'arguments': function(t) {
- return '(' + _composite(t) + ')';
- },
- 'atkeyword': function(t) {
- return '@' + _t(t[hasInfo? 2 : 1]);
- },
- 'atruler': function(t) {
- return _t(t[hasInfo? 2 : 1]) + _t(t[hasInfo? 3 : 2]) + '{' + _t(t[hasInfo? 4 : 3]) + '}';
- },
- 'attrib': function(t) {
- return '[' + _composite(t) + ']';
- },
- 'block': function(t) {
- return syntax === 'sass' ? _composite(t) : '{' + _composite(t) + '}';
- },
- 'braces': function(t) {
- return t[hasInfo? 2 : 1] + _composite(t, hasInfo? 4 : 3) + t[hasInfo? 3 : 2];
- },
- 'class': function(t) {
- return '.' + _t(t[hasInfo? 2 : 1]);
- },
- 'commentML': function (t) {
- return '/*' + t[hasInfo? 2 : 1] + (syntax === 'sass' ? '' : '*/');
- },
- 'commentSL': function (t) {
- return '/' + '/' + t[hasInfo? 2 : 1];
- },
- 'default': function(t) {
- return '!' + _composite(t) + 'default';
- },
- 'escapedString': function(t) {
- return '~' + t[hasInfo? 2 : 1];
- },
- 'filter': function(t) {
- return _t(t[hasInfo? 2 : 1]) + ':' + _t(t[hasInfo? 3 : 2]);
- },
- 'functionExpression': function(t) {
- return 'expression(' + t[hasInfo? 2 : 1] + ')';
- },
- 'function': function(t) {
- return _simple(t[hasInfo? 2 : 1]) + '(' + _composite(t[hasInfo? 3: 2]) + ')';
- },
- 'important': function(t) {
- return '!' + _composite(t) + 'important';
- },
- 'interpolatedVariable': function(t) {
- return (syntax === 'less' ? '@{' : '#\{$') + _t(t[hasInfo? 2 : 1]) + '}';
- },
- 'nthselector': function(t) {
- return ':' + _simple(t[hasInfo? 2 : 1]) + '(' + _composite(t, hasInfo? 3 : 2) + ')';
- },
- 'percentage': function(t) {
- return _t(t[hasInfo? 2 : 1]) + '%';
- },
- 'placeholder': function(t) {
- return '%' + _t(t[hasInfo? 2 : 1]);
- },
- 'pseudoc': function(t) {
- return ':' + _t(t[hasInfo? 2 : 1]);
- },
- 'pseudoe': function(t) {
- return '::' + _t(t[hasInfo? 2 : 1]);
- },
- 'shash': function (t) {
- return '#' + t[hasInfo? 2 : 1];
- },
- 'uri': function(t) {
- return 'url(' + _composite(t) + ')';
- },
- 'variable': function(t) {
- return (syntax === 'less' ? '@' : '$') + _t(t[hasInfo? 2 : 1]);
- },
- 'variableslist': function(t) {
- return _t(t[hasInfo? 2 : 1]) + '...';
- },
- 'vhash': function(t) {
- return '#' + t[hasInfo? 2 : 1];
- }
- };
- return _t(tree);
-}
diff --git a/node_modules/csscomb/node_modules/gonzales-pe/web/gonzales.css-to-ast.js b/node_modules/csscomb/node_modules/gonzales-pe/web/gonzales.css-to-ast.js
deleted file mode 100644
index 8309322..0000000
--- a/node_modules/csscomb/node_modules/gonzales-pe/web/gonzales.css-to-ast.js
+++ /dev/null
@@ -1,3831 +0,0 @@
-var cssToAST = (function() {
- var syntaxes = {},
- s,
- needInfo,
- tokens,
- tokensLength,
- tn = 0,
- ln = 1,
- pos = 0;
- function pushToken(type, value) {
- tokens.push({ tn: tn++, ln: ln, type: type, value: value });
- }
- function throwError(i) {
- var ln = i ? tokens[i].ln : tokens[pos].ln;
- throw new Error('Please check the validity of the CSS block starting from the line #' + ln);
- }
- function getInfo(i) {
- return { ln: tokens[i].ln, tn: tokens[i].tn };
- }
- function checkExcluding(exclude, i) {
- var start = i;
- while(i < tokensLength) {
- if (exclude[tokens[i++].type]) break;
- }
- return i - start - 2;
- }
- function joinValues(start, finish) {
- var s = '';
- for (var i = start; i < finish + 1; i++) {
- s += tokens[i].value;
- }
- return s;
- }
- function joinValues2(start, num) {
- if (start + num - 1 >= tokensLength) return;
- var s = '';
- for (var i = 0; i < num; i++) {
- s += tokens[start + i].value;
- }
- return s;
- }
-var TokenType = {
- StringSQ: 'StringSQ',
- StringDQ: 'StringDQ',
- CommentML: 'CommentML',
- CommentSL: 'CommentSL',
- Newline: 'Newline',
- Space: 'Space',
- Tab: 'Tab',
- ExclamationMark: 'ExclamationMark',
- QuotationMark: 'QuotationMark',
- NumberSign: 'NumberSign',
- DollarSign: 'DollarSign',
- PercentSign: 'PercentSign',
- Ampersand: 'Ampersand',
- Apostrophe: 'Apostrophe',
- LeftParenthesis: 'LeftParenthesis',
- RightParenthesis: 'RightParenthesis',
- Asterisk: 'Asterisk',
- PlusSign: 'PlusSign',
- Comma: 'Comma',
- HyphenMinus: 'HyphenMinus',
- FullStop: 'FullStop',
- Solidus: 'Solidus',
- Colon: 'Colon',
- Semicolon: 'Semicolon',
- LessThanSign: 'LessThanSign',
- EqualsSign: 'EqualsSign',
- GreaterThanSign: 'GreaterThanSign',
- QuestionMark: 'QuestionMark',
- CommercialAt: 'CommercialAt',
- LeftSquareBracket: 'LeftSquareBracket',
- ReverseSolidus: 'ReverseSolidus',
- RightSquareBracket: 'RightSquareBracket',
- CircumflexAccent: 'CircumflexAccent',
- LowLine: 'LowLine',
- LeftCurlyBracket: 'LeftCurlyBracket',
- VerticalLine: 'VerticalLine',
- RightCurlyBracket: 'RightCurlyBracket',
- Tilde: 'Tilde',
- Identifier: 'Identifier',
- DecimalNumber: 'DecimalNumber'
-};
-var NodeType = {
- ArgumentsType: 'arguments',
- AtkeywordType: 'atkeyword',
- AtrulebType: 'atruleb',
- AtrulerType: 'atruler',
- AtrulerqType: 'atrulerq',
- AtrulersType: 'atrulers',
- AtrulesType: 'atrules',
- AttribType: 'attrib',
- AttrselectorType: 'attrselector',
- BlockType: 'block',
- BracesType: 'braces',
- CdcType: 'cdc',
- CdoType: 'cdo',
- ClassType: 'class',
- CombinatorType: 'combinator',
- CommentMLType: 'commentML',
- CommentSLType: 'commentSL',
- ConditionType: 'condition',
- DeclarationType: 'declaration',
- DeclDelimType: 'declDelim',
- DefaultType: 'default',
- DelimType: 'delim',
- DimensionType: 'dimension',
- EscapedStringType: 'escapedString',
- FilterType: 'filter',
- FiltervType: 'filterv',
- FunctionType: 'function',
- FunctionBodyType: 'functionBody',
- FunctionExpressionType: 'functionExpression',
- IdentType: 'ident',
- ImportantType: 'important',
- IncludeType :'include',
- InterpolatedVariableType: 'interpolatedVariable',
- LoopType: 'loop',
- MixinType: 'mixin',
- NamespaceType: 'namespace',
- NthType: 'nth',
- NthselectorType: 'nthselector',
- NumberType: 'number',
- OperatorType: 'operator',
- ParentSelectorType: 'parentselector',
- PercentageType: 'percentage',
- PlaceholderType: 'placeholder',
- ProgidType: 'progid',
- PropertyType: 'property',
- PropertyDelimType: 'propertyDelim',
- PseudocType: 'pseudoc',
- PseudoeType: 'pseudoe',
- RawType: 'raw',
- RulesetType: 'ruleset',
- SType: 's',
- SelectorType: 'selector',
- ShashType: 'shash',
- SimpleselectorType: 'simpleselector',
- StringType: 'string',
- StylesheetType: 'stylesheet',
- UnaryType: 'unary',
- UnknownType: 'unknown',
- UriType: 'uri',
- ValueType: 'value',
- VariableType: 'variable',
- VariablesListType: 'variableslist',
- VhashType: 'vhash'
-};
-var getTokens = (function() {
- var Punctuation,
- urlMode = false,
- blockMode = 0;
- Punctuation = {
- ' ': TokenType.Space,
- '\n': TokenType.Newline,
- '\r': TokenType.Newline,
- '\t': TokenType.Tab,
- '!': TokenType.ExclamationMark,
- '"': TokenType.QuotationMark,
- '#': TokenType.NumberSign,
- '$': TokenType.DollarSign,
- '%': TokenType.PercentSign,
- '&': TokenType.Ampersand,
- '\'': TokenType.Apostrophe,
- '(': TokenType.LeftParenthesis,
- ')': TokenType.RightParenthesis,
- '*': TokenType.Asterisk,
- '+': TokenType.PlusSign,
- ',': TokenType.Comma,
- '-': TokenType.HyphenMinus,
- '.': TokenType.FullStop,
- '/': TokenType.Solidus,
- ':': TokenType.Colon,
- ';': TokenType.Semicolon,
- '<': TokenType.LessThanSign,
- '=': TokenType.EqualsSign,
- '>': TokenType.GreaterThanSign,
- '?': TokenType.QuestionMark,
- '@': TokenType.CommercialAt,
- '[': TokenType.LeftSquareBracket,
- ']': TokenType.RightSquareBracket,
- '^': TokenType.CircumflexAccent,
- '_': TokenType.LowLine,
- '{': TokenType.LeftCurlyBracket,
- '|': TokenType.VerticalLine,
- '}': TokenType.RightCurlyBracket,
- '~': TokenType.Tilde
- };
- function isDecimalDigit(c) {
- return '0123456789'.indexOf(c) >= 0;
- }
- function parseSpaces(css) {
- var start = pos;
- for (; pos < css.length; pos++) {
- if (css.charAt(pos) !== ' ') break;
- }
- pushToken(TokenType.Space, css.substring(start, pos));
- pos--;
- }
- function parseString(css, q) {
- var start = pos;
- for (pos = pos + 1; pos < css.length; pos++) {
- if (css.charAt(pos) === '\\') pos++;
- else if (css.charAt(pos) === q) break;
- }
- pushToken(q === '"' ? TokenType.StringDQ : TokenType.StringSQ, css.substring(start, pos + 1));
- }
- function parseDecimalNumber(css) {
- var start = pos;
- for (; pos < css.length; pos++) {
- if (!isDecimalDigit(css.charAt(pos))) break;
- }
- pushToken(TokenType.DecimalNumber, css.substring(start, pos));
- pos--;
- }
- function parseIdentifier(css) {
- var start = pos;
- while (css.charAt(pos) === '/') pos++;
- for (; pos < css.length; pos++) {
- if (css.charAt(pos) === '\\') pos++;
- else if (css.charAt(pos) in Punctuation) break;
- }
- var ident = css.substring(start, pos);
- urlMode = urlMode || ident === 'url';
- pushToken(TokenType.Identifier, ident);
- pos--;
- }
- function _getTokens(css, syntax) {
- var c,
- cn;
- tokens = [];
- pos = 0;
- tn = 0;
- ln = 1;
- for (pos = 0; pos < css.length; pos++) {
- c = css.charAt(pos);
- cn = css.charAt(pos + 1);
- if (c === '/' && cn === '*') {
- s.parseMLComment(css);
- }
- else if (!urlMode && c === '/' && cn === '/') {
- if (syntax === 'css' && blockMode > 0) parseIdentifier(css);
- else s.parseSLComment && s.parseSLComment(css);
- }
- else if (c === '"' || c === "'") {
- parseString(css, c);
- }
- else if (c === ' ') {
- parseSpaces(css)
- }
- else if (c in Punctuation) {
- pushToken(Punctuation[c], c);
- if (c === '\n' || c === '\r') ln++;
- if (c === ')') urlMode = false;
- if (c === '{') blockMode++;
- if (c === '}') blockMode--;
- }
- else if (isDecimalDigit(c)) {
- parseDecimalNumber(css);
- }
- else {
- parseIdentifier(css);
- }
- }
- }
- return function(s, syntax) {
- return _getTokens(s, syntax);
- };
-}());
-var rules = {
- 'arguments': function() { if (s.checkArguments(pos)) return s.getArguments() },
- 'atkeyword': function() { if (s.checkAtkeyword(pos)) return s.getAtkeyword() },
- 'atruleb': function() { if (s.checkAtruleb(pos)) return s.getAtruleb() },
- 'atruler': function() { if (s.checkAtruler(pos)) return s.getAtruler() },
- 'atrulerq': function() { if (s.checkAtrulerq(pos)) return s.getAtrulerq() },
- 'atrulers': function() { if (s.checkAtrulers(pos)) return s.getAtrulers() },
- 'atrules': function() { if (s.checkAtrules(pos)) return s.getAtrules() },
- 'attrib': function() { if (s.checkAttrib(pos)) return s.getAttrib() },
- 'attrselector': function() { if (s.checkAttrselector(pos)) return s.getAttrselector() },
- 'block': function() { if (s.checkBlock(pos)) return s.getBlock() },
- 'braces': function() { if (s.checkBraces(pos)) return s.getBraces() },
- 'class': function() { if (s.checkClass(pos)) return s.getClass() },
- 'combinator': function() { if (s.checkCombinator(pos)) return s.getCombinator() },
- 'commentML': function() { if (s.checkCommentML(pos)) return s.getCommentML() },
- 'commentSL': function() { if (s.checkCommentSL(pos)) return s.getCommentSL() },
- 'condition': function() { if (s.checkCondition(pos)) return s.getCondition() },
- 'declaration': function() { if (s.checkDeclaration(pos)) return s.getDeclaration() },
- 'declDelim': function() { if (s.checkDeclDelim(pos)) return s.getDeclDelim() },
- 'default': function () { if (s.checkDefault(pos)) return s.getDefault() },
- 'delim': function() { if (s.checkDelim(pos)) return s.getDelim() },
- 'dimension': function() { if (s.checkDimension(pos)) return s.getDimension() },
- 'escapedString': function() { if (s.checkEscapedString(pos)) return s.getEscapedString() },
- 'filter': function() { if (s.checkFilter(pos)) return s.getFilter() },
- 'filterv': function() { if (s.checkFilterv(pos)) return s.getFilterv() },
- 'functionExpression': function() { if (s.checkFunctionExpression(pos)) return s.getFunctionExpression() },
- 'function': function() { if (s.checkFunction(pos)) return s.getFunction() },
- 'ident': function() { if (s.checkIdent(pos)) return s.getIdent() },
- 'important': function() { if (s.checkImportant(pos)) return s.getImportant() },
- 'include': function () { if (s.checkInclude(pos)) return s.getInclude() },
- 'interpolatedVariable': function () { if (s.checkInterpolatedVariable(pos)) return s.getInterpolatedVariable() },
- 'loop': function() { if (s.checkLoop(pos)) return s.getLoop() },
- 'mixin': function () { if (s.checkMixin(pos)) return s.getMixin() },
- 'namespace': function() { if (s.checkNamespace(pos)) return s.getNamespace() },
- 'nth': function() { if (s.checkNth(pos)) return s.getNth() },
- 'nthselector': function() { if (s.checkNthselector(pos)) return s.getNthselector() },
- 'number': function() { if (s.checkNumber(pos)) return s.getNumber() },
- 'operator': function() { if (s.checkOperator(pos)) return s.getOperator() },
- 'parentselector': function () { if (s.checkParentSelector(pos)) return s.getParentSelector() },
- 'percentage': function() { if (s.checkPercentage(pos)) return s.getPercentage() },
- 'placeholder': function() { if (s.checkPlaceholder(pos)) return s.getPlaceholder() },
- 'progid': function() { if (s.checkProgid(pos)) return s.getProgid() },
- 'property': function() { if (s.checkProperty(pos)) return s.getProperty() },
- 'propertyDelim': function() { if (s.checkPropertyDelim(pos)) return s.getPropertyDelim() },
- 'pseudoc': function() { if (s.checkPseudoc(pos)) return s.getPseudoc() },
- 'pseudoe': function() { if (s.checkPseudoe(pos)) return s.getPseudoe() },
- 'ruleset': function() { if (s.checkRuleset(pos)) return s.getRuleset() },
- 's': function() { if (s.checkS(pos)) return s.getS() },
- 'selector': function() { if (s.checkSelector(pos)) return s.getSelector() },
- 'shash': function() { if (s.checkShash(pos)) return s.getShash() },
- 'simpleselector': function() { if (s.checkSimpleSelector(pos)) return s.getSimpleSelector() },
- 'string': function() { if (s.checkString(pos)) return s.getString() },
- 'stylesheet': function() { if (s.checkStylesheet(pos)) return s.getStylesheet() },
- 'unary': function() { if (s.checkUnary(pos)) return s.getUnary() },
- 'unknown': function() { if (s.checkUnknown(pos)) return s.getUnknown() },
- 'uri': function() { if (s.checkUri(pos)) return s.getUri() },
- 'value': function() { if (s.checkValue(pos)) return s.getValue() },
- 'variable': function () { if (s.checkVariable(pos)) return s.getVariable() },
- 'variableslist': function () { if (s.checkVariablesList(pos)) return s.getVariablesList() },
- 'vhash': function() { if (s.checkVhash(pos)) return s.getVhash() }
-};
-syntaxes.css = {
- checkAny: function(i) {
- return this.checkBraces(i) ||
- this.checkString(i) ||
- this.checkPercentage(i) ||
- this.checkDimension(i) ||
- this.checkNumber(i) ||
- this.checkUri(i) ||
- this.checkFunctionExpression(i) ||
- this.checkFunction(i) ||
- this.checkIdent(i) ||
- this.checkClass(i) ||
- this.checkUnary(i);
- },
- getAny: function() {
- if (this.checkBraces(pos)) return this.getBraces();
- else if (this.checkString(pos)) return this.getString();
- else if (this.checkPercentage(pos)) return this.getPercentage();
- else if (this.checkDimension(pos)) return this.getDimension();
- else if (this.checkNumber(pos)) return this.getNumber();
- else if (this.checkUri(pos)) return this.getUri();
- else if (this.checkFunctionExpression(pos)) return this.getFunctionExpression();
- else if (this.checkFunction(pos)) return this.getFunction();
- else if (this.checkIdent(pos)) return this.getIdent();
- else if (this.checkClass(pos)) return this.getClass();
- else if (this.checkUnary(pos)) return this.getUnary();
- },
- checkAtkeyword: function(i) {
- var l;
- if (i >= tokensLength ||
- tokens[i++].type !== TokenType.CommercialAt) return 0;
- return (l = this.checkIdent(i)) ? l + 1 : 0;
- },
- getAtkeyword: function() {
- var startPos = pos,
- x;
- pos++;
- x = [NodeType.AtkeywordType, this.getIdent()];
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkAttrib: function(i) {
- if (i >= tokensLength ||
- tokens[i].type !== TokenType.LeftSquareBracket ||
- !tokens[i].right) return 0;
- return tokens[i].right - i + 1;
- },
- getAttrib: function() {
- if (this.checkAttrib1(pos)) return this.getAttrib1();
- if (this.checkAttrib2(pos)) return this.getAttrib2();
- },
- checkAttrib1: function(i) {
- var start = i,
- l;
- if (i++ >= tokensLength) return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkIdent(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkAttrselector(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkIdent(i) || this.checkString(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- return tokens[i].type === TokenType.RightSquareBracket ? i - start : 0;
- },
- getAttrib1: function() {
- var startPos = pos,
- x;
- pos++;
- x = [NodeType.AttribType]
- .concat(this.getSC())
- .concat([this.getIdent()])
- .concat(this.getSC())
- .concat([this.getAttrselector()])
- .concat(this.getSC())
- .concat([this.checkString(pos)? this.getString() : this.getIdent()])
- .concat(this.getSC());
- pos++;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkAttrib2: function(i) {
- var start = i,
- l;
- if (i++ >= tokensLength) return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkIdent(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- return tokens[i].type === TokenType.RightSquareBracket ? i - start : 0;
- },
- getAttrib2: function() {
- var startPos = pos,
- x;
- pos++;
- x = [NodeType.AttribType]
- .concat(this.getSC())
- .concat([this.getIdent()])
- .concat(this.getSC());
- pos++;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkAttrselector: function(i) {
- if (i >= tokensLength) return 0;
- if (tokens[i].type === TokenType.EqualsSign) return 1;
- if (tokens[i].type === TokenType.VerticalLine &&
- (!tokens[i + 1] || tokens[i + 1].type !== TokenType.EqualsSign))
- return 1;
- if (!tokens[i + 1] || tokens[i + 1].type !== TokenType.EqualsSign) return 0;
- switch(tokens[i].type) {
- case TokenType.Tilde:
- case TokenType.CircumflexAccent:
- case TokenType.DollarSign:
- case TokenType.Asterisk:
- case TokenType.VerticalLine:
- return 2;
- }
- return 0;
- },
- getAttrselector: function() {
- var startPos = pos,
- s = tokens[pos++].value,
- x;
- if (tokens[pos] && tokens[pos].type === TokenType.EqualsSign) s += tokens[pos++].value;
- x = [NodeType.AttrselectorType, s];
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkAtrule: function(i) {
- var l;
- if (i >= tokensLength) return 0;
- if (tokens[i].atrule_l !== undefined) return tokens[i].atrule_l;
- if (l = this.checkAtruler(i)) tokens[i].atrule_type = 1;
- else if (l = this.checkAtruleb(i)) tokens[i].atrule_type = 2;
- else if (l = this.checkAtrules(i)) tokens[i].atrule_type = 3;
- else return 0;
- tokens[i].atrule_l = l;
- return l;
- },
- getAtrule: function() {
- switch (tokens[pos].atrule_type) {
- case 1: return this.getAtruler();
- case 2: return this.getAtruleb();
- case 3: return this.getAtrules();
- }
- },
- checkAtruleb: function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkAtkeyword(i)) i += l;
- else return 0;
- if (l = this.checkTsets(i)) i += l;
- if (l = this.checkBlock(i)) i += l;
- else return 0;
- return i - start;
- },
- getAtruleb: function() {
- var startPos = pos,
- x;
- x = [NodeType.AtrulebType, this.getAtkeyword()]
- .concat(this.getTsets())
- .concat([this.getBlock()]);
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkAtruler: function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkAtkeyword(i)) i += l;
- else return 0;
- if (l = this.checkAtrulerq(i)) i += l;
- if (i < tokensLength && tokens[i].type === TokenType.LeftCurlyBracket) i++;
- else return 0;
- if (l = this.checkAtrulers(i)) i += l;
- if (i < tokensLength && tokens[i].type === TokenType.RightCurlyBracket) i++;
- else return 0;
- return i - start;
- },
- getAtruler: function() {
- var startPos = pos,
- x;
- x = [NodeType.AtrulerType, this.getAtkeyword(), this.getAtrulerq()];
- pos++;
- x.push(this.getAtrulers());
- pos++;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkAtrulerq: function(i) {
- return this.checkTsets(i);
- },
- getAtrulerq: function() {
- var startPos = pos,
- x;
- x = [NodeType.AtrulerqType].concat(this.getTsets());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkAtrulers: function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkSC(i)) i += l;
- while (l = this.checkRuleset(i) || this.checkAtrule(i) || this.checkSC(i)) {
- i += l;
- }
- tokens[i].atrulers_end = 1;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- },
- getAtrulers: function() {
- var startPos = pos,
- x;
- x = [NodeType.AtrulersType].concat(this.getSC());
- while (!tokens[pos].atrulers_end) {
- if (this.checkSC(pos)) x = x.concat(this.getSC());
- else if (this.checkRuleset(pos)) x.push(this.getRuleset());
- else x.push(this.getAtrule());
- }
- x = x.concat(this.getSC());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkAtrules: function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkAtkeyword(i)) i += l;
- else return 0;
- if (l = this.checkTsets(i)) i += l;
- return i - start;
- },
- getAtrules: function() {
- var startPos = pos,
- x;
- x = [NodeType.AtrulesType, this.getAtkeyword()].concat(this.getTsets());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkBlock: function(i) {
- return i < tokensLength && tokens[i].type === TokenType.LeftCurlyBracket ?
- tokens[i].right - i + 1 : 0;
- },
- getBlock: function() {
- var startPos = pos,
- end = tokens[pos].right,
- x = [NodeType.BlockType];
- pos++;
- while (pos < end) {
- if (this.checkBlockdecl(pos)) x = x.concat(this.getBlockdecl());
- else throwError();
- }
- pos = end + 1;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkBlockdecl: function(i) {
- var l;
- if (i >= tokensLength) return 0;
- if (l = this.checkBlockdecl1(i)) tokens[i].bd_type = 1;
- else if (l = this.checkBlockdecl2(i)) tokens[i].bd_type = 2;
- else if (l = this.checkBlockdecl3(i)) tokens[i].bd_type = 3;
- else if (l = this.checkBlockdecl4(i)) tokens[i].bd_type = 4;
- else return 0;
- return l;
- },
- getBlockdecl: function() {
- switch (tokens[pos].bd_type) {
- case 1: return this.getBlockdecl1();
- case 2: return this.getBlockdecl2();
- case 3: return this.getBlockdecl3();
- case 4: return this.getBlockdecl4();
- }
- },
- checkBlockdecl1: function(i) {
- var start = i,
- l;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkFilter(i)) tokens[i].bd_kind = 1;
- else if (l = this.checkDeclaration(i)) tokens[i].bd_kind = 2;
- else if (l = this.checkAtrule(i)) tokens[i].bd_kind = 3;
- else return 0;
- i += l;
- if (i < tokensLength && (l = this.checkDeclDelim(i))) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- else return 0;
- return i - start;
- },
- getBlockdecl1: function() {
- var sc = this.getSC(),
- x;
- switch (tokens[pos].bd_kind) {
- case 1:
- x = this.getFilter();
- break;
- case 2:
- x = this.getDeclaration();
- break;
- case 3:
- x = this.getAtrule();
- break;
- }
- return sc
- .concat([x])
- .concat([this.getDeclDelim()])
- .concat(this.getSC());
- },
- checkBlockdecl2: function(i) {
- var start = i,
- l;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkFilter(i)) tokens[i].bd_kind = 1;
- else if (l = this.checkDeclaration(i)) tokens[i].bd_kind = 2;
- else if (l = this.checkAtrule(i)) tokens[i].bd_kind = 3;
- else return 0;
- i += l;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- },
- getBlockdecl2: function() {
- var sc = this.getSC(),
- x;
- switch (tokens[pos].bd_kind) {
- case 1:
- x = this.getFilter();
- break;
- case 2:
- x = this.getDeclaration();
- break;
- case 3:
- x = this.getAtrule();
- break;
- }
- return sc
- .concat([x])
- .concat(this.getSC());
- },
- checkBlockdecl3: function(i) {
- var start = i,
- l;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkDeclDelim(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- },
- getBlockdecl3: function() {
- return this.getSC()
- .concat([this.getDeclDelim()])
- .concat(this.getSC());
- },
- checkBlockdecl4: function(i) {
- return this.checkSC(i);
- },
- getBlockdecl4: function() {
- return this.getSC();
- },
- checkBraces: function(i) {
- if (i >= tokensLength ||
- (tokens[i].type !== TokenType.LeftParenthesis &&
- tokens[i].type !== TokenType.LeftSquareBracket)) return 0;
- return tokens[i].right - i + 1;
- },
- getBraces: function() {
- var startPos = pos,
- left = pos,
- right = tokens[pos].right,
- x;
- pos++;
- var tsets = this.getTsets();
- pos++;
- x = [NodeType.BracesType, tokens[left].value, tokens[right].value]
- .concat(tsets);
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkClass: function(i) {
- var l;
- if (i >= tokensLength) return 0;
- if (tokens[i].class_l) return tokens[i].class_l;
- if (tokens[i++].type === TokenType.FullStop && (l = this.checkIdent(i))) {
- tokens[i].class_l = l + 1;
- return l + 1;
- }
- return 0;
- },
- getClass: function() {
- var startPos = pos,
- x = [NodeType.ClassType];
- pos++;
- x.push(this.getIdent());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkCombinator: function(i) {
- if (i >= tokensLength) return 0;
- switch (tokens[i].type) {
- case TokenType.PlusSign:
- case TokenType.GreaterThanSign:
- case TokenType.Tilde:
- return 1;
- }
- return 0;
- },
- getCombinator: function() {
- var startPos = pos,
- x;
- x = [NodeType.CombinatorType, tokens[pos++].value];
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkCommentML: function(i) {
- return i < tokensLength && tokens[i].type === TokenType.CommentML ? 1 : 0;
- },
- getCommentML: function() {
- var startPos = pos,
- s = tokens[pos].value.substring(2),
- l = s.length,
- x;
- if (s.charAt(l - 2) === '*' && s.charAt(l - 1) === '/') s = s.substring(0, l - 2);
- pos++;
- x = [NodeType.CommentMLType, s];
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkDeclaration: function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkProperty(i)) i += l;
- else return 0;
- if (l = this.checkPropertyDelim(i)) i++;
- else return 0;
- if (l = this.checkValue(i)) i += l;
- else return 0;
- return i - start;
- },
- getDeclaration: function() {
- var startPos = pos,
- x = [NodeType.DeclarationType];
- x.push(this.getProperty());
- x.push(this.getPropertyDelim());
- x.push(this.getValue());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkDeclDelim: function(i) {
- return i < tokensLength && tokens[i].type === TokenType.Semicolon ? 1 : 0;
- },
- getDeclDelim: function() {
- var startPos = pos,
- x = [NodeType.DeclDelimType];
- pos++;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkDelim: function(i) {
- return i < tokensLength && tokens[i].type === TokenType.Comma ? 1 : 0;
- },
- getDelim: function() {
- var startPos = pos,
- x = [NodeType.DelimType];
- pos++;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkDimension: function(i) {
- var ln = this.checkNumber(i),
- li;
- if (i >= tokensLength ||
- !ln ||
- i + ln >= tokensLength) return 0;
- return (li = this.checkNmName2(i + ln)) ? ln + li : 0;
- },
- getDimension: function() {
- var startPos = pos,
- x = [NodeType.DimensionType, this.getNumber()],
- ident = [NodeType.IdentType, this.getNmName2()];
- if (needInfo) ident.unshift(getInfo(startPos));
- x.push(ident);
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkFilter: function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkFilterp(i)) i += l;
- else return 0;
- if (tokens[i].type === TokenType.Colon) i++;
- else return 0;
- if (l = this.checkFilterv(i)) i += l;
- else return 0;
- return i - start;
- },
- getFilter: function() {
- var startPos = pos,
- x = [NodeType.FilterType, this.getFilterp()];
- pos++;
- x.push(this.getFilterv());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkFilterp: function(i) {
- var start = i,
- l,
- x;
- if (i >= tokensLength) return 0;
- if (tokens[i].value === 'filter') l = 1;
- else {
- x = joinValues2(i, 2);
- if (x === '-filter' || x === '_filter' || x === '*filter') l = 2;
- else {
- x = joinValues2(i, 4);
- if (x === '-ms-filter') l = 4;
- else return 0;
- }
- }
- tokens[start].filterp_l = l;
- i += l;
- if (this.checkSC(i)) i += l;
- return i - start;
- },
- getFilterp: function() {
- var startPos = pos,
- ident = [NodeType.IdentType, joinValues2(pos, tokens[pos].filterp_l)],
- x;
- if (needInfo) ident.unshift(getInfo(startPos));
- pos += tokens[pos].filterp_l;
- x = [NodeType.PropertyType, ident].concat(this.getSC());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkFilterv: function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkProgid(i)) i += l;
- else return 0;
- while (l = this.checkProgid(i)) {
- i += l;
- }
- tokens[start].last_progid = i;
- if (i < tokensLength && (l = this.checkSC(i))) i += l;
- if (i < tokensLength && (l = this.checkImportant(i))) i += l;
- return i - start;
- },
- getFilterv: function() {
- var startPos = pos,
- x = [NodeType.FiltervType],
- last_progid = tokens[pos].last_progid;
- x = x.concat(this.getSC());
- while (pos < last_progid) {
- x.push(this.getProgid());
- }
- if (this.checkSC(pos)) x = x.concat(this.getSC());
- if (pos < tokensLength && this.checkImportant(pos)) x.push(this.getImportant());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkFunctionExpression: function(i) {
- var start = i;
- if (i >= tokensLength || tokens[i++].value !== 'expression' ||
- i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis) return 0;
- return tokens[i].right - start + 1;
- },
- getFunctionExpression: function() {
- var startPos = pos,
- x, e;
- pos++;
- e = joinValues(pos + 1, tokens[pos].right - 1);
- pos = tokens[pos].right + 1;
- x = [NodeType.FunctionExpressionType, e];
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkFunction: function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkIdent(i)) i +=l;
- else return 0;
- return i < tokensLength && tokens[i].type === TokenType.LeftParenthesis ?
- tokens[i].right - start + 1 : 0;
- },
- getFunction: function() {
- var startPos = pos,
- ident = this.getIdent(),
- x = [NodeType.FunctionType, ident],
- body;
- pos++;
- body = ident[needInfo ? 2 : 1] === 'not' ? this.getNotFunctionBody() : this.getFunctionBody();
- x.push(body);
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- getFunctionBody: function() {
- var startPos = pos,
- x = [NodeType.FunctionBodyType],
- body;
- while (tokens[pos].type !== TokenType.RightParenthesis) {
- if (this.checkDeclaration(pos)) x.push(this.getDeclaration());
- else if (this.checkTset(pos)) {
- body = this.getTset();
- if ((needInfo && typeof body[1] === 'string') || typeof body[0] === 'string') x.push(body);
- else x = x.concat(body);
- } else if (this.checkClass(pos)) x.push(this.getClass());
- else throwError();
- }
- pos++;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- getNotFunctionBody: function() {
- var startPos = pos,
- x = [NodeType.FunctionBodyType];
- while (tokens[pos].type !== TokenType.RightParenthesis) {
- if (this.checkSimpleSelector(pos)) x.push(this.getSimpleSelector());
- else throwError();
- }
- pos++;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkIdent: function(i) {
- var start = i,
- wasIdent,
- l;
- if (i >= tokensLength) return 0;
- if (tokens[i].type === TokenType.LowLine) return this.checkIdentLowLine(i);
- if (tokens[i].type === TokenType.HyphenMinus ||
- tokens[i].type === TokenType.Identifier ||
- tokens[i].type === TokenType.DollarSign ||
- tokens[i].type === TokenType.Asterisk) i++;
- else return 0;
- wasIdent = tokens[i - 1].type === TokenType.Identifier;
- for (; i < tokensLength; i++) {
- if (i >= tokensLength) break;
- if (tokens[i].type !== TokenType.HyphenMinus &&
- tokens[i].type !== TokenType.LowLine) {
- if (tokens[i].type !== TokenType.Identifier &&
- (tokens[i].type !== TokenType.DecimalNumber || !wasIdent)) break;
- else wasIdent = true;
- }
- }
- if (!wasIdent && tokens[start].type !== TokenType.Asterisk) return 0;
- tokens[start].ident_last = i - 1;
- return i - start;
- },
- checkIdentLowLine: function(i) {
- var start = i;
- if (i++ >= tokensLength) return 0;
- for (; i < tokensLength; i++) {
- if (tokens[i].type !== TokenType.HyphenMinus &&
- tokens[i].type !== TokenType.DecimalNumber &&
- tokens[i].type !== TokenType.LowLine &&
- tokens[i].type !== TokenType.Identifier) break;
- }
- tokens[start].ident_last = i - 1;
- return i - start;
- },
- getIdent: function() {
- var startPos = pos,
- x = [NodeType.IdentType, joinValues(pos, tokens[pos].ident_last)];
- pos = tokens[pos].ident_last + 1;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkImportant: function(i) {
- var start = i,
- l;
- if (i >= tokensLength ||
- tokens[i++].type !== TokenType.ExclamationMark) return 0;
- if (l = this.checkSC(i)) i += l;
- return tokens[i].value === 'important' ? i - start + 1 : 0;
- },
- getImportant: function() {
- var startPos = pos,
- x = [NodeType.ImportantType];
- pos++;
- x = x.concat(this.getSC());
- pos++;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkNamespace: function(i) {
- return i < tokensLength && tokens[i].type === TokenType.VerticalLine ? 1 : 0;
- },
- getNamespace: function() {
- var startPos = pos,
- x = [NodeType.NamespaceType];
- pos++;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkNmName: function(i) {
- var start = i;
- if (i >= tokensLength) return 0;
- if (tokens[i].type === TokenType.HyphenMinus ||
- tokens[i].type === TokenType.LowLine ||
- tokens[i].type === TokenType.Identifier ||
- tokens[i].type === TokenType.DecimalNumber) i++;
- else return 0;
- for (; i < tokensLength; i++) {
- if (tokens[i].type !== TokenType.HyphenMinus &&
- tokens[i].type !== TokenType.LowLine &&
- tokens[i].type !== TokenType.Identifier &&
- tokens[i].type !== TokenType.DecimalNumber) break;
- }
- tokens[start].nm_name_last = i - 1;
- return i - start;
- },
- getNmName: function() {
- var s = joinValues(pos, tokens[pos].nm_name_last);
- pos = tokens[pos].nm_name_last + 1;
- return s;
- },
- checkNmName2: function(i) {
- if (tokens[i].type === TokenType.Identifier) return 1;
- else if (tokens[i].type !== TokenType.DecimalNumber) return 0;
- i++;
- return i < tokensLength && tokens[i].type === TokenType.Identifier ? 2 : 1;
- },
- getNmName2: function() {
- var s = tokens[pos].value;
- if (tokens[pos++].type === TokenType.DecimalNumber &&
- pos < tokensLength &&
- tokens[pos].type === TokenType.Identifier) s += tokens[pos++].value;
- return s;
- },
- checkNth: function(i) {
- if (i >= tokensLength) return 0;
- return this.checkNth1(i) || this.checkNth2(i);
- },
- checkNth1: function(i) {
- var start = i;
- for (; i < tokensLength; i++) {
- if (tokens[i].type !== TokenType.DecimalNumber &&
- tokens[i].value !== 'n') break;
- }
- if (i !== start) tokens[start].nth_last = i - 1;
- return i - start;
- },
- getNth: function() {
- var startPos = pos,
- x = [NodeType.NthType];
- if (tokens[pos].nth_last) {
- x.push(joinValues(pos, tokens[pos].nth_last));
- pos = tokens[pos].nth_last + 1;
- } else {
- x.push(tokens[pos++].value);
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkNth2: function(i) {
- return tokens[i].value === 'even' || tokens[i].value === 'odd' ? 1 : 0;
- },
- checkNthf: function(i) {
- var start = i,
- l = 0;
- if (tokens[i++].type !== TokenType.Colon) return 0;
- l++;
- if (tokens[i++].value !== 'nth' || tokens[i++].value !== '-') return 0;
- l += 2;
- if ('child' === tokens[i].value) {
- l += 1;
- } else if ('last-child' === tokens[i].value +
- tokens[i + 1].value +
- tokens[i + 2].value) {
- l += 3;
- } else if ('of-type' === tokens[i].value +
- tokens[i + 1].value +
- tokens[i + 2].value) {
- l += 3;
- } else if ('last-of-type' === tokens[i].value +
- tokens[i + 1].value +
- tokens[i + 2].value +
- tokens[i + 3].value +
- tokens[i + 4].value) {
- l += 5;
- } else return 0;
- tokens[start + 1].nthf_last = start + l - 1;
- return l;
- },
- getNthf: function() {
- pos++;
- var s = joinValues(pos, tokens[pos].nthf_last);
- pos = tokens[pos].nthf_last + 1;
- return s;
- },
- checkNthselector: function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkNthf(i)) i += l;
- else return 0;
- if (tokens[i].type !== TokenType.LeftParenthesis || !tokens[i].right) return 0;
- l++;
- var rp = tokens[i++].right;
- while (i < rp) {
- if (l = this.checkSC(i) ||
- this.checkUnary(i) ||
- this.checkNth(i)) i += l;
- else return 0;
- }
- return rp - start + 1;
- },
- getNthselector: function() {
- var startPos = pos,
- nthf = [NodeType.IdentType, this.getNthf()],
- x = [NodeType.NthselectorType];
- if (needInfo) nthf.unshift(getInfo(startPos));
- x.push(nthf);
- pos++;
- while (tokens[pos].type !== TokenType.RightParenthesis) {
- if (this.checkSC(pos)) x = x.concat(this.getSC());
- else if (this.checkUnary(pos)) x.push(this.getUnary());
- else if (this.checkNth(pos)) x.push(this.getNth());
- }
- pos++;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkNumber: function(i) {
- if (i >= tokensLength) return 0;
- if (tokens[i].number_l) return tokens[i].number_l;
- if (i < tokensLength && tokens[i].type === TokenType.DecimalNumber &&
- (!tokens[i + 1] ||
- (tokens[i + 1] && tokens[i + 1].type !== TokenType.FullStop)))
- return (tokens[i].number_l = 1, tokens[i].number_l);
- if (i < tokensLength &&
- tokens[i].type === TokenType.DecimalNumber &&
- tokens[i + 1] && tokens[i + 1].type === TokenType.FullStop &&
- (!tokens[i + 2] || (tokens[i + 2].type !== TokenType.DecimalNumber)))
- return (tokens[i].number_l = 2, tokens[i].number_l);
- if (i < tokensLength &&
- tokens[i].type === TokenType.FullStop &&
- tokens[i + 1].type === TokenType.DecimalNumber)
- return (tokens[i].number_l = 2, tokens[i].number_l);
- if (i < tokensLength &&
- tokens[i].type === TokenType.DecimalNumber &&
- tokens[i + 1] && tokens[i + 1].type === TokenType.FullStop &&
- tokens[i + 2] && tokens[i + 2].type === TokenType.DecimalNumber)
- return (tokens[i].number_l = 3, tokens[i].number_l);
- return 0;
- },
- getNumber: function() {
- var s = '',
- startPos = pos,
- l = tokens[pos].number_l,
- x = [NodeType.NumberType];
- for (var j = 0; j < l; j++) {
- s += tokens[pos + j].value;
- }
- pos += l;
- x.push(s);
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkOperator: function(i) {
- if (i >= tokensLength) return 0;
- switch(tokens[i].type) {
- case TokenType.Solidus:
- case TokenType.Comma:
- case TokenType.Colon:
- case TokenType.EqualsSign:
- return 1;
- }
- return 0;
- },
- getOperator: function() {
- var startPos = pos,
- x = [NodeType.OperatorType, tokens[pos++].value];
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkPercentage: function(i) {
- var x;
- if (i >= tokensLength) return 0;
- x = this.checkNumber(i);
- if (!x || i + x >= tokensLength) return 0;
- return tokens[i + x].type === TokenType.PercentSign ? x + 1 : 0;
- },
- getPercentage: function() {
- var startPos = pos,
- x = [NodeType.PercentageType, this.getNumber()];
- pos++;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkProgid: function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkSC(i)) i += l;
- if (joinValues2(i, 6) === 'progid:DXImageTransform.Microsoft.') i += 6;
- else return 0;
- if (l = this.checkIdent(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (tokens[i].type === TokenType.LeftParenthesis) {
- tokens[start].progid_end = tokens[i].right;
- i = tokens[i].right + 1;
- } else return 0;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- },
- getProgid: function() {
- var startPos = pos,
- progid_end = tokens[pos].progid_end,
- x;
- x = [NodeType.ProgidType]
- .concat(this.getSC())
- .concat([this._getProgid(progid_end)])
- .concat(this.getSC());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- _getProgid: function(progid_end) {
- var startPos = pos,
- x = [NodeType.RawType, joinValues(pos, progid_end)];
- pos = progid_end + 1;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkProperty: function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkIdent(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- },
- getProperty: function() {
- var startPos = pos,
- x = [NodeType.PropertyType];
- x.push(this.getIdent());
- x = x.concat(this.getSC());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkPropertyDelim: function(i) {
- return i < tokensLength && tokens[i].type === TokenType.Colon ? 1 : 0;
- },
- getPropertyDelim: function() {
- var startPos = pos,
- x = [NodeType.PropertyDelimType];
- pos++;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkPseudo: function(i) {
- return this.checkPseudoe(i) ||
- this.checkPseudoc(i);
- },
- getPseudo: function() {
- if (this.checkPseudoe(pos)) return this.getPseudoe();
- if (this.checkPseudoc(pos)) return this.getPseudoc();
- },
- checkPseudoe: function(i) {
- var l;
- if (i >= tokensLength || tokens[i++].type !== TokenType.Colon ||
- i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0;
- return (l = this.checkIdent(i)) ? l + 2 : 0;
- },
- getPseudoe: function() {
- var startPos = pos,
- x = [NodeType.PseudoeType];
- pos += 2;
- x.push(this.getIdent());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkPseudoc: function(i) {
- var l;
- if (i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0;
- return (l = this.checkFunction(i) || this.checkIdent(i)) ? l + 1 : 0;
- },
- getPseudoc: function() {
- var startPos = pos,
- x = [NodeType.PseudocType];
- pos ++;
- x.push(this.checkFunction(pos) ? this.getFunction() : this.getIdent());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkRuleset: function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (tokens[start].ruleset_l) return tokens[start].ruleset_l;
- while (i < tokensLength) {
- if (l = this.checkBlock(i)) {i += l; break;}
- else if (l = this.checkSelector(i)) i += l;
- else return 0;
- }
- tokens[start].ruleset_l = i - start;
- return i - start;
- },
- getRuleset: function() {
- var startPos = pos,
- x = [NodeType.RulesetType];
- while (pos < tokensLength) {
- if (this.checkBlock(pos)) {x.push(this.getBlock()); break;}
- else if (this.checkSelector(pos)) x.push(this.getSelector());
- else break;
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkS: function(i) {
- return i < tokensLength && tokens[i].ws ? tokens[i].ws_last - i + 1 : 0;
- },
- getS: function() {
- var startPos = pos,
- x = [NodeType.SType, joinValues(pos, tokens[pos].ws_last)];
- pos = tokens[pos].ws_last + 1;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkSC: function(i) {
- var l,
- lsc = 0;
- while (i < tokensLength) {
- if (!(l = this.checkS(i)) &&
- !(l = this.checkCommentML(i))) break;
- i += l;
- lsc += l;
- }
- return lsc || 0;
- },
- getSC: function() {
- var sc = [];
- if (pos >= tokensLength) return sc;
- while (pos < tokensLength) {
- if (this.checkS(pos)) sc.push(this.getS());
- else if (this.checkCommentML(pos)) sc.push(this.getCommentML());
- else break;
- }
- return sc;
- },
- checkSelector: function(i) {
- var start = i,
- l;
- while (i < tokensLength) {
- if (l = this.checkSimpleSelector(i) || this.checkDelim(i)) i += l;
- else break;
- }
- if (i !== start) tokens[start].selector_end = i - 1;
- return i - start;
- },
- getSelector: function() {
- var startPos = pos,
- x = [NodeType.SelectorType],
- selector_end = tokens[pos].selector_end;
- while (pos <= selector_end) {
- x.push(this.checkDelim(pos) ? this.getDelim() : this.getSimpleSelector());
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkShash: function(i) {
- var l;
- if (i >= tokensLength || tokens[i].type !== TokenType.NumberSign) return 0;
- return (l = this.checkNmName(i + 1)) ? l + 1 : 0;
- },
- getShash: function() {
- var startPos = pos,
- x = [NodeType.ShashType];
- pos++;
- x.push(this.getNmName());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkSimpleSelector: function(i) {
- var start = i,
- l;
- while (i < tokensLength) {
- if (l = this.checkSimpleSelector1(i)) i += l;
- else break;
- }
- return i - start;
- },
- getSimpleSelector: function() {
- var startPos = pos,
- x = [NodeType.SimpleselectorType],
- t;
- while (pos < tokensLength) {
- if (!this.checkSimpleSelector1(pos)) break;
- t = this.getSimpleSelector1();
- if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t);
- else x = x.concat(t);
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkSimpleSelector1: function(i) {
- return this.checkNthselector(i) ||
- this.checkCombinator(i) ||
- this.checkAttrib(i) ||
- this.checkPseudo(i) ||
- this.checkShash(i) ||
- this.checkAny(i) ||
- this.checkSC(i) ||
- this.checkNamespace(i);
- },
- getSimpleSelector1: function() {
- if (this.checkNthselector(pos)) return this.getNthselector();
- else if (this.checkCombinator(pos)) return this.getCombinator();
- else if (this.checkAttrib(pos)) return this.getAttrib();
- else if (this.checkPseudo(pos)) return this.getPseudo();
- else if (this.checkShash(pos)) return this.getShash();
- else if (this.checkAny(pos)) return this.getAny();
- else if (this.checkSC(pos)) return this.getSC();
- else if (this.checkNamespace(pos)) return this.getNamespace();
- },
- checkString: function(i) {
- return i < tokensLength && (tokens[i].type === TokenType.StringSQ || tokens[i].type === TokenType.StringDQ) ? 1 : 0;
- },
- getString: function() {
- var startPos = pos,
- x = [NodeType.StringType, tokens[pos++].value];
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkStylesheet: function(i) {
- var start = i,
- l;
- while (i < tokensLength) {
- if (l = this.checkSC(i) ||
- this.checkDeclDelim(i) ||
- this.checkAtrule(i) ||
- this.checkRuleset(i) ||
- this.checkUnknown(i)) i += l;
- else throwError(i);
- }
- return i - start;
- },
- getStylesheet: function() {
- var startPos = pos,
- x = [NodeType.StylesheetType];
- while (pos < tokensLength) {
- if (this.checkSC(pos)) x = x.concat(this.getSC());
- else if (this.checkRuleset(pos)) x.push(this.getRuleset());
- else if (this.checkAtrule(pos)) x.push(this.getAtrule());
- else if (this.checkDeclDelim(pos)) x.push(this.getDeclDelim());
- else if (this.checkUnknown(pos)) x.push(this.getUnknown());
- else throwError();
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkTset: function(i) {
- return this.checkVhash(i) ||
- this.checkAny(i) ||
- this.checkSC(i) ||
- this.checkOperator(i);
- },
- getTset: function() {
- if (this.checkVhash(pos)) return this.getVhash();
- else if (this.checkAny(pos)) return this.getAny();
- else if (this.checkSC(pos)) return this.getSC();
- else if (this.checkOperator(pos)) return this.getOperator();
- },
- checkTsets: function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- while (l = this.checkTset(i)) {
- i += l;
- }
- return i - start;
- },
- getTsets: function() {
- var x = [],
- t;
- while (t = this.getTset()) {
- if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t);
- else x = x.concat(t);
- }
- return x;
- },
- checkUnary: function(i) {
- return i < tokensLength && (tokens[i].type === TokenType.HyphenMinus || tokens[i].type === TokenType.PlusSign) ? 1 : 0;
- },
- getUnary: function() {
- var startPos = pos,
- x = [NodeType.UnaryType, tokens[pos++].value];
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkUnknown: function(i) {
- return i < tokensLength && tokens[i].type === TokenType.CommentSL ? 1 : 0;
- },
- getUnknown: function() {
- var startPos = pos,
- x = [NodeType.UnknownType, tokens[pos++].value];
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- checkUri: function(i) {
- var start = i;
- if (i >= tokensLength || tokens[i++].value !== 'url' ||
- i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis)
- return 0;
- return tokens[i].right - start + 1;
- },
- getUri: function() {
- var startPos = pos,
- uriExcluding = {},
- uri,
- l,
- raw;
- pos += 2;
- uriExcluding[TokenType.Space] = 1;
- uriExcluding[TokenType.Tab] = 1;
- uriExcluding[TokenType.Newline] = 1;
- uriExcluding[TokenType.LeftParenthesis] = 1;
- uriExcluding[TokenType.RightParenthesis] = 1;
- if (this.checkUri1(pos)) {
- uri = [NodeType.UriType]
- .concat(this.getSC())
- .concat([this.getString()])
- .concat(this.getSC());
- pos++;
- } else {
- uri = [NodeType.UriType].concat(this.getSC()),
- l = checkExcluding(uriExcluding, pos),
- raw = [NodeType.RawType, joinValues(pos, pos + l)];
- if (needInfo) raw.unshift(getInfo(startPos));
- uri.push(raw);
- pos += l + 1;
- uri = uri.concat(this.getSC());
- pos++;
- }
- return needInfo ? (uri.unshift(getInfo(startPos)), uri) : uri;
- },
- checkUri1: function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkSC(i)) i += l;
- if (tokens[i].type !== TokenType.StringDQ && tokens[i].type !== TokenType.StringSQ) return 0;
- i++;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- },
- checkValue: function(i) {
- var start = i,
- l;
- while (i < tokensLength) {
- if (l = this._checkValue(i)) i += l;
- else break;
- }
- return i - start;
- },
- _checkValue: function(i) {
- return this.checkSC(i) ||
- this.checkVhash(i) ||
- this.checkAny(i) ||
- this.checkOperator(i) ||
- this.checkImportant(i);
- },
- getValue: function() {
- var startPos = pos,
- x = [NodeType.ValueType],
- t,
- _pos;
- while (pos < tokensLength) {
- _pos = pos;
- if (!this._checkValue(pos)) break;
- t = this._getValue();
- if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t);
- else x = x.concat(t);
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- _getValue: function() {
- if (this.checkSC(pos)) return this.getSC();
- else if (this.checkVhash(pos)) return this.getVhash();
- else if (this.checkAny(pos)) return this.getAny();
- else if (this.checkOperator(pos)) return this.getOperator();
- else if (this.checkImportant(pos)) return this.getImportant();
- },
- checkVhash: function(i) {
- var l;
- if (i >= tokensLength || tokens[i].type !== TokenType.NumberSign) return 0;
- return (l = this.checkNmName2(i + 1)) ? l + 1 : 0;
- },
- getVhash: function() {
- var startPos = pos,
- x = [NodeType.VhashType];
- pos++;
- x.push(this.getNmName2());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- markSC: function() {
- var ws = -1,
- sc = -1,
- t;
- for (var i = 0; i < tokensLength; i++) {
- t = tokens[i];
- switch (t.type) {
- case TokenType.Space:
- case TokenType.Tab:
- case TokenType.Newline:
- t.ws = true;
- t.sc = true;
- if (ws === -1) ws = i;
- if (sc === -1) sc = i;
- break;
- case TokenType.CommentML:
- if (ws !== -1) {
- tokens[ws].ws_last = i - 1;
- ws = -1;
- }
- t.sc = true;
- break;
- default:
- if (ws !== -1) {
- tokens[ws].ws_last = i - 1;
- ws = -1;
- }
- if (sc !== -1) {
- tokens[sc].sc_last = i - 1;
- sc = -1;
- }
- }
- }
- if (ws !== -1) tokens[ws].ws_last = i - 1;
- if (sc !== -1) tokens[sc].sc_last = i - 1;
- },
- markBrackets: function() {
- var ps = [],
- sbs = [],
- cbs = [],
- t;
- for (var i = 0; i < tokens.length; i++) {
- t = tokens[i];
- switch(t.type) {
- case TokenType.LeftParenthesis:
- ps.push(i);
- break;
- case TokenType.RightParenthesis:
- if (ps.length) {
- t.left = ps.pop();
- tokens[t.left].right = i;
- }
- break;
- case TokenType.LeftSquareBracket:
- sbs.push(i);
- break;
- case TokenType.RightSquareBracket:
- if (sbs.length) {
- t.left = sbs.pop();
- tokens[t.left].right = i;
- }
- break;
- case TokenType.LeftCurlyBracket:
- cbs.push(i);
- break;
- case TokenType.RightCurlyBracket:
- if (cbs.length) {
- t.left = cbs.pop();
- tokens[t.left].right = i;
- }
- break;
- }
- }
- },
- parseMLComment: function(css) {
- var start = pos;
- for (pos = pos + 2; pos < css.length; pos++) {
- if (css.charAt(pos) === '*' && css.charAt(pos + 1) === '/') {
- pos++;
- break;
- }
- }
- pushToken(TokenType.CommentML, css.substring(start, pos + 1));
- },
- parseSLComment: function(css) {
- var start = pos;
- for (pos = pos + 2; pos < css.length; pos++) {
- if (css.charAt(pos) === '\n' || css.charAt(pos) === '\r') {
- break;
- }
- }
- pushToken(TokenType.CommentSL, css.substring(start, pos));
- pos--;
- }
-};
-(function() {
- var scss = Object.create(syntaxes.css);
- scss.checkAny = function(i) {
- return this.checkBraces(i) ||
- this.checkString(i) ||
- this.checkVariablesList(i) ||
- this.checkVariable(i) ||
- this.checkPlaceholder(i) ||
- this.checkPercentage(i) ||
- this.checkDimension(i) ||
- this.checkNumber(i) ||
- this.checkUri(i) ||
- this.checkFunctionExpression(i) ||
- this.checkFunction(i) ||
- this.checkIdent(i) ||
- this.checkClass(i) ||
- this.checkUnary(i);
- };
- scss.getAny = function() {
- if (this.checkBraces(pos)) return this.getBraces();
- else if (this.checkString(pos)) return this.getString();
- else if (this.checkVariablesList(pos)) return this.getVariablesList();
- else if (this.checkVariable(pos)) return this.getVariable();
- else if (this.checkPlaceholder(pos)) return this.getPlaceholder();
- else if (this.checkPercentage(pos)) return this.getPercentage();
- else if (this.checkDimension(pos)) return this.getDimension();
- else if (this.checkNumber(pos)) return this.getNumber();
- else if (this.checkUri(pos)) return this.getUri();
- else if (this.checkFunctionExpression(pos)) return this.getFunctionExpression();
- else if (this.checkFunction(pos)) return this.getFunction();
- else if (this.checkIdent(pos)) return this.getIdent();
- else if (this.checkClass(pos)) return this.getClass();
- else if (this.checkUnary(pos)) return this.getUnary();
- };
- scss.checkArguments = function (i) {
- var start = i,
- l;
- if (i >= tokensLength ||
- tokens[i].type !== TokenType.LeftParenthesis) return 0;
- i++;
- while (i < tokens[start].right) {
- if (l = this.checkArgument(i)) i +=l;
- else return 0;
- }
- return tokens[start].right - start + 1;
- };
- scss.getArguments = function() {
- var startPos = pos,
- arguments = [],
- x;
- pos++;
- while (x = this.getArgument()) {
- if ((needInfo && typeof x[1] === 'string') || typeof x[0] === 'string') arguments.push(x);
- else arguments = arguments.concat(x);
- }
- pos++;
- x = [NodeType.ArgumentsType].concat(arguments);
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkArgument = function(i) {
- return this.checkDeclaration(i) ||
- this.checkVariablesList(i) ||
- this.checkVariable(i) ||
- this.checkSC(i) ||
- this.checkDelim(i) ||
- this.checkDeclDelim(i) ||
- this.checkString(i) ||
- this.checkPercentage(i) ||
- this.checkDimension(i) ||
- this.checkNumber(i) ||
- this.checkUri(i) ||
- this.checkIdent(i) ||
- this.checkVhash(i);
- };
- scss.getArgument = function() {
- if (this.checkDeclaration(pos)) return this.getDeclaration();
- else if (this.checkVariablesList(pos)) return this.getVariablesList();
- else if (this.checkVariable(pos)) return this.getVariable();
- else if (this.checkSC(pos)) return this.getSC();
- else if (this.checkDelim(pos)) return this.getDelim();
- else if (this.checkDeclDelim(pos)) return this.getDeclDelim();
- else if (this.checkString(pos)) return this.getString();
- else if (this.checkPercentage(pos)) return this.getPercentage();
- else if (this.checkDimension(pos)) return this.getDimension();
- else if (this.checkNumber(pos)) return this.getNumber();
- else if (this.checkUri(pos)) return this.getUri();
- else if (this.checkIdent(pos)) return this.getIdent();
- else if (this.checkVhash(pos)) return this.getVhash();
- };
- scss.checkBlockdecl1 = function(i) {
- var start = i,
- l;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkCondition(i)) tokens[i].bd_kind = 1;
- else if (l = this.checkInclude(i)) tokens[i].bd_kind = 2;
- else if (l = this.checkLoop(i)) tokens[i].bd_kind = 3;
- else if (l = this.checkFilter(i)) tokens[i].bd_kind = 4;
- else if (l = this.checkDeclaration(i)) tokens[i].bd_kind = 5;
- else if (l = this.checkAtrule(i)) tokens[i].bd_kind = 6;
- else if (l = this.checkRuleset(i)) tokens[i].bd_kind = 7;
- else return 0;
- i += l;
- if (i < tokensLength && (l = this.checkDeclDelim(i))) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- else return 0;
- return i - start;
- };
- scss.getBlockdecl1 = function() {
- var sc = this.getSC(),
- x;
- switch (tokens[pos].bd_kind) {
- case 1:
- x = this.getCondition();
- break;
- case 2:
- x = this.getInclude();
- break;
- case 3:
- x = this.getLoop();
- break;
- case 4:
- x = this.getFilter();
- break;
- case 5:
- x = this.getDeclaration();
- break;
- case 6:
- x = this.getAtrule();
- break;
- case 7:
- x = this.getRuleset();
- break;
- }
- return sc
- .concat([x])
- .concat([this.getDeclDelim()])
- .concat(this.getSC());
- };
- scss.checkBlockdecl2 = function(i) {
- var start = i,
- l;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkCondition(i)) tokens[i].bd_kind = 1;
- else if (l = this.checkInclude(i)) tokens[i].bd_kind = 2;
- else if (l = this.checkLoop(i)) tokens[i].bd_kind = 3;
- else if (l = this.checkFilter(i)) tokens[i].bd_kind = 4;
- else if (l = this.checkDeclaration(i)) tokens[i].bd_kind = 5;
- else if (l = this.checkAtrule(i)) tokens[i].bd_kind = 6;
- else if (l = this.checkRuleset(i)) tokens[i].bd_kind = 7;
- else return 0;
- i += l;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- };
- scss.getBlockdecl2 = function() {
- var sc = this.getSC(),
- x;
- switch (tokens[pos].bd_kind) {
- case 1:
- x = this.getCondition();
- break;
- case 2:
- x = this.getInclude();
- break;
- case 3:
- x = this.getLoop();
- break;
- case 4:
- x = this.getFilter();
- break;
- case 5:
- x = this.getDeclaration();
- break;
- case 6:
- x = this.getAtrule();
- break;
- case 7:
- x = this.getRuleset();
- break;
- }
- return sc
- .concat([x])
- .concat(this.getSC());
- };
- scss.checkClass = function(i) {
- var l;
- if (i >= tokensLength) return 0;
- if (tokens[i].class_l) return tokens[i].class_l;
- if (tokens[i++].type === TokenType.FullStop &&
- (l = this.checkInterpolatedVariable(i) || this.checkIdent(i))) {
- tokens[i].class_l = l + 1;
- return l + 1;
- }
- return 0;
- };
- scss.getClass = function() {
- var startPos = pos,
- x = [NodeType.ClassType];
- pos++;
- x.push(this.checkInterpolatedVariable(pos) ? this.getInterpolatedVariable() : this.getIdent());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkCommentSL = function(i) {
- return i < tokensLength && tokens[i].type === TokenType.CommentSL ? 1 : 0;
- };
- scss.getCommentSL = function() {
- var startPos = pos,
- x;
- x = [NodeType.CommentSLType, tokens[pos++].value.substring(2)];
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkCondition = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkAtkeyword(i)) i += l;
- else return 0;
- if (['if', 'else'].indexOf(tokens[start + 1].value) < 0) return 0;
- while (i < tokensLength) {
- if (l = this.checkBlock(i)) break;
- else if (l = this.checkVariable(i) ||
- this.checkIdent(i) ||
- this.checkSC(i) ||
- this.checkNumber(i) ||
- this.checkOperator(i) ||
- this.checkCombinator(i) ||
- this.checkString(i)) i += l;
- else return 0;
- }
- return i - start;
- };
- scss.getCondition = function() {
- var startPos = pos,
- x = [NodeType.ConditionType];
- x.push(this.getAtkeyword());
- while (pos < tokensLength) {
- if (this.checkBlock(pos)) break;
- else if (this.checkVariable(pos)) x.push(this.getVariable());
- else if (this.checkIdent(pos)) x.push(this.getIdent());
- else if (this.checkNumber(pos)) x.push(this.getNumber());
- else if (this.checkOperator(pos)) x.push(this.getOperator());
- else if (this.checkCombinator(pos)) x.push(this.getCombinator());
- else if (this.checkSC(pos)) x = x.concat(this.getSC());
- else if (this.checkString(pos)) x.push(this.getString());
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkDefault = function(i) {
- var start = i,
- l;
- if (i >= tokensLength ||
- tokens[i++].type !== TokenType.ExclamationMark) return 0;
- if (l = this.checkSC(i)) i += l;
- return tokens[i].value === 'default' ? i - start + 1 : 0;
- };
- scss.getDefault = function() {
- var startPos = pos,
- x = [NodeType.DefaultType],
- sc;
- pos++;
- sc = this.getSC();
- pos++;
- x = x.concat(sc);
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkIdent = function(i) {
- var start = i,
- wasIdent,
- l;
- if (i >= tokensLength) return 0;
- if (tokens[i].type === TokenType.LowLine) return this.checkIdentLowLine(i);
- if (tokens[i].type === TokenType.HyphenMinus ||
- tokens[i].type === TokenType.Identifier ||
- tokens[i].type === TokenType.DollarSign ||
- tokens[i].type === TokenType.Asterisk) i++;
- else return 0;
- wasIdent = tokens[i - 1].type === TokenType.Identifier;
- for (; i < tokensLength; i++) {
- if (l = this.checkInterpolatedVariable(i)) i += l;
- if (i >= tokensLength) break;
- if (tokens[i].type !== TokenType.HyphenMinus &&
- tokens[i].type !== TokenType.LowLine) {
- if (tokens[i].type !== TokenType.Identifier &&
- (tokens[i].type !== TokenType.DecimalNumber || !wasIdent)) break;
- else wasIdent = true;
- }
- }
- if (!wasIdent && tokens[start].type !== TokenType.Asterisk) return 0;
- tokens[start].ident_last = i - 1;
- return i - start;
- };
- scss.checkInclude = function(i) {
- var l;
- if (i >= tokensLength) return 0;
- if (l = this.checkInclude1(i)) tokens[i].include_type = 1;
- else if (l = this.checkInclude2(i)) tokens[i].include_type = 2;
- else if (l = this.checkInclude3(i)) tokens[i].include_type = 3;
- else if (l = this.checkInclude4(i)) tokens[i].include_type = 4;
- return l;
- };
- scss.getInclude = function() {
- switch (tokens[pos].include_type) {
- case 1: return this.getInclude1();
- case 2: return this.getInclude2();
- case 3: return this.getInclude3();
- case 4: return this.getInclude4();
- }
- };
- scss.checkInclude1 = function(i) {
- var start = i,
- l;
- if (l = this.checkAtkeyword(i)) i += l;
- else return 0;
- if (['include', 'extend'].indexOf(tokens[start + 1].value) < 0) return 0;
- if (l = this.checkSC(i)) i += l;
- else return 0;
- if (l = this.checkIncludeSelector(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkArguments(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkBlock(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- };
- scss.getInclude1 = function() {
- var startPos = pos,
- x = [NodeType.IncludeType];
- x.push(this.getAtkeyword());
- x = x.concat(this.getSC());
- x.push(this.getIncludeSelector());
- x = x.concat(this.getSC());
- x.push(this.getArguments());
- x = x.concat(this.getSC());
- x.push(this.getBlock());
- x = x.concat(this.getSC());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkInclude2 = function(i) {
- var start = i,
- l;
- if (l = this.checkAtkeyword(i)) i += l;
- else return 0;
- if (['include', 'extend'].indexOf(tokens[start + 1].value) < 0) return 0;
- if (l = this.checkSC(i)) i += l;
- else return 0;
- if (l = this.checkIncludeSelector(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkArguments(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- };
- scss.getInclude2 = function() {
- var startPos = pos,
- x = [NodeType.IncludeType];
- x.push(this.getAtkeyword());
- x = x.concat(this.getSC());
- x.push(this.getIncludeSelector());
- x = x.concat(this.getSC());
- x.push(this.getArguments());
- x = x.concat(this.getSC());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkInclude3 = function(i) {
- var start = i,
- l;
- if (l = this.checkAtkeyword(i)) i += l;
- else return 0;
- if (['include', 'extend'].indexOf(tokens[start + 1].value) < 0) return 0;
- if (l = this.checkSC(i)) i += l;
- else return 0;
- if (l = this.checkIncludeSelector(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkBlock(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- };
- scss.getInclude3 = function() {
- var startPos = pos,
- x = [NodeType.IncludeType];
- x.push(this.getAtkeyword());
- x = x.concat(this.getSC());
- x.push(this.getIncludeSelector());
- x = x.concat(this.getSC());
- x.push(this.getBlock());
- x = x.concat(this.getSC());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkInclude4 = function(i) {
- var start = i,
- l;
- if (l = this.checkAtkeyword(i)) i += l;
- else return 0;
- if (['include', 'extend'].indexOf(tokens[start + 1].value) < 0) return 0;
- if (l = this.checkSC(i)) i += l;
- else return 0;
- if (l = this.checkIncludeSelector(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- };
- scss.getInclude4 = function() {
- var startPos = pos,
- x = [NodeType.IncludeType];
- x.push(this.getAtkeyword());
- x = x.concat(this.getSC());
- x.push(this.getIncludeSelector());
- x = x.concat(this.getSC());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkIncludeSelector = function(i) {
- var start = i,
- l;
- while (i < tokensLength) {
- if (l = this.checkSimpleSelector2(i)) i += l;
- else break;
- }
- return i - start;
- };
- scss.getIncludeSelector = function() {
- var startPos = pos,
- x = [NodeType.SimpleselectorType],
- t;
- while (pos < tokensLength && this.checkSimpleSelector2(pos)) {
- t = this.getSimpleSelector2();
- if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t);
- else x = x.concat(t);
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkInterpolatedVariable = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (tokens[i].type !== TokenType.NumberSign ||
- !tokens[i + 1] || tokens[i + 1].type !== TokenType.LeftCurlyBracket ||
- !tokens[i + 2] || tokens[i + 2].type !== TokenType.DollarSign) return 0;
- i += 3;
- if (l = this.checkIdent(i)) i += l;
- else return 0;
- return tokens[i].type === TokenType.RightCurlyBracket ? i - start + 1 : 0;
- };
- scss.getInterpolatedVariable = function() {
- var startPos = pos,
- x = [NodeType.InterpolatedVariableType];
- pos += 3;
- x.push(this.getIdent());
- pos++;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkLoop = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkAtkeyword(i)) i += l;
- else return 0;
- if (['for', 'each', 'while'].indexOf(tokens[start + 1].value) < 0) return 0;
- while (i < tokensLength) {
- if (l = this.checkBlock(i)) {
- i += l;
- break;
- } else if (l = this.checkVariable(i) ||
- this.checkIdent(i) ||
- this.checkSC(i) ||
- this.checkNumber(i) ||
- this.checkOperator(i) ||
- this.checkCombinator(i) ||
- this.checkString(i)) i += l;
- else return 0;
- }
- return i - start;
- };
- scss.getLoop = function() {
- var startPos = pos,
- x = [NodeType.LoopType];
- x.push(this.getAtkeyword());
- while (pos < tokensLength) {
- if (this.checkBlock(pos)) {
- x.push(this.getBlock());
- break;
- }
- else if (this.checkVariable(pos)) x.push(this.getVariable());
- else if (this.checkIdent(pos)) x.push(this.getIdent());
- else if (this.checkNumber(pos)) x.push(this.getNumber());
- else if (this.checkOperator(pos)) x.push(this.getOperator());
- else if (this.checkCombinator(pos)) x.push(this.getCombinator());
- else if (this.checkSC(pos)) x = x.concat(this.getSC());
- else if (this.checkString(pos)) x.push(this.getString());
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkMixin = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if ((l = this.checkAtkeyword(i)) && tokens[i + 1].value === 'mixin') i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkIdent(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkArguments(i)) i += l;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkBlock(i)) i += l;
- else return 0;
- return i - start;
- };
- scss.getMixin = function() {
- var startPos = pos,
- x = [NodeType.MixinType, this.getAtkeyword()];
- x = x.concat(this.getSC());
- if (this.checkIdent(pos)) x.push(this.getIdent());
- x = x.concat(this.getSC());
- if (this.checkArguments(pos)) x.push(this.getArguments());
- x = x.concat(this.getSC());
- if (this.checkBlock(pos)) x.push(this.getBlock());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkOperator = function(i) {
- if (i >= tokensLength) return 0;
- switch(tokens[i].type) {
- case TokenType.Solidus:
- case TokenType.Comma:
- case TokenType.Colon:
- case TokenType.EqualsSign:
- case TokenType.LessThanSign:
- case TokenType.GreaterThanSign:
- case TokenType.Asterisk:
- return 1;
- }
- return 0;
- };
- scss.checkParentSelector = function(i) {
- return i < tokensLength && tokens[i].type === TokenType.Ampersand ? 1 : 0;
- };
- scss.getParentSelector = function() {
- var startPos = pos,
- x = [NodeType.ParentSelectorType, '&'];
- pos++;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkPlaceholder = function(i) {
- var l;
- if (i >= tokensLength) return 0;
- if (tokens[i].placeholder_l) return tokens[i].placeholder_l;
- if (tokens[i].type === TokenType.PercentSign && (l = this.checkIdent(i + 1))) {
- tokens[i].placeholder_l = l + 1;
- return l + 1;
- } else return 0;
- };
- scss.getPlaceholder = function() {
- var startPos = pos,
- x = [NodeType.PlaceholderType];
- pos++;
- x.push(this.getIdent());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkProperty = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkVariable(i) || this.checkIdent(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- };
- scss.getProperty = function() {
- var startPos = pos,
- x = [NodeType.PropertyType];
- x.push(this.checkVariable(pos) ? this.getVariable() : this.getIdent());
- x = x.concat(this.getSC());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkPseudoe = function(i) {
- var l;
- if (i >= tokensLength || tokens[i++].type !== TokenType.Colon ||
- i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0;
- return (l = this.checkInterpolatedVariable(i) || this.checkIdent(i)) ? l + 2 : 0;
- };
- scss.getPseudoe = function() {
- var startPos = pos,
- x = [NodeType.PseudoeType];
- pos += 2;
- x.push(this.checkInterpolatedVariable(pos) ? this.getInterpolatedVariable() : this.getIdent());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkPseudoc = function(i) {
- var l;
- if (i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0;
- return (l = this.checkInterpolatedVariable(i) || this.checkFunction(i) || this.checkIdent(i)) ? l + 1 : 0;
- };
- scss.getPseudoc = function() {
- var startPos = pos,
- x = [NodeType.PseudocType];
- pos ++;
- if (this.checkInterpolatedVariable(pos)) x.push(this.getInterpolatedVariable());
- else if (this.checkFunction(pos)) x.push(this.getFunction());
- else x.push(this.getIdent());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkSC = function(i) {
- if (i >= tokensLength) return 0;
- var l,
- lsc = 0,
- ln = tokens[i].ln;
- while (i < tokensLength) {
- if (!(l = this.checkS(i)) &&
- !(l = this.checkCommentML(i)) &&
- !(l = this.checkCommentSL(i))) break;
- i += l;
- lsc += l;
- }
- return lsc || 0;
- };
- scss.getSC = function() {
- var sc = [];
- if (pos >= tokensLength) return sc;
- while (pos < tokensLength) {
- if (this.checkS(pos)) sc.push(this.getS());
- else if (this.checkCommentML(pos)) sc.push(this.getCommentML());
- else if (this.checkCommentSL(pos)) sc.push(this.getCommentSL());
- else break;
- }
- return sc;
- };
- scss.checkSimpleSelector1 = function(i) {
- return this.checkParentSelector(i) ||
- this.checkNthselector(i) ||
- this.checkCombinator(i) ||
- this.checkAttrib(i) ||
- this.checkPseudo(i) ||
- this.checkShash(i) ||
- this.checkAny(i) ||
- this.checkSC(i) ||
- this.checkNamespace(i);
- };
- scss.getSimpleSelector1 = function() {
- if (this.checkParentSelector(pos)) return this.getParentSelector();
- else if (this.checkNthselector(pos)) return this.getNthselector();
- else if (this.checkCombinator(pos)) return this.getCombinator();
- else if (this.checkAttrib(pos)) return this.getAttrib();
- else if (this.checkPseudo(pos)) return this.getPseudo();
- else if (this.checkShash(pos)) return this.getShash();
- else if (this.checkAny(pos)) return this.getAny();
- else if (this.checkSC(pos)) return this.getSC();
- else if (this.checkNamespace(pos)) return this.getNamespace();
- };
- scss.checkSimpleSelector2 = function(i) {
- return this.checkParentSelector(i) ||
- this.checkNthselector(i) ||
- this.checkAttrib(i) ||
- this.checkPseudo(i) ||
- this.checkShash(i) ||
- this.checkPlaceholder(i) ||
- this.checkIdent(i) ||
- this.checkClass(i);
- };
- scss.getSimpleSelector2 = function() {
- if (this.checkParentSelector(pos)) return this.getParentSelector();
- else if (this.checkNthselector(pos)) return this.getNthselector();
- else if (this.checkAttrib(pos)) return this.getAttrib();
- else if (this.checkPseudo(pos)) return this.getPseudo();
- else if (this.checkShash(pos)) return this.getShash();
- else if (this.checkPlaceholder(pos)) return this.getPlaceholder();
- else if (this.checkIdent(pos)) return this.getIdent();
- else if (this.checkClass(pos)) return this.getClass();
- };
- scss.checkStylesheet = function(i) {
- var start = i,
- l;
- while (i < tokensLength) {
- if (l = this.checkSC(i) ||
- this.checkDeclaration(i) ||
- this.checkDeclDelim(i) ||
- this.checkInclude(i) ||
- this.checkMixin(i) ||
- this.checkLoop(i) ||
- this.checkAtrule(i) ||
- this.checkRuleset(i)) i += l;
- else throwError(i);
- }
- return i - start;
- };
- scss.getStylesheet = function() {
- var startPos = pos,
- x = [NodeType.StylesheetType];
- while (pos < tokensLength) {
- if (this.checkSC(pos)) x = x.concat(this.getSC());
- else if (this.checkRuleset(pos)) x.push(this.getRuleset());
- else if (this.checkInclude(pos)) x.push(this.getInclude());
- else if (this.checkMixin(pos)) x.push(this.getMixin());
- else if (this.checkLoop(pos)) x.push(this.getLoop());
- else if (this.checkAtrule(pos)) x.push(this.getAtrule());
- else if (this.checkDeclaration(pos)) x.push(this.getDeclaration());
- else if (this.checkDeclDelim(pos)) x.push(this.getDeclDelim());
- else throwError();
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkValue = function(i) {
- var start = i,
- l;
- while (i < tokensLength) {
- if (l = this._checkValue(i)) i += l;
- if (!l || this.checkBlock(i - l)) break;
- }
- return i - start;
- };
- scss._checkValue = function(i) {
- return this.checkSC(i) ||
- this.checkInterpolatedVariable(i) ||
- this.checkVariable(i) ||
- this.checkVhash(i) ||
- this.checkBlock(i) ||
- this.checkAny(i) ||
- this.checkAtkeyword(i) ||
- this.checkOperator(i) ||
- this.checkImportant(i) ||
- this.checkDefault(i);
- };
- scss.getValue = function() {
- var startPos = pos,
- x = [NodeType.ValueType],
- t, _pos;
- while (pos < tokensLength) {
- _pos = pos;
- if (!this._checkValue(pos)) break;
- t = this._getValue();
- if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t);
- else x = x.concat(t);
- if (this.checkBlock(_pos)) break;
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss._getValue = function() {
- if (this.checkSC(pos)) return this.getSC();
- else if (this.checkInterpolatedVariable(pos)) return this.getInterpolatedVariable();
- else if (this.checkVariable(pos)) return this.getVariable();
- else if (this.checkVhash(pos)) return this.getVhash();
- else if (this.checkBlock(pos)) return this.getBlock();
- else if (this.checkAny(pos)) return this.getAny();
- else if (this.checkAtkeyword(pos)) return this.getAtkeyword();
- else if (this.checkOperator(pos)) return this.getOperator();
- else if (this.checkImportant(pos)) return this.getImportant();
- else if (this.checkDefault(pos)) return this.getDefault();
- };
- scss.checkVariable = function(i) {
- var l;
- if (i >= tokensLength || tokens[i].type !== TokenType.DollarSign) return 0;
- return (l = this.checkIdent(i + 1)) ? l + 1 : 0;
- };
- scss.getVariable = function() {
- var startPos = pos,
- x = [NodeType.VariableType];
- pos++;
- x.push(this.getIdent());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.checkVariablesList = function(i) {
- var d = 0,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkVariable(i)) i+= l;
- else return 0;
- while (i < tokensLength && tokens[i].type === TokenType.FullStop) {
- d++;
- i++;
- }
- return d === 3 ? l + d : 0;
- };
- scss.getVariablesList = function() {
- var startPos = pos,
- x = [NodeType.VariablesListType, this.getVariable()];
- pos += 3;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- scss.markSC = function() {
- var ws = -1,
- sc = -1,
- t;
- for (var i = 0; i < tokensLength; i++) {
- t = tokens[i];
- switch (t.type) {
- case TokenType.Space:
- case TokenType.Tab:
- case TokenType.Newline:
- t.ws = true;
- t.sc = true;
- if (ws === -1) ws = i;
- if (sc === -1) sc = i;
- break;
- case TokenType.CommentML:
- case TokenType.CommentSL:
- if (ws !== -1) {
- tokens[ws].ws_last = i - 1;
- ws = -1;
- }
- t.sc = true;
- break;
- default:
- if (ws !== -1) {
- tokens[ws].ws_last = i - 1;
- ws = -1;
- }
- if (sc !== -1) {
- tokens[sc].sc_last = i - 1;
- sc = -1;
- }
- }
- }
- if (ws !== -1) tokens[ws].ws_last = i - 1;
- if (sc !== -1) tokens[sc].sc_last = i - 1;
- };
- syntaxes.scss = scss;
-})();
-(function() {
- var sass = Object.create(syntaxes.scss);
- sass.checkBlock = function(i) {
- return i < tokensLength && tokens[i].block_end ?
- tokens[i].block_end - i + 1 : 0;
- };
- sass.getBlock = function() {
- var startPos = pos,
- end = tokens[pos].block_end,
- x = [NodeType.BlockType];
- while (pos < end) {
- if (this.checkBlockdecl(pos)) x = x.concat(this.getBlockdecl());
- else throwError();
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- sass.getCommentML = function() {
- var startPos = pos,
- s = tokens[pos].value.substring(2),
- l = s.length,
- x;
- pos++;
- x = [NodeType.CommentMLType, s];
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- sass.checkDeclaration = function(i) {
- return this.checkDeclaration1(i) || this.checkDeclaration2(i);
- };
- sass.getDeclaration = function() {
- return this.checkDeclaration1(pos) ? this.getDeclaration1() : this.getDeclaration2();
- };
- sass.checkDeclaration1 = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkProperty(i)) i += l;
- else return 0;
- if (l = this.checkPropertyDelim(i)) i++;
- else return 0;
- if (l = this.checkValue(i)) i += l;
- else return 0;
- return i - start;
- };
- sass.getDeclaration1 = function() {
- var startPos = pos,
- x = [NodeType.DeclarationType];
- x.push(this.getProperty());
- x.push(this.getPropertyDelim());
- x.push(this.getValue());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- sass.checkDeclaration2 = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkPropertyDelim(i)) i++;
- else return 0;
- if (l = this.checkProperty(i)) i += l;
- else return 0;
- if (l = this.checkValue(i)) i += l;
- else return 0;
- return i - start;
- };
- sass.getDeclaration2 = function() {
- var startPos = pos,
- x = [NodeType.DeclarationType];
- x.push(this.getPropertyDelim());
- x.push(this.getProperty());
- x.push(this.getValue());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- sass.checkDeclDelim = function(i) {
- if (i >= tokensLength) return 0;
- return (tokens[i].type === TokenType.Newline ||
- tokens[i].type === TokenType.Semicolon) ? 1 : 0;
- };
- sass.checkFilterv = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkProgid(i)) i += l;
- else return 0;
- while (l = this.checkProgid(i)) {
- i += l;
- }
- tokens[start].last_progid = i;
- if (this.checkDeclDelim(i)) return i - start;
- if (i < tokensLength && (l = this.checkSC(i))) i += l;
- if (i < tokensLength && (l = this.checkImportant(i))) i += l;
- return i - start;
- };
- sass.getFilterv = function() {
- var startPos = pos,
- x = [NodeType.FiltervType],
- last_progid = tokens[pos].last_progid;
- while (pos < last_progid) {
- x.push(this.getProgid());
- }
- if (this.checkDeclDelim(pos)) return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- if (this.checkSC(pos)) x = x.concat(this.getSC());
- if (pos < tokensLength && this.checkImportant(pos)) x.push(this.getImportant());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- sass.checkInclude = function(i) {
- var l;
- if (i >= tokensLength) return 0;
- if (l = this.checkInclude1(i)) tokens[i].include_type = 1;
- else if (l = this.checkInclude2(i)) tokens[i].include_type = 2;
- else if (l = this.checkInclude3(i)) tokens[i].include_type = 3;
- else if (l = this.checkInclude4(i)) tokens[i].include_type = 4;
- else if (l = this.checkInclude5(i)) tokens[i].include_type = 5;
- else if (l = this.checkInclude6(i)) tokens[i].include_type = 6;
- else if (l = this.checkInclude7(i)) tokens[i].include_type = 7;
- else if (l = this.checkInclude8(i)) tokens[i].include_type = 8;
- return l;
- };
- sass.getInclude = function() {
- switch (tokens[pos].include_type) {
- case 1: return this.getInclude1();
- case 2: return this.getInclude2();
- case 3: return this.getInclude3();
- case 4: return this.getInclude4();
- case 5: return this.getInclude5();
- case 6: return this.getInclude6();
- case 7: return this.getInclude7();
- case 8: return this.getInclude8();
- }
- };
- sass.checkInclude5 = function(i) {
- var start = i,
- l;
- if (tokens[i].type === TokenType.PlusSign) i++;
- else return 0;
- if (l = this.checkIncludeSelector(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkArguments(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkBlock(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- };
- sass.getInclude5 = function() {
- var startPos = pos,
- x = [NodeType.IncludeType];
- x.push(this.getOperator());
- x.push(this.getIncludeSelector());
- x = x.concat(this.getSC());
- x.push(this.getArguments());
- x = x.concat(this.getSC());
- x.push(this.getBlock());
- x = x.concat(this.getSC());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- sass.checkInclude6 = function(i) {
- var start = i,
- l;
- if (tokens[i].type === TokenType.PlusSign) i++;
- else return 0;
- if (l = this.checkIncludeSelector(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkArguments(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- };
- sass.getInclude6 = function() {
- var startPos = pos,
- x = [NodeType.IncludeType];
- x.push(this.getOperator());
- x.push(this.getIncludeSelector());
- x = x.concat(this.getSC());
- x.push(this.getArguments());
- x = x.concat(this.getSC());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- sass.checkInclude7 = function(i) {
- var start = i,
- l;
- if (tokens[i].type === TokenType.PlusSign) i++;
- else return 0;
- if (l = this.checkIncludeSelector(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkBlock(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- };
- sass.getInclude7 = function() {
- var startPos = pos,
- x = [NodeType.IncludeType];
- x.push(this.getOperator());
- x.push(this.getIncludeSelector());
- x = x.concat(this.getSC());
- x.push(this.getBlock());
- x = x.concat(this.getSC());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- sass.checkInclude8 = function(i) {
- var start = i,
- l;
- if (tokens[i].type === TokenType.PlusSign) i++;
- else return 0;
- if (l = this.checkIncludeSelector(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- };
- sass.getInclude8 = function() {
- var startPos = pos,
- x = [NodeType.IncludeType];
- x.push(this.getOperator());
- x.push(this.getIncludeSelector());
- x = x.concat(this.getSC());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- sass.checkMixin = function(i) {
- return this.checkMixin1(i) || this.checkMixin2(i);
- };
- sass.getMixin = function() {
- return this.checkMixin1(pos) ? this.getMixin1() : this.getMixin2();
- };
- sass.checkMixin1 = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if ((l = this.checkAtkeyword(i)) && tokens[i + 1].value === 'mixin') i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkIdent(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkBlock(i)) i += l;
- else {
- if (l = this.checkArguments(i)) i += l;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkBlock(i)) i += l;
- else return 0;
- }
- return i - start;
- };
- sass.getMixin1 = function() {
- var startPos = pos,
- x = [NodeType.MixinType, this.getAtkeyword()];
- x = x.concat(this.getSC());
- if (this.checkIdent(pos)) x.push(this.getIdent());
- x = x.concat(this.getSC());
- if (this.checkBlock(pos)) x.push(this.getBlock());
- else {
- if (this.checkArguments(pos)) x.push(this.getArguments());
- x = x.concat(this.getSC());
- x.push(this.getBlock());
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- sass.checkMixin2 = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (tokens[i].type === TokenType.EqualsSign) i++;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkIdent(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkBlock(i)) i += l;
- else {
- if (l = this.checkArguments(i)) i += l;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkBlock(i)) i += l;
- else return 0;
- }
- return i - start;
- };
- sass.getMixin2 = function() {
- var startPos = pos,
- x = [NodeType.MixinType, this.getOperator()];
- x = x.concat(this.getSC());
- if (this.checkIdent(pos)) x.push(this.getIdent());
- x = x.concat(this.getSC());
- if (this.checkBlock(pos)) x.push(this.getBlock());
- else {
- if (this.checkArguments(pos)) x.push(this.getArguments());
- x = x.concat(this.getSC());
- x.push(this.getBlock());
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- sass.checkProgid = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkSC(i)) i += l;
- if (joinValues2(i, 6) === 'progid:DXImageTransform.Microsoft.') i += 6;
- else return 0;
- if (l = this.checkIdent(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (tokens[i].type === TokenType.LeftParenthesis) {
- tokens[start].progid_end = tokens[i].right;
- i = tokens[i].right + 1;
- } else return 0;
- return i - start;
- };
- sass.getProgid = function() {
- var startPos = pos,
- progid_end = tokens[pos].progid_end,
- x;
- x = [NodeType.ProgidType]
- .concat(this.getSC())
- .concat([this._getProgid(progid_end)]);
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- sass.checkSC = function(i) {
- if (!tokens[i]) return 0;
- var l,
- lsc = 0,
- ln = tokens[i].ln;
- while (i < tokensLength) {
- if (tokens[i].ln !== ln) break;
- if (!(l = this.checkS(i)) &&
- !(l = this.checkCommentML(i)) &&
- !(l = this.checkCommentSL(i))) break;
- i += l;
- lsc += l;
- }
- return lsc || 0;
- };
- sass.getSC = function() {
- var sc = [],
- ln;
- if (pos >= tokensLength) return sc;
- ln = tokens[pos].ln;
- while (pos < tokensLength) {
- if (tokens[pos].ln !== ln) break;
- else if (this.checkS(pos)) sc.push(this.getS());
- else if (this.checkCommentML(pos)) sc.push(this.getCommentML());
- else if (this.checkCommentSL(pos)) sc.push(this.getCommentSL());
- else break;
- }
- return sc;
- };
- sass.checkSelector = function(i) {
- var start = i,
- l, ln;
- if (i >= tokensLength) return 0;
- ln = tokens[i].ln;
- while (i < tokensLength) {
- if (tokens[i].ln !== ln) break;
- if ((l = this.checkDeclDelim(i) && this.checkBlock(i + l)) || this.checkSC(i)) i += l;
- if (l = this.checkSimpleSelector(i) || this.checkDelim(i)) i += l;
- else break;
- }
- tokens[start].selector_end = i - 1;
- return i - start;
- };
- sass.getSelector = function() {
- var startPos = pos,
- x = [NodeType.SelectorType],
- selector_end = tokens[pos].selector_end,
- ln = tokens[pos].ln;
- while (pos <= selector_end) {
- if (tokens[pos].ln !== ln) break;
- if ((l = this.checkDeclDelim(pos)) && this.checkBlock(pos + l)) x.push(this.getDeclDelim());
- else if (this.checkSC(pos)) x = x.concat(this.getSC());
- x.push(this.checkDelim(pos) ? this.getDelim() : this.getSimpleSelector());
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- sass.checkSimpleSelector = function(i) {
- if (i >= tokensLength) return 0;
- var start = i,
- l,
- ln = tokens[i].ln;
- while (i < tokensLength) {
- if (tokens[i].ln !== ln) break;
- if (l = this.checkSimpleSelector1(i)) i += l;
- else break;
- }
- return (i - start) || 0;
- };
- sass.getSimpleSelector = function() {
- var startPos = pos,
- x = [NodeType.SimpleselectorType],
- t,
- ln = tokens[pos].ln;
- while (pos < tokensLength) {
- if (tokens[pos].ln !== ln ||
- !this.checkSimpleSelector1(pos)) break;
- t = this.getSimpleSelector1();
- if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t);
- else x = x.concat(t);
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- sass.checkValue = function(i) {
- var start = i,
- l;
- while (i < tokensLength) {
- if (this.checkDeclDelim(i)) break;
- if (l = this._checkValue(i)) i += l;
- if (!l || this.checkBlock(i - l)) break;
- }
- return i - start;
- };
- sass.getValue = function() {
- var startPos = pos,
- x = [NodeType.ValueType],
- t, _pos;
- while (pos < tokensLength) {
- _pos = pos;
- if (this.checkDeclDelim(pos)) break;
- if (!this._checkValue(pos)) break;
- t = this._getValue();
- if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t);
- else x = x.concat(t);
- if (this.checkBlock(_pos)) break;
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- sass._checkValue = function(i) {
- return this.checkS(i) ||
- this.checkCommentML(i) ||
- this.checkCommentSL(i) ||
- this.checkVhash(i) ||
- this.checkAny(i) ||
- this.checkOperator(i) ||
- this.checkImportant(i);
- };
- sass._getValue = function() {
- if (this.checkS(pos)) return this.getS();
- if (this.checkCommentML(pos)) return this.getCommentML();
- if (this.checkCommentSL(pos)) return this.getCommentSL();
- else if (this.checkVhash(pos)) return this.getVhash();
- else if (this.checkAny(pos)) return this.getAny();
- else if (this.checkOperator(pos)) return this.getOperator();
- else if (this.checkImportant(pos)) return this.getImportant();
- };
- sass.markSC = function() {
- var ws = -1,
- sc = -1,
- t;
- for (var i = 0; i < tokensLength; i++) {
- t = tokens[i];
- switch (t.type) {
- case TokenType.Space:
- case TokenType.Tab:
- t.ws = true;
- t.sc = true;
- if (ws === -1) ws = i;
- if (sc === -1) sc = i;
- break;
- case TokenType.Newline:
- t.ws = true;
- t.sc = true;
- ws = ws === -1 ? i : ws;
- sc = sc === -1 ? i : ws;
- tokens[ws].ws_last = i;
- tokens[sc].sc_last = i;
- ws = -1;
- sc = -1;
- break;
- case TokenType.CommentML:
- case TokenType.CommentSL:
- if (ws !== -1) {
- tokens[ws].ws_last = i - 1;
- ws = -1;
- }
- t.sc = true;
- break;
- default:
- if (ws !== -1) {
- tokens[ws].ws_last = i - 1;
- ws = -1;
- }
- if (sc !== -1) {
- tokens[sc].sc_last = i - 1;
- sc = -1;
- }
- }
- }
- if (ws !== -1) tokens[ws].ws_last = i - 1;
- if (sc !== -1) tokens[sc].sc_last = i - 1;
- };
- sass.markBlocks = function() {
- var blocks = [],
- currentLN = 1,
- currentIL = 0,
- prevIL = 0,
- i = 0,
- l = tokens.length,
- iw;
- for (; i != l; i++) {
- if (!tokens[i - 1]) continue;
- if (tokens[i].ln == currentLN) continue;
- else currentLN = tokens[i].ln;
- prevIL = currentIL;
- if (tokens[i].type !== TokenType.Space) currentIL = 0;
- else {
- if (!iw) iw = tokens[i].value.length;
- prevIL = currentIL;
- currentIL = tokens[i].value.length / iw;
- }
- if (prevIL === currentIL) continue;
- else if (currentIL > prevIL) {
- blocks.push(i);
- continue;
- } else {
- var il = prevIL;
- while (blocks.length > 0 && il !== currentIL) {
- tokens[blocks.pop()].block_end = i - 1;
- il--;
- }
- }
- }
- while (blocks.length > 0) {
- tokens[blocks.pop()].block_end = i - 1;
- }
- };
- sass.parseMLComment = function(css) {
- var start = pos;
- var il = 0;
- for (var _pos = pos - 1; _pos > -1; _pos--) {
- if (css.charAt(_pos) === ' ') il++;
- else break;
- }
- for (pos = pos + 2; pos < css.length; pos++) {
- if (css.charAt(pos) === '\n') {
- var _il = 0;
- for (var _pos = pos + 1; _pos < css.length; _pos++) {
- if (css.charAt(_pos) === ' ') _il++;
- else break;
- }
- if (_il > il) {
- pos = _pos;
- } else break;
- }
- }
- pushToken(TokenType.CommentML, css.substring(start, pos + 1));
- };
- sass.parseSLComment = function(css) {
- var start = pos;
- var il = 0;
- var onlyToken = false;
- for (var _pos = pos - 1; _pos > -1; _pos--) {
- if (css.charAt(_pos) === ' ') il++;
- else if (css.charAt(_pos) === '\n') {
- onlyToken = true;
- break;
- } else break;
- }
- if (_pos === -1) onlyToken = true;
- if (!onlyToken) {
- for (pos = pos + 2; pos < css.length; pos++) {
- if (css.charAt(pos) === '\n' || css.charAt(pos) === '\r') {
- break;
- }
- }
- } else {
- for (pos = pos + 2; pos < css.length; pos++) {
- if (css.charAt(pos) === '\n') {
- var _il = 0;
- for (var _pos = pos + 1; _pos < css.length; _pos++) {
- if (css.charAt(_pos) === ' ') _il++;
- else break;
- }
- if (_il > il) {
- pos = _pos;
- } else break;
- }
- }
- }
- pushToken(TokenType.CommentSL, css.substring(start, pos));
- pos--;
- };
- syntaxes.sass = sass;
-})();
-(function() {
- var less = Object.create(syntaxes.css);
- less.checkAny = function(i) {
- return this.checkBraces(i) ||
- this.checkString(i) ||
- this.checkVariablesList(i) ||
- this.checkVariable(i) ||
- this.checkPercentage(i) ||
- this.checkDimension(i) ||
- this.checkNumber(i) ||
- this.checkUri(i) ||
- this.checkFunctionExpression(i) ||
- this.checkFunction(i) ||
- this.checkIdent(i) ||
- this.checkClass(i) ||
- this.checkUnary(i);
- };
- less.getAny = function() {
- if (this.checkBraces(pos)) return this.getBraces();
- else if (this.checkString(pos)) return this.getString();
- else if (this.checkVariablesList(pos)) return this.getVariablesList();
- else if (this.checkVariable(pos)) return this.getVariable();
- else if (this.checkPercentage(pos)) return this.getPercentage();
- else if (this.checkDimension(pos)) return this.getDimension();
- else if (this.checkNumber(pos)) return this.getNumber();
- else if (this.checkUri(pos)) return this.getUri();
- else if (this.checkFunctionExpression(pos)) return this.getFunctionExpression();
- else if (this.checkFunction(pos)) return this.getFunction();
- else if (this.checkIdent(pos)) return this.getIdent();
- else if (this.checkClass(pos)) return this.getClass();
- else if (this.checkUnary(pos)) return this.getUnary();
- };
- less.checkArguments = function (i) {
- var start = i,
- l;
- if (i >= tokensLength ||
- tokens[i++].type !== TokenType.LeftParenthesis) return 0;
- while (i < tokens[start].right) {
- if (l = this.checkArgument(i)) i +=l;
- else return 0;
- }
- return tokens[start].right - start + 1;
- };
- less.getArguments = function() {
- var startPos = pos,
- arguments = [],
- x;
- pos++;
- while (x = this.getArgument()) {
- if ((needInfo && typeof x[1] === 'string') || typeof x[0] === 'string') arguments.push(x);
- else arguments = arguments.concat(x);
- }
- pos++;
- x = [NodeType.ArgumentsType].concat(arguments);
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.checkArgument = function(i) {
- return this.checkDeclaration(i) ||
- this.checkVariablesList(i) ||
- this.checkVariable(i) ||
- this.checkSC(i) ||
- this.checkDelim(i) ||
- this.checkDeclDelim(i) ||
- this.checkString(i) ||
- this.checkPercentage(i) ||
- this.checkDimension(i) ||
- this.checkNumber(i) ||
- this.checkUri(i) ||
- this.checkIdent(i) ||
- this.checkVhash(i);
- };
- less.getArgument = function() {
- if (this.checkDeclaration(pos)) return this.getDeclaration();
- else if (this.checkVariablesList(pos)) return this.getVariablesList();
- else if (this.checkVariable(pos)) return this.getVariable();
- else if (this.checkSC(pos)) return this.getSC();
- else if (this.checkDelim(pos)) return this.getDelim();
- else if (this.checkDeclDelim(pos)) return this.getDeclDelim();
- else if (this.checkString(pos)) return this.getString();
- else if (this.checkPercentage(pos)) return this.getPercentage();
- else if (this.checkDimension(pos)) return this.getDimension();
- else if (this.checkNumber(pos)) return this.getNumber();
- else if (this.checkUri(pos)) return this.getUri();
- else if (this.checkIdent(pos)) return this.getIdent();
- else if (this.checkVhash(pos)) return this.getVhash();
- };
- less.checkBlockdecl1 = function(i) {
- var start = i,
- l;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkCondition(i)) tokens[i].bd_kind = 1;
- else if (l = this.checkInclude(i)) tokens[i].bd_kind = 2;
- else if (l = this.checkFilter(i)) tokens[i].bd_kind = 3;
- else if (l = this.checkDeclaration(i)) tokens[i].bd_kind = 4;
- else if (l = this.checkAtrule(i)) tokens[i].bd_kind = 5;
- else if (l = this.checkRuleset(i)) tokens[i].bd_kind = 6;
- else return 0;
- i += l;
- if (i < tokensLength && (l = this.checkDeclDelim(i))) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- else return 0;
- return i - start;
- }
- less.getBlockdecl1 = function() {
- var sc = this.getSC(),
- x;
- switch (tokens[pos].bd_kind) {
- case 1:
- x = this.getCondition();
- break;
- case 2:
- x = this.getInclude();
- break;
- case 3:
- x = this.getFilter();
- break;
- case 4:
- x = this.getDeclaration();
- break;
- case 5:
- x = this.getAtrule();
- break;
- case 6:
- x = this.getRuleset();
- break;
- }
- return sc
- .concat([x])
- .concat([this.getDeclDelim()])
- .concat(this.getSC());
- };
- less.checkBlockdecl2 = function(i) {
- var start = i,
- l;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkCondition(i)) tokens[i].bd_kind = 1;
- else if (l = this.checkInclude(i)) tokens[i].bd_kind = 2;
- else if (l = this.checkFilter(i)) tokens[i].bd_kind = 3;
- else if (l = this.checkDeclaration(i)) tokens[i].bd_kind = 4;
- else if (l = this.checkAtrule(i)) tokens[i].bd_kind = 5;
- else if (l = this.checkRuleset(i)) tokens[i].bd_kind = 6;
- else return 0;
- i += l;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- };
- less.getBlockdecl2 = function() {
- var sc = this.getSC(),
- x;
- switch (tokens[pos].bd_kind) {
- case 1:
- x = this.getCondition();
- break;
- case 2:
- x = this.getInclude();
- break;
- case 3:
- x = this.getFilter();
- break;
- case 4:
- x = this.getDeclaration();
- break;
- case 5:
- x = this.getAtrule();
- break;
- case 6:
- x = this.getRuleset();
- break;
- }
- return sc
- .concat([x])
- .concat(this.getSC());
- };
- less.checkClass = function(i) {
- var l;
- if (i >= tokensLength) return 0;
- if (tokens[i].class_l) return tokens[i].class_l;
- if (tokens[i++].type === TokenType.FullStop &&
- (l = this.checkInterpolatedVariable(i) || this.checkIdent(i))) {
- tokens[i].class_l = l + 1;
- return l + 1;
- }
- return 0;
- };
- less.getClass = function() {
- var startPos = pos,
- x = [NodeType.ClassType];
- pos++;
- x.push(this.checkInterpolatedVariable(pos) ? this.getInterpolatedVariable() : this.getIdent());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.checkCommentSL = function(i) {
- return i < tokensLength && tokens[i].type === TokenType.CommentSL ? 1 : 0;
- };
- less.getCommentSL = function() {
- var startPos = pos,
- x;
- x = [NodeType.CommentSLType, tokens[pos++].value.substring(2)];
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.checkCondition = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if ((l = this.checkIdent(i)) && tokens[i].value === 'when') i += l;
- else return 0;
- while (i < tokensLength) {
- if (l = this.checkBlock(i)) break;
- if (l = this.checkFunction(i) |
- this.checkBraces(i) ||
- this.checkVariable(i) ||
- this.checkIdent(i) ||
- this.checkSC(i) ||
- this.checkNumber(i) ||
- this.checkDelim(i) ||
- this.checkOperator(i) ||
- this.checkCombinator(i) ||
- this.checkString(i)) i += l;
- else return 0;
- }
- return i - start;
- };
- less.getCondition = function() {
- var startPos = pos,
- x = [NodeType.ConditionType];
- x.push(this.getIdent());
- while (pos < tokensLength) {
- if (this.checkBlock(pos)) break;
- else if (this.checkFunction(pos)) x.push(this.getFunction());
- else if (this.checkBraces(pos)) x.push(this.getBraces());
- else if (this.checkVariable(pos)) x.push(this.getVariable());
- else if (this.checkIdent(pos)) x.push(this.getIdent());
- else if (this.checkNumber(pos)) x.push(this.getNumber());
- else if (this.checkDelim(pos)) x.push(this.getDelim());
- else if (this.checkOperator(pos)) x.push(this.getOperator());
- else if (this.checkCombinator(pos)) x.push(this.getCombinator());
- else if (this.checkSC(pos)) x = x.concat(this.getSC());
- else if (this.checkString(pos)) x.push(this.getString());
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.checkEscapedString = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (tokens[i].type === TokenType.Tilde && (l = this.checkString(i + 1))) return i + l - start;
- else return 0;
- };
- less.getEscapedString = function() {
- var startPos = pos,
- x = [NodeType.EscapedStringType];
- pos++;
- x.push(tokens[pos++].value);
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.checkFilterv = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkProgid(i) || this.checkEscapedString(i)) i += l;
- else return 0;
- while (l = this.checkProgid(i) || this.checkEscapedString(i)) {
- i += l;
- }
- tokens[start].last_progid = i;
- if (i < tokensLength && (l = this.checkSC(i))) i += l;
- if (i < tokensLength && (l = this.checkImportant(i))) i += l;
- return i - start;
- };
- less.getFilterv = function() {
- var startPos = pos,
- x = [NodeType.FiltervType],
- last_progid = tokens[pos].last_progid;
- x = x.concat(this.getSC());
- while (pos < last_progid) {
- x.push(this.checkProgid(pos) ? this.getProgid() : this.getEscapedString());
- }
- if (this.checkSC(pos)) x = x.concat(this.getSC());
- if (pos < tokensLength && this.checkImportant(pos)) x.push(this.getImportant());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- },
- less.checkIdent = function(i) {
- var start = i,
- wasIdent,
- l;
- if (i >= tokensLength) return 0;
- if (tokens[i].type === TokenType.LowLine) return this.checkIdentLowLine(i);
- if (tokens[i].type === TokenType.HyphenMinus ||
- tokens[i].type === TokenType.Identifier ||
- tokens[i].type === TokenType.DollarSign ||
- tokens[i].type === TokenType.Asterisk) i++;
- else return 0;
- wasIdent = tokens[i - 1].type === TokenType.Identifier;
- for (; i < tokensLength; i++) {
- if (l = this.checkInterpolatedVariable(i)) i += l;
- if (i >= tokensLength) break;
- if (tokens[i].type !== TokenType.HyphenMinus &&
- tokens[i].type !== TokenType.LowLine) {
- if (tokens[i].type !== TokenType.Identifier &&
- (tokens[i].type !== TokenType.DecimalNumber || !wasIdent)) break;
- else wasIdent = true;
- }
- }
- if (!wasIdent && tokens[start].type !== TokenType.Asterisk) return 0;
- tokens[start].ident_last = i - 1;
- return i - start;
- };
- less.checkInclude = function(i) {
- var l;
- if (i >= tokensLength) return 0;
- if (l = this.checkInclude1(i)) tokens[i].include_type = 1;
- else if (l = this.checkInclude2(i)) tokens[i].include_type = 2;
- return l;
- };
- less.getInclude = function() {
- switch (tokens[pos].include_type) {
- case 1: return this.getInclude1();
- case 2: return this.getInclude2();
- }
- };
- less.checkInclude1 = function(i) {
- var start = i,
- l;
- if (l = this.checkClass(i) || this.checkShash(i)) i += l;
- else return 0;
- while (i < tokensLength) {
- if (l = this.checkClass(i) || this.checkShash(i) || this.checkSC(i)) i += l;
- else if (tokens[i].type == TokenType.GreaterThanSign) i++;
- else break;
- }
- if (l = this.checkArguments(i)) i += l;
- else return 0;
- if (i < tokensLength && (l = this.checkSC(i))) i += l;
- if (i < tokensLength && (l = this.checkImportant(i))) i += l;
- return i - start;
- };
- less.getInclude1 = function() {
- var startPos = pos,
- x = [NodeType.IncludeType];
- x.push(this.checkClass(pos) ? this.getClass() : this.getShash());
- while (pos < tokensLength) {
- if (this.checkClass(pos)) x.push(this.getClass());
- else if (this.checkShash(pos)) x.push(this.getShash());
- else if (this.checkSC(pos)) x = x.concat(this.getSC());
- else if (this.checkOperator(pos)) x.push(this.getOperator());
- else break;
- }
- x.push(this.getArguments());
- x = x.concat(this.getSC());
- if (this.checkImportant(pos)) x.push(this.getImportant());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.checkInclude2 = function(i) {
- var start = i,
- l;
- if (l = this.checkClass(i) || this.checkShash(i)) i += l;
- else return 0;
- while (i < tokensLength) {
- if (l = this.checkClass(i) || this.checkShash(i) || this.checkSC(i)) i += l;
- else if (tokens[i].type == TokenType.GreaterThanSign) i++;
- else break;
- }
- return i - start;
- };
- less.getInclude2 = function() {
- var startPos = pos,
- x = [NodeType.IncludeType];
- x.push(this.checkClass(pos) ? this.getClass() : this.getShash());
- while (pos < tokensLength) {
- if (this.checkClass(pos)) x.push(this.getClass());
- else if (this.checkShash(pos)) x.push(this.getShash());
- else if (this.checkSC(pos)) x = x.concat(this.getSC());
- else if (this.checkOperator(pos)) x.push(this.getOperator());
- else break;
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.checkIncludeSelector = function(i) {
- var start = i,
- l;
- while (i < tokensLength) {
- if (l = this.checkSimpleSelector2(i)) i += l;
- else break;
- }
- return i - start;
- };
- less.getIncludeSelector = function() {
- var startPos = pos,
- x = [NodeType.SimpleselectorType],
- t;
- while (pos < tokensLength && this.checkSimpleSelector2(pos)) {
- t = this.getSimpleSelector2();
- if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t);
- else x = x.concat(t);
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.checkInterpolatedVariable = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (tokens[i].type !== TokenType.CommercialAt ||
- !tokens[i + 1] || tokens[i + 1].type !== TokenType.LeftCurlyBracket) return 0;
- i += 2;
- if (l = this.checkIdent(i)) i += l;
- else return 0;
- return tokens[i].type === TokenType.RightCurlyBracket ? i - start + 1 : 0;
- };
- less.getInterpolatedVariable = function() {
- var startPos = pos,
- x = [NodeType.InterpolatedVariableType];
- pos += 2;
- x.push(this.getIdent());
- pos++;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.checkMixin = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkClass(i) || this.checkShash(i)) i +=l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkArguments(i)) i += l;
- if (l = this.checkSC(i)) i += l;
- if (l = this.checkBlock(i)) i += l;
- else return 0;
- return i - start;
- };
- less.getMixin = function() {
- var startPos = pos,
- x = [NodeType.MixinType];
- x.push(this.checkClass(pos) ? this.getClass() : this.getShash());
- x = x.concat(this.getSC());
- if (this.checkArguments(pos)) x.push(this.getArguments());
- x = x.concat(this.getSC());
- if (this.checkBlock(pos)) x.push(this.getBlock());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.checkOperator = function(i) {
- if (i >= tokensLength) return 0;
- switch(tokens[i].type) {
- case TokenType.Solidus:
- case TokenType.Comma:
- case TokenType.Colon:
- case TokenType.EqualsSign:
- case TokenType.LessThanSign:
- case TokenType.GreaterThanSign:
- case TokenType.Asterisk:
- return 1;
- }
- return 0;
- };
- less.checkParentSelector = function(i) {
- return i < tokensLength && tokens[i].type === TokenType.Ampersand ? 1 : 0;
- };
- less.getParentSelector = function() {
- var startPos = pos,
- x = [NodeType.ParentSelectorType, '&'];
- pos++;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.checkProperty = function(i) {
- var start = i,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkVariable(i) || this.checkIdent(i)) i += l;
- else return 0;
- if (l = this.checkSC(i)) i += l;
- return i - start;
- };
- less.getProperty = function() {
- var startPos = pos,
- x = [NodeType.PropertyType];
- if (this.checkVariable(pos)) x.push(this.getVariable());
- else x.push(this.getIdent());
- x = x.concat(this.getSC());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.checkPseudoe = function(i) {
- var l;
- if (i >= tokensLength || tokens[i++].type !== TokenType.Colon ||
- i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0;
- return (l = this.checkInterpolatedVariable(i) || this.checkIdent(i)) ? l + 2 : 0;
- };
- less.getPseudoe = function() {
- var startPos = pos,
- x = [NodeType.PseudoeType];
- pos += 2;
- x.push(this.checkInterpolatedVariable(pos) ? this.getInterpolatedVariable() : this.getIdent());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.checkPseudoc = function(i) {
- var l;
- if (i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0;
- return (l = this.checkInterpolatedVariable(i) || this.checkFunction(i) || this.checkIdent(i)) ? l + 1 : 0;
- };
- less.getPseudoc = function() {
- var startPos = pos,
- x = [NodeType.PseudocType];
- pos ++;
- if (this.checkInterpolatedVariable(pos)) x.push(this.getInterpolatedVariable());
- else if (this.checkFunction(pos)) x.push(this.getFunction());
- else x.push(this.getIdent());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.checkSC = function(i) {
- if (i >= tokensLength) return 0;
- var l,
- lsc = 0,
- ln = tokens[i].ln;
- while (i < tokensLength) {
- if (!(l = this.checkS(i)) &&
- !(l = this.checkCommentML(i)) &&
- !(l = this.checkCommentSL(i))) break;
- i += l;
- lsc += l;
- }
- return lsc || 0;
- };
- less.getSC = function() {
- var sc = [],
- ln;
- if (pos >= tokensLength) return sc;
- ln = tokens[pos].ln;
- while (pos < tokensLength) {
- if (this.checkS(pos)) sc.push(this.getS());
- else if (this.checkCommentML(pos)) sc.push(this.getCommentML());
- else if (this.checkCommentSL(pos)) sc.push(this.getCommentSL());
- else break;
- }
- return sc;
- };
- less.checkSimpleSelector1 = function(i) {
- return this.checkParentSelector(i) ||
- this.checkNthselector(i) ||
- this.checkCombinator(i) ||
- this.checkAttrib(i) ||
- this.checkPseudo(i) ||
- this.checkShash(i) ||
- this.checkAny(i) ||
- this.checkSC(i) ||
- this.checkNamespace(i);
- };
- less.getSimpleSelector1 = function() {
- if (this.checkParentSelector(pos)) return this.getParentSelector();
- else if (this.checkNthselector(pos)) return this.getNthselector();
- else if (this.checkCombinator(pos)) return this.getCombinator();
- else if (this.checkAttrib(pos)) return this.getAttrib();
- else if (this.checkPseudo(pos)) return this.getPseudo();
- else if (this.checkShash(pos)) return this.getShash();
- else if (this.checkAny(pos)) return this.getAny();
- else if (this.checkSC(pos)) return this.getSC();
- else if (this.checkNamespace(pos)) return this.getNamespace();
- };
- less.checkSimpleSelector2 = function(i) {
- return this.checkParentSelector(i) ||
- this.checkNthselector(i) ||
- this.checkAttrib(i) ||
- this.checkPseudo(i) ||
- this.checkShash(i) ||
- this.checkIdent(i) ||
- this.checkClass(i);
- };
- less.getSimpleSelector2 = function() {
- if (this.checkParentSelector(pos)) return this.getParentSelector();
- else if (this.checkNthselector(pos)) return this.getNthselector();
- else if (this.checkAttrib(pos)) return this.getAttrib();
- else if (this.checkPseudo(pos)) return this.getPseudo();
- else if (this.checkShash(pos)) return this.getShash();
- else if (this.checkIdent(pos)) return this.getIdent();
- else if (this.checkClass(pos)) return this.getClass();
- };
- less.checkStylesheet = function(i) {
- var start = i,
- l;
- while (i < tokensLength) {
- if (l = this.checkSC(i) ||
- this.checkDeclaration(i) ||
- this.checkDeclDelim(i) ||
- this.checkInclude(i) ||
- this.checkMixin(i) ||
- this.checkAtrule(i) ||
- this.checkRuleset(i)) i += l;
- else throwError(i);
- }
- return i - start;
- };
- less.getStylesheet = function() {
- var startPos = pos,
- x = [NodeType.StylesheetType];
- while (pos < tokensLength) {
- if (this.checkSC(pos)) x = x.concat(this.getSC());
- else if (this.checkRuleset(pos)) x.push(this.getRuleset());
- else if (this.checkInclude(pos)) x.push(this.getInclude());
- else if (this.checkMixin(pos)) x.push(this.getMixin());
- else if (this.checkAtrule(pos)) x.push(this.getAtrule());
- else if (this.checkDeclaration(pos)) x.push(this.getDeclaration());
- else if (this.checkDeclDelim(pos)) x.push(this.getDeclDelim());
- else throwError();
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.checkValue = function(i) {
- var start = i,
- l;
- while (i < tokensLength) {
- if (l = this._checkValue(i)) i += l;
- if (!l || this.checkBlock(i - l)) break;
- }
- return i - start;
- };
- less._checkValue = function(i) {
- return this.checkSC(i) ||
- this.checkEscapedString(i) ||
- this.checkInterpolatedVariable(i) ||
- this.checkVariable(i) ||
- this.checkVhash(i) ||
- this.checkBlock(i) ||
- this.checkAny(i) ||
- this.checkAtkeyword(i) ||
- this.checkOperator(i) ||
- this.checkImportant(i);
- };
- less.getValue = function() {
- var startPos = pos,
- x = [NodeType.ValueType],
- t, _pos;
- while (pos < tokensLength) {
- _pos = pos;
- if (!this._checkValue(pos)) break;
- t = this._getValue();
- if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t);
- else x = x.concat(t);
- if (this.checkBlock(_pos)) break;
- }
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less._getValue = function() {
- if (this.checkSC(pos)) return this.getSC();
- else if (this.checkEscapedString(pos)) return this.getEscapedString();
- else if (this.checkInterpolatedVariable(pos)) return this.getInterpolatedVariable();
- else if (this.checkVariable(pos)) return this.getVariable();
- else if (this.checkVhash(pos)) return this.getVhash();
- else if (this.checkBlock(pos)) return this.getBlock();
- else if (this.checkAny(pos)) return this.getAny();
- else if (this.checkAtkeyword(pos)) return this.getAtkeyword();
- else if (this.checkOperator(pos)) return this.getOperator();
- else if (this.checkImportant(pos)) return this.getImportant();
- };
- less.checkVariable = function(i) {
- var l;
- if (i >= tokensLength || tokens[i].type !== TokenType.CommercialAt) return 0;
- if (tokens[i - 1] &&
- tokens[i - 1].type === TokenType.CommercialAt &&
- tokens[i - 2] &&
- tokens[i - 2].type === TokenType.CommercialAt) return 0;
- return (l = this.checkVariable(i + 1) || this.checkIdent(i + 1)) ? l + 1 : 0;
- };
- less.getVariable = function() {
- var startPos = pos,
- x = [NodeType.VariableType];
- pos++;
- if (this.checkVariable(pos)) x.push(this.getVariable());
- else x.push(this.getIdent());
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.checkVariablesList = function(i) {
- var d = 0,
- l;
- if (i >= tokensLength) return 0;
- if (l = this.checkVariable(i)) i+= l;
- else return 0;
- while (tokens[i] && tokens[i].type === TokenType.FullStop) {
- d++;
- i++;
- }
- return d === 3 ? l + d : 0;
- };
- less.getVariablesList = function() {
- var startPos = pos,
- x = [NodeType.VariablesListType, this.getVariable()];
- pos += 3;
- return needInfo ? (x.unshift(getInfo(startPos)), x) : x;
- };
- less.markSC = function() {
- var ws = -1,
- sc = -1,
- t;
- for (var i = 0; i < tokensLength; i++) {
- t = tokens[i];
- switch (t.type) {
- case TokenType.Space:
- case TokenType.Tab:
- case TokenType.Newline:
- t.ws = true;
- t.sc = true;
- if (ws === -1) ws = i;
- if (sc === -1) sc = i;
- break;
- case TokenType.CommentML:
- case TokenType.CommentSL:
- if (ws !== -1) {
- tokens[ws].ws_last = i - 1;
- ws = -1;
- }
- t.sc = true;
- break;
- default:
- if (ws !== -1) {
- tokens[ws].ws_last = i - 1;
- ws = -1;
- }
- if (sc !== -1) {
- tokens[sc].sc_last = i - 1;
- sc = -1;
- }
- }
- }
- if (ws !== -1) tokens[ws].ws_last = i - 1;
- if (sc !== -1) tokens[sc].sc_last = i - 1;
- };
- syntaxes.less = less;
-})();
- return function(options) {
- var css, rule, syntax;
- if (!options) throw new Error('Please, pass a string to parse');
- css = typeof options === 'string'? options : options.css;
- if (!css) throw new Error('String can not be empty');
- rule = options.rule || 'stylesheet';
- needInfo = options.needInfo || false;
- syntax = options.syntax || 'css';
- if (!syntaxes[syntax]) throw new Error('Syntax "' + _syntax +
- '" is not currently supported, sorry');
- s = syntaxes[syntax];
- getTokens(css, syntax);
- tokensLength = tokens.length;
- pos = 0;
- s.markBrackets();
- s.markSC();
- s.markBlocks && s.markBlocks();
- return rules[rule]();
- }
-}());
diff --git a/node_modules/csscomb/package.json b/node_modules/csscomb/package.json
index 9983399..b45619c 100644
--- a/node_modules/csscomb/package.json
+++ b/node_modules/csscomb/package.json
@@ -1,81 +1,116 @@
{
- "name": "csscomb",
- "description": "CSS coding style formatter",
- "version": "3.0.0",
- "homepage": "http://csscomb.com/",
+ "_args": [
+ [
+ "csscomb@3.1.8",
+ "/Users/jsuh/Dropbox/Apps/Sublime Text 3/Packages/sublime-csscomb"
+ ]
+ ],
+ "_from": "csscomb@3.1.8",
+ "_id": "csscomb@3.1.8",
+ "_inCache": true,
+ "_installable": true,
+ "_location": "/csscomb",
+ "_nodeVersion": "0.12.4",
+ "_npmUser": {
+ "email": "tonyganch+github@gmail.com",
+ "name": "tonyganch"
+ },
+ "_npmVersion": "2.10.1",
+ "_phantomChildren": {},
+ "_requested": {
+ "name": "csscomb",
+ "raw": "csscomb@3.1.8",
+ "rawSpec": "3.1.8",
+ "scope": null,
+ "spec": "3.1.8",
+ "type": "version"
+ },
+ "_requiredBy": [
+ "/"
+ ],
+ "_resolved": "https://registry.npmjs.org/csscomb/-/csscomb-3.1.8.tgz",
+ "_shasum": "a8a738884f409baf35ec9461afc52e1c75bd23a2",
+ "_shrinkwrap": null,
+ "_spec": "csscomb@3.1.8",
+ "_where": "/Users/jsuh/Dropbox/Apps/Sublime Text 3/Packages/sublime-csscomb",
"author": {
- "name": "Mikhail Troshev",
- "email": "mishanga@yandex-team.ru"
+ "email": "mishanga@yandex-team.ru",
+ "name": "Mikhail Troshev"
},
- "repository": {
- "type": "git",
- "url": "https://github.com/csscomb/csscomb.js"
+ "bin": {
+ "csscomb": "./bin/csscomb"
},
- "maintainers": [
- {
- "name": "Mikhail Troshev",
- "email": "mishanga@yandex-team.ru",
- "url": "http://mishanga.pro/"
- },
+ "bugs": {
+ "url": "https://github.com/csscomb/csscomb.js/issues"
+ },
+ "contributors": [
{
- "name": "Tony Ganch",
- "email": "tonyganch+github@gmail.com",
- "url": "http://tonyganch.com/"
+ "name": "Igor Novak",
+ "email": "bezengi@gmail.com"
},
{
- "name": "Slava Oliyanchuk",
- "email": "miripiruni@gmail.com",
- "url": "http://miripiruni.org/"
- }
- ],
- "contributors": [
- {
- "name": "Sergey Puzankov",
- "email": "puzankov@yandex-team.ru"
+ "name": "Roman Komarov",
+ "email": "kizmarh@ya.ru"
},
{
"name": "Denis Payase",
"email": "lostsoul@yandex-team.ru"
},
{
- "name": "Igor Novak",
- "email": "bezengi@gmail.com"
+ "name": "Mikhail Troshev",
+ "email": "mishanga@yandex-team.ru",
+ "url": "http://mishanga.pro/"
},
{
- "name": "Roman Komarov",
- "email": "kizmarh@ya.ru"
+ "name": "Sergey Puzankov",
+ "email": "puzankov@yandex-team.ru"
}
],
- "engines": {
- "node": ">= 0.10.0"
- },
"dependencies": {
"commander": "2.0.0",
- "csscomb-core": "~2.0.0",
- "gonzales-pe": "~3.0.0",
+ "csscomb-core": "3.0.0-3.1",
+ "gonzales-pe": "3.0.0-28",
"vow": "0.4.4"
},
+ "description": "CSS coding style formatter",
"devDependencies": {
- "jshint-groups": "0.5.3",
- "jshint": "2.3.0",
"jscs": "1.4.5",
- "mocha": "1.14.0"
+ "jshint": "2.3.0",
+ "jshint-groups": "0.5.3",
+ "mocha": "1.20.1"
},
+ "directories": {},
+ "dist": {
+ "shasum": "a8a738884f409baf35ec9461afc52e1c75bd23a2",
+ "tarball": "http://registry.npmjs.org/csscomb/-/csscomb-3.1.8.tgz"
+ },
+ "engines": {
+ "node": ">= 0.10.0"
+ },
+ "files": [
+ "bin",
+ "config",
+ "lib"
+ ],
+ "gitHead": "1fce22d58a504c1f425349f5ad39d2ac40f5637c",
+ "homepage": "http://csscomb.com/",
"main": "./lib/csscomb.js",
- "bin": {
- "csscomb": "./bin/csscomb"
+ "maintainers": [
+ {
+ "name": "tonyganch",
+ "email": "tonyganch+github@gmail.com"
+ }
+ ],
+ "name": "csscomb",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/csscomb/csscomb.js.git"
},
"scripts": {
"test": "jshint-groups && ./node_modules/.bin/jscs . && node test/mocha",
"test-cov": "rm -rf lib-cov && jscoverage lib lib-cov && TEST_COV=true node test/mocha > ./test/test-coverage.html"
},
- "readme": "# CSScomb [](http://csscomb.com/)\n[](http://travis-ci.org/csscomb/csscomb.js)\n[](http://badge.fury.io/js/csscomb)\n[](https://david-dm.org/csscomb/csscomb.js)\n[](https://david-dm.org/csscomb/csscomb.js#info=devDependencies)\n\nCSScomb is a coding style formatter for CSS.\nYou can easily write your own [configuration](doc/configuration.md) to make\nyour style sheets beautiful and consistent.\n\nThe main feature is [sorting properties](doc/options.md#sort-order) in a specific order.\nIt was inspired by [@miripiruni](https://github.com/miripiruni)'s\n[PHP-based tool](https://github.com/csscomb/csscomb) of the same name.\nThis is the new JavaScript version, based on the powerful CSS parser\n[Gonzales PE](https://github.com/tonyganch/gonzales-pe).\n\n## 1. Install\n\nGlobal installation (for use as a command-line tool):\n\n```bash\nnpm install csscomb -g\n```\n\nLocal installation (for use as a command-line tool within current directory):\n\n```bash\nnpm install csscomb\n```\n\nTo install as a project dependency (the package will appear in your dependencies):\n\n```bash\nnpm install csscomb --save\n```\n\nTo install as a dev dependency (the package will appear in your devDependencies):\n\n```bash\nnpm install csscomb --save-dev\n```\n\n## 2. [Configure](doc/configuration.md)\n\nThere are a number of ways to configure CSScomb:\n\n- Use one of [predefined configs](config)\n- Put `.csscomb.json` file in the project root.\n- Set path to config's file\n- Use `*.css` file as a template\n\n## 3. Use\n\n### [Command Line](doc/usage-cli.md)\n\n```bash\ncsscomb assets/css\n```\n\n### [Node.js module](doc/usage-node.md)\n\n```js\nvar Comb = require('csscomb');\nvar comb = new Comb('zen');\ncomb.processPath('assets/css');\n```\n\n## 4. Contribute\n\nAnyone and everyone is welcome to contribute.\nPlease take a moment to review the [guidelines for contributing](CONTRIBUTE.md).\n\n## Authors\n\n[@mishanga](https://github.com/mishanga),\n[@tonyganch](https://github.com/tonyganch)\n\nThanks for assistance and contributions:\n\n[@miripiruni](https://github.com/miripiruni),\n[@anton-rudeshko](https://github.com/anton-rudeshko),\n[@cvrebert](https://github.com/cvrebert),\n[@filtercake](https://github.com/filtercake),\n[@ignovak](https://github.com/ignovak),\n[@kizu](https://github.com/kizu),\n[@lefoy](https://github.com/lefoy),\n[@L0stSoul](https://github.com/L0stSoul),\n[@mishaberezin](https://github.com/mishaberezin),\n[@puzankov](https://github.com/puzankov),\n[@schneyra](https://github.com/schneyra),\n[@thejameskyle](https://github.com/thejameskyle),\n[@vecmezoni](https://github.com/vecmezoni)\n\n## License\n\nThis software is released under the terms of the\n[MIT license](https://github.com/csscomb/csscomb.js/blob/master/LICENSE).\n\n## Other projects\n* https://github.com/senchalabs/cssbeautify\n* https://github.com/css/gonzales\n* https://github.com/tonyganch/gonzales-pe\n* https://github.com/css/csso\n* https://github.com/nzakas/parser-lib\n",
- "readmeFilename": "README.md",
- "gitHead": "2875c43992c0100704b5b9ced52b1973eb253503",
- "bugs": {
- "url": "https://github.com/csscomb/csscomb.js/issues"
- },
- "_id": "csscomb@3.0.0",
- "_shasum": "6c156c622bcd6b48c3ba9cb7a529227704e0e55a",
- "_from": "csscomb@3.0.0"
+ "version": "3.1.8"
}
diff --git a/node_modules/csscomb/test/core/configure.js b/node_modules/csscomb/test/core/configure.js
deleted file mode 100644
index 77d9fe5..0000000
--- a/node_modules/csscomb/test/core/configure.js
+++ /dev/null
@@ -1,48 +0,0 @@
-var Comb = process.env.TEST_COV ? require('../../lib-cov/csscomb') : require('../../lib/csscomb');
-var assert = require('assert');
-
-describe('csscomb methods', function() {
- var comb;
- var input;
- var output;
- var expected;
-
- it('Passing no config to constructor should not configure anything', function() {
- comb = new Comb();
- assert.equal(undefined, comb._handlers);
- });
-
- it('Passing valid config name to constructor should configure using correct config', function() {
- comb = new Comb('zen');
- input = 'a { color: tomato; top: 0; }';
- expected = 'a {top: 0; color: tomato; }';
- output = comb.processString(input);
-
- assert.equal(expected, output);
- });
-
- it('Passing config object to constructor should configure using that object', function() {
- comb = new Comb({ 'always-semicolon': true });
- input = 'a { color: tomato }';
- expected = 'a { color: tomato; }';
- output = comb.processString(input);
-
- assert.equal(expected, output);
- });
-
- it('new Comb() should be chainable', function() {
- input = 'a { color: tomato; top: 0; }';
- expected = 'a {top: 0; color: tomato; }';
- output = new Comb('zen').processString(input);
-
- assert.equal(expected, output);
- });
-
- it('configure() should be chainable', function() {
- input = 'a { color: tomato }';
- expected = 'a { color: tomato; }';
- output = new Comb().configure({ 'always-semicolon': true }).processString(input);
-
- assert.equal(expected, output);
- });
-});
diff --git a/node_modules/csscomb/test/core/get-config.js b/node_modules/csscomb/test/core/get-config.js
deleted file mode 100644
index e562ea8..0000000
--- a/node_modules/csscomb/test/core/get-config.js
+++ /dev/null
@@ -1,51 +0,0 @@
-var assert = require('assert');
-
-describe('csscomb methods', function() {
- it('getConfig()', function() {
- var config = require('../../config/csscomb.json');
-
- assert.equal(this.Comb.getConfig(), config);
- });
-
- it('getConfig(number)', function() {
- assert.throws(function() {
- this.Comb.getConfig(16);
- });
- });
-
- it('getConfig(boolean)', function() {
- assert.throws(function() {
- this.Comb.getConfig(true);
- });
- });
-
- it('getConfig(empty string)', function() {
- var config = require('../../config/csscomb.json');
-
- assert.equal(this.Comb.getConfig(''), config);
- });
-
- it('getConfig(invalid string)', function() {
- assert.throws(function() {
- this.Comb.getConfig('nani');
- });
- });
-
- it('getConfig(csscomb)', function() {
- var config = require('../../config/csscomb.json');
-
- assert.equal(this.Comb.getConfig('csscomb'), config);
- });
-
- it('getConfig(zen)', function() {
- var config = require('../../config/zen.json');
-
- assert.equal(this.Comb.getConfig('zen'), config);
- });
-
- it('getConfig(yandex)', function() {
- var config = require('../../config/yandex.json');
-
- assert.equal(this.Comb.getConfig('yandex'), config);
- });
-});
diff --git a/node_modules/csscomb/test/core/less.js b/node_modules/csscomb/test/core/less.js
deleted file mode 100644
index dc5fefe..0000000
--- a/node_modules/csscomb/test/core/less.js
+++ /dev/null
@@ -1,42 +0,0 @@
-describe('LESS', function() {
- beforeEach(function() {
- this.filename = __filename;
- this.comb.configure({});
- });
-
- it('Should parse nested rules', function() {
- this.shouldBeEqual('nested-rule.less');
- });
-
- it('Should parse operations', function() {
- this.shouldBeEqual('operation.less');
- });
-
- it('Should parse parent selector &', function() {
- this.shouldBeEqual('parent-selector.less');
- });
-
- it('Should parse variables', function() {
- this.shouldBeEqual('variable.less');
- });
-
- it('Should parse interpolated variables inside selectors', function() {
- this.shouldBeEqual('interpolated-variable-1.less');
- });
-
- it('Should parse interpolated variables inside values', function() {
- this.shouldBeEqual('interpolated-variable-2.less');
- });
-
- it('Should parse @import', function() {
- this.shouldBeEqual('import.less');
- });
-
- it('Should parse included mixins', function() {
- this.shouldBeEqual('mixin.less');
- });
-
- it('Should parse nested @media', function() {
- this.shouldBeEqual('nested-media.less');
- });
-});
diff --git a/node_modules/csscomb/test/core/less/import.less b/node_modules/csscomb/test/core/less/import.less
deleted file mode 100644
index 8faa126..0000000
--- a/node_modules/csscomb/test/core/less/import.less
+++ /dev/null
@@ -1,4 +0,0 @@
-div {
- @import "foo.css";
- top: 0;
-}
diff --git a/node_modules/csscomb/test/core/less/interpolated-variable-1.less b/node_modules/csscomb/test/core/less/interpolated-variable-1.less
deleted file mode 100644
index b0bc314..0000000
--- a/node_modules/csscomb/test/core/less/interpolated-variable-1.less
+++ /dev/null
@@ -1,4 +0,0 @@
-div.@{nani} {
- color:tomato;
- top:0;
-}
diff --git a/node_modules/csscomb/test/core/less/interpolated-variable-2.less b/node_modules/csscomb/test/core/less/interpolated-variable-2.less
deleted file mode 100644
index 18a66ed..0000000
--- a/node_modules/csscomb/test/core/less/interpolated-variable-2.less
+++ /dev/null
@@ -1,4 +0,0 @@
-div {
- color: @{tomato};
- top:0;
-}
diff --git a/node_modules/csscomb/test/core/less/mixin.less b/node_modules/csscomb/test/core/less/mixin.less
deleted file mode 100644
index 7e95951..0000000
--- a/node_modules/csscomb/test/core/less/mixin.less
+++ /dev/null
@@ -1,4 +0,0 @@
-div {
- .mixin;
- top: 0;
-}
diff --git a/node_modules/csscomb/test/core/less/nested-media.less b/node_modules/csscomb/test/core/less/nested-media.less
deleted file mode 100644
index 346ddbf..0000000
--- a/node_modules/csscomb/test/core/less/nested-media.less
+++ /dev/null
@@ -1,6 +0,0 @@
-div {
- @media screen and (orientation: landscape) {
- color: tomato;
- }
- top: 0;
-}
diff --git a/node_modules/csscomb/test/core/less/nested-rule.less b/node_modules/csscomb/test/core/less/nested-rule.less
deleted file mode 100644
index 5f74a2d..0000000
--- a/node_modules/csscomb/test/core/less/nested-rule.less
+++ /dev/null
@@ -1,6 +0,0 @@
-div {
- color: tomato;
- a {
- top: 0;
- }
-}
diff --git a/node_modules/csscomb/test/core/less/operation.less b/node_modules/csscomb/test/core/less/operation.less
deleted file mode 100644
index a3711aa..0000000
--- a/node_modules/csscomb/test/core/less/operation.less
+++ /dev/null
@@ -1,8 +0,0 @@
-div {
- @base: 5%;
- @filler: @base * 2;
- @other: @base + @filler;
- color: #888 / 4;
- background-color: @base-color + #111;
- height: 100% / 2 + @filler;
-}
diff --git a/node_modules/csscomb/test/core/less/parent-selector.less b/node_modules/csscomb/test/core/less/parent-selector.less
deleted file mode 100644
index 6176030..0000000
--- a/node_modules/csscomb/test/core/less/parent-selector.less
+++ /dev/null
@@ -1,8 +0,0 @@
-div {
- color: tomato;
- &.top {
- color: nani;
- top: 0;
- }
- left: 0;
-}
diff --git a/node_modules/csscomb/test/core/less/variable.less b/node_modules/csscomb/test/core/less/variable.less
deleted file mode 100644
index 8eba0cc..0000000
--- a/node_modules/csscomb/test/core/less/variable.less
+++ /dev/null
@@ -1,5 +0,0 @@
-@red: tomato;
-div {
- color: @tomato;
- top: @@foo;
-}
diff --git a/node_modules/csscomb/test/core/scss.js b/node_modules/csscomb/test/core/scss.js
deleted file mode 100644
index 925a116..0000000
--- a/node_modules/csscomb/test/core/scss.js
+++ /dev/null
@@ -1,107 +0,0 @@
-describe('SCSS', function() {
- beforeEach(function() {
- this.filename = __filename;
- this.comb.configure({});
- });
-
- it('Should parse nested rules', function() {
- this.shouldBeEqual('nested-rule.scss');
- });
-
- it('Should parse parent selector &', function() {
- this.shouldBeEqual('parent-selector.scss');
- });
-
- it('Should parse nested properties', function() {
- this.shouldBeEqual('nested-property.scss');
- });
-
- it('Should parse variables', function() {
- this.shouldBeEqual('variable.scss');
- });
-
- it('Should parse interpolated variables inside selectors', function() {
- this.shouldBeEqual('interpolated-variable-1.scss');
- });
-
- it('Should parse interpolated variables inside values', function() {
- this.shouldBeEqual('interpolated-variable-2.scss');
- });
-
- it('Should parse defaults', function() {
- this.shouldBeEqual('default.scss');
- });
-
- it('Should parse @import', function() {
- this.shouldBeEqual('import.scss');
- });
-
- it('Should parse @include', function() {
- this.shouldBeEqual('include.scss');
- });
-
- it('Should parse nested @media', function() {
- this.shouldBeEqual('nested-media.scss');
- });
-
- it('Should parse @extend with classes', function() {
- this.shouldBeEqual('extend-1.scss');
- });
-
- it('Should parse @extend with placeholders', function() {
- this.shouldBeEqual('extend-2.scss');
- });
-
- it('Should parse @warn', function() {
- this.shouldBeEqual('warn.scss');
- });
-
- it('Should parse @if', function() {
- this.shouldBeEqual('if.scss');
- });
-
- it('Should parse @if and @else', function() {
- this.shouldBeEqual('if-else.scss');
- });
-
- it('Should parse @if and @else if', function() {
- this.shouldBeEqual('if-else-if.scss');
- });
-
- it('Should parse @for', function() {
- this.shouldBeEqual('for.scss');
- });
-
- it('Should parse @each', function() {
- this.shouldBeEqual('each.scss');
- });
-
- it('Should parse @while', function() {
- this.shouldBeEqual('while.scss');
- });
-
- it('Should parse mixins', function() {
- this.shouldBeEqual('mixin-1.scss');
- });
-
- it('Should parse passing several variables to a mixin', function() {
- this.shouldBeEqual('mixin-2.scss');
- });
-
- it('Should parse passing a list of variables to a mixin', function() {
- this.shouldBeEqual('mixin-3.scss');
- });
-
- it('Should parse passing a content block to a mixin', function() {
- this.shouldBeEqual('mixin-4.scss');
- });
-
- it('Should parse @content', function() {
- this.shouldBeEqual('content.scss');
- });
-
- it('Should parse functions', function() {
- this.shouldBeEqual('function.scss');
- });
-});
-
diff --git a/node_modules/csscomb/test/core/scss/content.scss b/node_modules/csscomb/test/core/scss/content.scss
deleted file mode 100644
index 6852bcc..0000000
--- a/node_modules/csscomb/test/core/scss/content.scss
+++ /dev/null
@@ -1,5 +0,0 @@
-@mixin nani {
- a {
- @content;
- }
-}
diff --git a/node_modules/csscomb/test/core/scss/default.scss b/node_modules/csscomb/test/core/scss/default.scss
deleted file mode 100644
index 12c10f9..0000000
--- a/node_modules/csscomb/test/core/scss/default.scss
+++ /dev/null
@@ -1,4 +0,0 @@
-div {
- color: tomato !default;
- top: 0;
-}
diff --git a/node_modules/csscomb/test/core/scss/each.scss b/node_modules/csscomb/test/core/scss/each.scss
deleted file mode 100644
index af596e6..0000000
--- a/node_modules/csscomb/test/core/scss/each.scss
+++ /dev/null
@@ -1,7 +0,0 @@
-div {
- @each $animal in puma, sea-slug, erget {
- .#{$animal}-icon {
- background-image: url("/images/#{$animal}.png");
- }
- }
-}
diff --git a/node_modules/csscomb/test/core/scss/extend-1.scss b/node_modules/csscomb/test/core/scss/extend-1.scss
deleted file mode 100644
index c72afea..0000000
--- a/node_modules/csscomb/test/core/scss/extend-1.scss
+++ /dev/null
@@ -1,4 +0,0 @@
-div {
- @extend .nani;
- top: 0;
-}
diff --git a/node_modules/csscomb/test/core/scss/extend-2.scss b/node_modules/csscomb/test/core/scss/extend-2.scss
deleted file mode 100644
index c7bf3b5..0000000
--- a/node_modules/csscomb/test/core/scss/extend-2.scss
+++ /dev/null
@@ -1,4 +0,0 @@
-div {
- @extend %nani;
- top: 0;
-}
diff --git a/node_modules/csscomb/test/core/scss/for.scss b/node_modules/csscomb/test/core/scss/for.scss
deleted file mode 100644
index 64ff25a..0000000
--- a/node_modules/csscomb/test/core/scss/for.scss
+++ /dev/null
@@ -1,7 +0,0 @@
-div {
- @for $i from 1 through 3 {
- .item-#{$i} {
- width: 2em * 1;
- }
- }
-}
diff --git a/node_modules/csscomb/test/core/scss/function.scss b/node_modules/csscomb/test/core/scss/function.scss
deleted file mode 100644
index 8fcce43..0000000
--- a/node_modules/csscomb/test/core/scss/function.scss
+++ /dev/null
@@ -1,3 +0,0 @@
-@function nani($n) {
- @return $n * 2;
-}
diff --git a/node_modules/csscomb/test/core/scss/if-else-if.scss b/node_modules/csscomb/test/core/scss/if-else-if.scss
deleted file mode 100644
index f16e287..0000000
--- a/node_modules/csscomb/test/core/scss/if-else-if.scss
+++ /dev/null
@@ -1,7 +0,0 @@
-div {
- @if $type == ocean {
- top: 0;
- } @else if $type == monster {
- left: 0;
- }
-}
diff --git a/node_modules/csscomb/test/core/scss/if-else.scss b/node_modules/csscomb/test/core/scss/if-else.scss
deleted file mode 100644
index 236a621..0000000
--- a/node_modules/csscomb/test/core/scss/if-else.scss
+++ /dev/null
@@ -1,7 +0,0 @@
-div {
- @if $type == ocean {
- top: 0;
- } @else {
- left: 0;
- }
-}
diff --git a/node_modules/csscomb/test/core/scss/if.scss b/node_modules/csscomb/test/core/scss/if.scss
deleted file mode 100644
index af9f485..0000000
--- a/node_modules/csscomb/test/core/scss/if.scss
+++ /dev/null
@@ -1,5 +0,0 @@
-div {
- @if $type == ocean {
- top: 0;
- }
-}
diff --git a/node_modules/csscomb/test/core/scss/import.scss b/node_modules/csscomb/test/core/scss/import.scss
deleted file mode 100644
index 8faa126..0000000
--- a/node_modules/csscomb/test/core/scss/import.scss
+++ /dev/null
@@ -1,4 +0,0 @@
-div {
- @import "foo.css";
- top: 0;
-}
diff --git a/node_modules/csscomb/test/core/scss/include.scss b/node_modules/csscomb/test/core/scss/include.scss
deleted file mode 100644
index 2c91880..0000000
--- a/node_modules/csscomb/test/core/scss/include.scss
+++ /dev/null
@@ -1,4 +0,0 @@
-div {
- @include nani($panda);
- top: 0;
-}
diff --git a/node_modules/csscomb/test/core/scss/interpolated-variable-1.scss b/node_modules/csscomb/test/core/scss/interpolated-variable-1.scss
deleted file mode 100644
index a6c28cf..0000000
--- a/node_modules/csscomb/test/core/scss/interpolated-variable-1.scss
+++ /dev/null
@@ -1,4 +0,0 @@
-div.#{$nani} {
- color: tomato;
- top:0;
-}
diff --git a/node_modules/csscomb/test/core/scss/interpolated-variable-2.scss b/node_modules/csscomb/test/core/scss/interpolated-variable-2.scss
deleted file mode 100644
index a19498f..0000000
--- a/node_modules/csscomb/test/core/scss/interpolated-variable-2.scss
+++ /dev/null
@@ -1,4 +0,0 @@
-div {
- color: #{$tomato};
- top: 0;
-}
diff --git a/node_modules/csscomb/test/core/scss/mixin-1.scss b/node_modules/csscomb/test/core/scss/mixin-1.scss
deleted file mode 100644
index 32a7715..0000000
--- a/node_modules/csscomb/test/core/scss/mixin-1.scss
+++ /dev/null
@@ -1,6 +0,0 @@
-@mixin nani {
- color: tomato;
-}
-.foo {
- @include nani;
-}
diff --git a/node_modules/csscomb/test/core/scss/mixin-2.scss b/node_modules/csscomb/test/core/scss/mixin-2.scss
deleted file mode 100644
index b779b6d..0000000
--- a/node_modules/csscomb/test/core/scss/mixin-2.scss
+++ /dev/null
@@ -1,6 +0,0 @@
-@mixin nani($tomato) {
- color: $tomato;
-}
-.foo {
- @include nani(red);
-}
diff --git a/node_modules/csscomb/test/core/scss/mixin-3.scss b/node_modules/csscomb/test/core/scss/mixin-3.scss
deleted file mode 100644
index 2c19b35..0000000
--- a/node_modules/csscomb/test/core/scss/mixin-3.scss
+++ /dev/null
@@ -1,6 +0,0 @@
-@mixin nani($shadows...) {
- box-shadow: $shadows;
-}
-.foo {
- @include nani(0px 4px 5px #666, 2px 6px 10px #999);
-}
diff --git a/node_modules/csscomb/test/core/scss/mixin-4.scss b/node_modules/csscomb/test/core/scss/mixin-4.scss
deleted file mode 100644
index 4e46ffe..0000000
--- a/node_modules/csscomb/test/core/scss/mixin-4.scss
+++ /dev/null
@@ -1,6 +0,0 @@
-.foo {
- @include nani {
- color: tomato;
- top: 0
- }
-}
diff --git a/node_modules/csscomb/test/core/scss/nested-media.scss b/node_modules/csscomb/test/core/scss/nested-media.scss
deleted file mode 100644
index 346ddbf..0000000
--- a/node_modules/csscomb/test/core/scss/nested-media.scss
+++ /dev/null
@@ -1,6 +0,0 @@
-div {
- @media screen and (orientation: landscape) {
- color: tomato;
- }
- top: 0;
-}
diff --git a/node_modules/csscomb/test/core/scss/nested-property.scss b/node_modules/csscomb/test/core/scss/nested-property.scss
deleted file mode 100644
index 2f6384a..0000000
--- a/node_modules/csscomb/test/core/scss/nested-property.scss
+++ /dev/null
@@ -1,8 +0,0 @@
-div {
- color: tomato;
- font: 2px/3px {
- family: fantasy;
- size: 30em;
- }
- left: 0;
-}
diff --git a/node_modules/csscomb/test/core/scss/nested-rule.scss b/node_modules/csscomb/test/core/scss/nested-rule.scss
deleted file mode 100644
index 5f74a2d..0000000
--- a/node_modules/csscomb/test/core/scss/nested-rule.scss
+++ /dev/null
@@ -1,6 +0,0 @@
-div {
- color: tomato;
- a {
- top: 0;
- }
-}
diff --git a/node_modules/csscomb/test/core/scss/parent-selector.scss b/node_modules/csscomb/test/core/scss/parent-selector.scss
deleted file mode 100644
index 6176030..0000000
--- a/node_modules/csscomb/test/core/scss/parent-selector.scss
+++ /dev/null
@@ -1,8 +0,0 @@
-div {
- color: tomato;
- &.top {
- color: nani;
- top: 0;
- }
- left: 0;
-}
diff --git a/node_modules/csscomb/test/core/scss/variable.scss b/node_modules/csscomb/test/core/scss/variable.scss
deleted file mode 100644
index d553b92..0000000
--- a/node_modules/csscomb/test/core/scss/variable.scss
+++ /dev/null
@@ -1,4 +0,0 @@
-$red: tomato;
-div {
- color: $tomato;
-}
diff --git a/node_modules/csscomb/test/core/scss/warn.scss b/node_modules/csscomb/test/core/scss/warn.scss
deleted file mode 100644
index c7961a1..0000000
--- a/node_modules/csscomb/test/core/scss/warn.scss
+++ /dev/null
@@ -1,4 +0,0 @@
-div {
- @warn "nani";
- top: 0;
-}
diff --git a/node_modules/csscomb/test/core/scss/while.scss b/node_modules/csscomb/test/core/scss/while.scss
deleted file mode 100644
index 89c6cfa..0000000
--- a/node_modules/csscomb/test/core/scss/while.scss
+++ /dev/null
@@ -1,8 +0,0 @@
-div {
- @while $i > 6 {
- .item {
- width: 2em * $i;
- }
- $i: $i - 2;
- }
-}
diff --git a/node_modules/csscomb/test/core/use.js b/node_modules/csscomb/test/core/use.js
deleted file mode 100644
index e14f43c..0000000
--- a/node_modules/csscomb/test/core/use.js
+++ /dev/null
@@ -1,41 +0,0 @@
-var assert = require('assert');
-
-describe('.use()', function() {
- beforeEach(function() {
- this.filename = __filename;
- });
-
- it('Should set predefined options in correct order', function() {
- var config = this.Comb.getConfig('csscomb');
- this.comb.configure(config);
- var options = this.comb.getOptionsOrder();
- var expected = [
- 'always-semicolon',
- 'remove-empty-rulesets',
- 'color-case',
- 'color-shorthand',
- 'element-case',
- 'eof-newline',
- 'leading-zero',
- 'quotes',
- 'sort-order-fallback',
- 'space-after-colon',
- 'space-after-combinator',
- 'space-after-opening-brace',
- 'space-after-selector-delimiter',
- 'space-before-colon',
- 'space-before-combinator',
- 'space-before-opening-brace',
- 'space-before-selector-delimiter',
- 'space-between-declarations',
- 'block-indent',
- 'sort-order',
- 'strip-spaces',
- 'space-before-closing-brace',
- 'unitless-zero',
- 'tab-size',
- 'vendor-prefix-align'
- ];
- assert.deepEqual(options, expected);
- });
-});
diff --git a/node_modules/csscomb/test/mocha.js b/node_modules/csscomb/test/mocha.js
deleted file mode 100644
index 5f5fb7a..0000000
--- a/node_modules/csscomb/test/mocha.js
+++ /dev/null
@@ -1,93 +0,0 @@
-var Comb = process.env.TEST_COV ?
- require('../lib-cov/csscomb') : require('../lib/csscomb');
-var Mocha = require('mocha');
-var assert = require('assert');
-var fs = require('fs');
-var path = require('path');
-
-var mocha = new Mocha();
-if (process.env.TEST_COV) mocha.reporter('html-cov');
-
-// Tell mocha which tests to run:
-['test/core', 'test/options'].forEach(function(dirname) {
- fs.readdirSync(dirname).forEach(function(file) {
- mocha.addFile(path.join(dirname, file));
- });
-});
-
-// Add helpers (see tests for usage examples):
-mocha.suite.beforeEach(function() {
- this.Comb = Comb;
- this.comb = new Comb();
- this.filename = '';
-
- /**
- * Read css file from test suite's directory.
- * If run inside `test/core/cli.js` file, `this.readFile('nani.css')` will
- * return content of `test/core/cli/nani.css` file.
- * `this.filename = __filename` is required if this helper is used in a test
- * case (see tests for examples).
- * @param {String} filename Name of file that is located in test folder
- * @returns {String} File's content
- */
- this.readFile = function(filename) {
- // Remove `.js` from test suite's name:
- var dirname = this.filename.slice(0, -3);
- return fs.readFileSync(dirname + '/' + filename, 'utf8');
- };
-
- /**
- * Comb a file and compare the result with expected.
- * If `expected` is not defined, check that file's content does not change
- * after combing.
- * File names should be relative to test suite's folder.
- * @param {String} input Name of file that should be combed
- * @param {String} [expected] Name of file with expected content
- */
- this.shouldBeEqual = function(input, expected) {
- var syntax = input.split('.').pop();
- input = this.readFile(input);
- expected = expected ? this.readFile(expected) : input;
- assert.equal(this.comb.processString(input, { syntax: syntax }), expected);
- };
-
- /**
- * Detect options in a file and compare result with expected.
- * File names should be relative to test suite's folder.
- * @param {Array} options List of options that should be detected
- * @param {String} input Name of template file
- * @param {Object} expected Expected config with detected options
- */
- this.shouldDetect = function(options, input, expected) {
- // We need to “sort” the input and expected objects, as their order may vary
- function sortObject(o) {
- var sorted = {};
- var key = [];
- var a = [];
-
- for (key in o) {
- if (o.hasOwnProperty(key)) {
- a.push(key);
- }
- }
-
- a.sort();
-
- for (key = 0; key < a.length; key++) {
- sorted[a[key]] = o[a[key]];
- }
- return sorted;
- }
- assert.equal(
- JSON.stringify(sortObject(Comb.detectInString(input, options))),
- JSON.stringify(sortObject(expected))
- );
- };
-});
-
-mocha.run(function(failures) {
- process.on('exit', function() {
- process.exit(failures);
- });
-});
-
diff --git a/node_modules/csscomb/test/options/always-semicolon-less.js b/node_modules/csscomb/test/options/always-semicolon-less.js
deleted file mode 100644
index b366c12..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-less.js
+++ /dev/null
@@ -1,54 +0,0 @@
-describe('options/always-semicolon (scss)', function() {
- beforeEach(function() {
- this.filename = __filename;
- this.comb.configure({ 'always-semicolon': true });
- });
-
- it('Should not add semicolon to condition (single-line style)', function() {
- this.shouldBeEqual('condition.less');
- });
-
- it('Should not add semicolon to condition (multi-line style)', function() {
- this.shouldBeEqual('condition-multiline.less');
- });
-
- it('Should add semicolon to last included mixin if missing. Test 1 (single-line style)', function() {
- this.shouldBeEqual('include-1.less', 'include-1.expected.less');
- });
-
- it('Should add semicolon to last included mixin if missing. Test 1 (multi-line style)', function() {
- this.shouldBeEqual('include-1-multiline.less', 'include-1-multiline.expected.less');
- });
-
- it('Should add semicolon to last included mixin if missing. Test 2 (single-line style)', function() {
- this.shouldBeEqual('include-2.less', 'include-2.expected.less');
- });
-
- it('Should add semicolon to last included mixin if missing. Test 2 (multi-line style)', function() {
- this.shouldBeEqual('include-2-multiline.less', 'include-2-multiline.expected.less');
- });
-
- it('Should add semicolon to last included mixin if missing. Test 3 (single-line style)', function() {
- this.shouldBeEqual('include-3.less', 'include-3.expected.less');
- });
-
- it('Should add semicolon to last included mixin if missing. Test 3 (multi-line style)', function() {
- this.shouldBeEqual('include-3-multiline.less', 'include-3-multiline.expected.less');
- });
-
- it('Should add semicolon to last included mixin if missing. Test 4 (single-line style)', function() {
- this.shouldBeEqual('include-4.less', 'include-4.expected.less');
- });
-
- it('Should add semicolon to last included mixin if missing. Test 4 (multi-line style)', function() {
- this.shouldBeEqual('include-4-multiline.less', 'include-4-multiline.expected.less');
- });
-
- it('Should add semicolon to last included mixin if missing. Test 5 (single-line style)', function() {
- this.shouldBeEqual('include-5.less', 'include-5.expected.less');
- });
-
- it('Should add semicolon to last included mixin if missing. Test 5 (multi-line style)', function() {
- this.shouldBeEqual('include-5-multiline.less', 'include-5-multiline.expected.less');
- });
-});
diff --git a/node_modules/csscomb/test/options/always-semicolon-less/condition-multiline.less b/node_modules/csscomb/test/options/always-semicolon-less/condition-multiline.less
deleted file mode 100644
index b307117..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-less/condition-multiline.less
+++ /dev/null
@@ -1,6 +0,0 @@
-div {
- @color: tomato;
- when (@color = tomato) {
- top: 0;
- }
- }
diff --git a/node_modules/csscomb/test/options/always-semicolon-less/condition.less b/node_modules/csscomb/test/options/always-semicolon-less/condition.less
deleted file mode 100644
index c0c4950..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-less/condition.less
+++ /dev/null
@@ -1 +0,0 @@
-div { @color: tomato; when (@color = tomato) { top: 0; } }
diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-1-multiline.expected.less b/node_modules/csscomb/test/options/always-semicolon-less/include-1-multiline.expected.less
deleted file mode 100644
index 77cf666..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-less/include-1-multiline.expected.less
+++ /dev/null
@@ -1,4 +0,0 @@
-div {
- color: tomato;
- .nani;
- }
diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-1-multiline.less b/node_modules/csscomb/test/options/always-semicolon-less/include-1-multiline.less
deleted file mode 100644
index 9daab17..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-less/include-1-multiline.less
+++ /dev/null
@@ -1,4 +0,0 @@
-div {
- color: tomato;
- .nani
- }
diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-1.expected.less b/node_modules/csscomb/test/options/always-semicolon-less/include-1.expected.less
deleted file mode 100644
index 9058edc..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-less/include-1.expected.less
+++ /dev/null
@@ -1 +0,0 @@
-div { color: tomato; .nani; }
diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-1.less b/node_modules/csscomb/test/options/always-semicolon-less/include-1.less
deleted file mode 100644
index 4e47017..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-less/include-1.less
+++ /dev/null
@@ -1 +0,0 @@
-div { color: tomato; .nani }
diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-2-multiline.expected.less b/node_modules/csscomb/test/options/always-semicolon-less/include-2-multiline.expected.less
deleted file mode 100644
index 6877e14..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-less/include-2-multiline.expected.less
+++ /dev/null
@@ -1,4 +0,0 @@
-div {
- color: tomato;
- .nani(2px);
- }
diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-2-multiline.less b/node_modules/csscomb/test/options/always-semicolon-less/include-2-multiline.less
deleted file mode 100644
index c419ae5..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-less/include-2-multiline.less
+++ /dev/null
@@ -1,4 +0,0 @@
-div {
- color: tomato;
- .nani(2px)
- }
diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-2.expected.less b/node_modules/csscomb/test/options/always-semicolon-less/include-2.expected.less
deleted file mode 100644
index 3fb4335..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-less/include-2.expected.less
+++ /dev/null
@@ -1 +0,0 @@
-div { color: tomato; .nani(2px); }
diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-2.less b/node_modules/csscomb/test/options/always-semicolon-less/include-2.less
deleted file mode 100644
index 1ed55fe..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-less/include-2.less
+++ /dev/null
@@ -1 +0,0 @@
-div { color: tomato; .nani(2px) }
diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-3-multiline.expected.less b/node_modules/csscomb/test/options/always-semicolon-less/include-3-multiline.expected.less
deleted file mode 100644
index d51df78..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-less/include-3-multiline.expected.less
+++ /dev/null
@@ -1,4 +0,0 @@
-div {
- color: tomato;
- .nani(2px) !important;
- }
diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-3-multiline.less b/node_modules/csscomb/test/options/always-semicolon-less/include-3-multiline.less
deleted file mode 100644
index 4d628b8..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-less/include-3-multiline.less
+++ /dev/null
@@ -1,4 +0,0 @@
-div {
- color: tomato;
- .nani(2px) !important
- }
diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-3.expected.less b/node_modules/csscomb/test/options/always-semicolon-less/include-3.expected.less
deleted file mode 100644
index 117678f..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-less/include-3.expected.less
+++ /dev/null
@@ -1 +0,0 @@
-div { color: tomato; .nani(2px) !important; }
diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-3.less b/node_modules/csscomb/test/options/always-semicolon-less/include-3.less
deleted file mode 100644
index 3098898..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-less/include-3.less
+++ /dev/null
@@ -1 +0,0 @@
-div { color: tomato; .nani(2px) !important }
diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-4-multiline.expected.less b/node_modules/csscomb/test/options/always-semicolon-less/include-4-multiline.expected.less
deleted file mode 100644
index 1efba9e..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-less/include-4-multiline.expected.less
+++ /dev/null
@@ -1,4 +0,0 @@
-div {
- color: tomato;
- #bundle > .button;
- }
diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-4-multiline.less b/node_modules/csscomb/test/options/always-semicolon-less/include-4-multiline.less
deleted file mode 100644
index f16812d..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-less/include-4-multiline.less
+++ /dev/null
@@ -1,4 +0,0 @@
-div {
- color: tomato;
- #bundle > .button
- }
diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-4.expected.less b/node_modules/csscomb/test/options/always-semicolon-less/include-4.expected.less
deleted file mode 100644
index 1b3c6d8..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-less/include-4.expected.less
+++ /dev/null
@@ -1 +0,0 @@
-div { color: tomato; #bundle > .button; }
diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-4.less b/node_modules/csscomb/test/options/always-semicolon-less/include-4.less
deleted file mode 100644
index 9221814..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-less/include-4.less
+++ /dev/null
@@ -1 +0,0 @@
-div { color: tomato; #bundle > .button }
diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-5-multiline.expected.less b/node_modules/csscomb/test/options/always-semicolon-less/include-5-multiline.expected.less
deleted file mode 100644
index 4c15e42..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-less/include-5-multiline.expected.less
+++ /dev/null
@@ -1,4 +0,0 @@
-div {
- @color: tomato;
- #bundle > .button (@color);
- }
diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-5-multiline.less b/node_modules/csscomb/test/options/always-semicolon-less/include-5-multiline.less
deleted file mode 100644
index 15d03fc..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-less/include-5-multiline.less
+++ /dev/null
@@ -1,4 +0,0 @@
-div {
- @color: tomato;
- #bundle > .button (@color)
- }
diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-5.expected.less b/node_modules/csscomb/test/options/always-semicolon-less/include-5.expected.less
deleted file mode 100644
index 718c5c5..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-less/include-5.expected.less
+++ /dev/null
@@ -1 +0,0 @@
-div { @color: tomato; #bundle > .button (@color); }
diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-5.less b/node_modules/csscomb/test/options/always-semicolon-less/include-5.less
deleted file mode 100644
index 6bf447c..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-less/include-5.less
+++ /dev/null
@@ -1 +0,0 @@
-div { @color: tomato; #bundle > .button (@color) }
diff --git a/node_modules/csscomb/test/options/always-semicolon-sass.js b/node_modules/csscomb/test/options/always-semicolon-sass.js
deleted file mode 100644
index 3b96922..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-sass.js
+++ /dev/null
@@ -1,10 +0,0 @@
-describe('options/always-semicolon (scss)', function() {
- beforeEach(function() {
- this.filename = __filename;
- this.comb.configure({ 'always-semicolon': true });
- });
-
- it('Should not add semicolon', function() {
- this.shouldBeEqual('test.sass');
- });
-});
diff --git a/node_modules/csscomb/test/options/always-semicolon-sass/test.sass b/node_modules/csscomb/test/options/always-semicolon-sass/test.sass
deleted file mode 100644
index 6284097..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-sass/test.sass
+++ /dev/null
@@ -1,7 +0,0 @@
-a
- color: tomato
- top: 0
-
- p
- a: b
- c:d
diff --git a/node_modules/csscomb/test/options/always-semicolon-scss.js b/node_modules/csscomb/test/options/always-semicolon-scss.js
deleted file mode 100644
index 48ec6ec..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-scss.js
+++ /dev/null
@@ -1,62 +0,0 @@
-describe('options/always-semicolon (scss)', function() {
- beforeEach(function() {
- this.filename = __filename;
- this.comb.configure({ 'always-semicolon': true });
- });
-
- it('Should not add semicolon if last value is block (singl-line style)', function() {
- this.shouldBeEqual('block-value.scss');
- });
-
- it('Should not add semicolon if last value is block (multi-line style)', function() {
- this.shouldBeEqual('block-value-multiline.scss');
- });
-
- it('Should add semicolon to last included mixin if missing. Test 1 (single-line style)', function() {
- this.shouldBeEqual('include-1.scss', 'include-1.expected.scss');
- });
-
- it('Should add semicolon to last included mixin if missing. Test 1 (multi-line style)', function() {
- this.shouldBeEqual('include-1-multiline.scss', 'include-1-multiline.expected.scss');
- });
-
- it('Should add semicolon to last included mixin if missing. Test 2 (single-line style)', function() {
- this.shouldBeEqual('include-2.scss', 'include-2.expected.scss');
- });
-
- it('Should add semicolon to last included mixin if missing. Test 2 (multi-line style)', function() {
- this.shouldBeEqual('include-2-multiline.scss', 'include-2-multiline.expected.scss');
- });
-
- it('Should not add semicolon to last included mixin if there is a block (single-line style)', function() {
- this.shouldBeEqual('block-include.scss');
- });
-
- it('Should not add semicolon to last included mixin if there is a block (multi-line style)', function() {
- this.shouldBeEqual('block-include-multiline.scss');
- });
-
- it('Should add semicolon to last extend if missing (single-line style)', function() {
- this.shouldBeEqual('extend.scss', 'extend.expected.scss');
- });
-
- it('Should add semicolon to last extend if missing (multi-line style)', function() {
- this.shouldBeEqual('extend-multiline.scss', 'extend-multiline.expected.scss');
- });
-
- it('Should not add semicolon to condition (single-line style)', function() {
- this.shouldBeEqual('condition.scss');
- });
-
- it('Should not add semicolon to condition (multi-line style)', function() {
- this.shouldBeEqual('condition-multiline.scss');
- });
-
- it('Should not add semicolon to loop (single-line style)', function() {
- this.shouldBeEqual('loop.scss');
- });
-
- it('Should not add semicolon to loop (multi-line style)', function() {
- this.shouldBeEqual('loop-multiline.scss');
- });
-});
diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/block-include-multiline.scss b/node_modules/csscomb/test/options/always-semicolon-scss/block-include-multiline.scss
deleted file mode 100644
index a9e5aa9..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-scss/block-include-multiline.scss
+++ /dev/null
@@ -1,7 +0,0 @@
-div {
- color: tomato;
- @include nani {
- top: 0;
- content: '';
- }
- }
diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/block-include.scss b/node_modules/csscomb/test/options/always-semicolon-scss/block-include.scss
deleted file mode 100644
index 251fa78..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-scss/block-include.scss
+++ /dev/null
@@ -1 +0,0 @@
-div { color: tomato; @include nani { top: 0; content: ''; } }
diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/block-value-multiline.scss b/node_modules/csscomb/test/options/always-semicolon-scss/block-value-multiline.scss
deleted file mode 100644
index f654043..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-scss/block-value-multiline.scss
+++ /dev/null
@@ -1,7 +0,0 @@
-div {
- color: tomato;
- font: {
- family: fantasy;
- size: 16px;
- }
- }
diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/block-value.scss b/node_modules/csscomb/test/options/always-semicolon-scss/block-value.scss
deleted file mode 100644
index 15f19e2..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-scss/block-value.scss
+++ /dev/null
@@ -1 +0,0 @@
-div { color: tomato; font: { family: fantasy; size: 16px; } }
diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/condition-multiline.scss b/node_modules/csscomb/test/options/always-semicolon-scss/condition-multiline.scss
deleted file mode 100644
index 7aeb8af..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-scss/condition-multiline.scss
+++ /dev/null
@@ -1,6 +0,0 @@
-div {
- $color: tomato;
- @if $color == tomato {
- top: 0;
- }
- }
diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/condition.scss b/node_modules/csscomb/test/options/always-semicolon-scss/condition.scss
deleted file mode 100644
index 692cbca..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-scss/condition.scss
+++ /dev/null
@@ -1 +0,0 @@
-div { $color: tomato; @if $color == tomato { top: 0; } }
diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/extend-multiline.expected.scss b/node_modules/csscomb/test/options/always-semicolon-scss/extend-multiline.expected.scss
deleted file mode 100644
index eaaa0c7..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-scss/extend-multiline.expected.scss
+++ /dev/null
@@ -1,4 +0,0 @@
-div {
- color: tomato;
- @extend .nani;
- }
diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/extend-multiline.scss b/node_modules/csscomb/test/options/always-semicolon-scss/extend-multiline.scss
deleted file mode 100644
index 6493e72..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-scss/extend-multiline.scss
+++ /dev/null
@@ -1,4 +0,0 @@
-div {
- color: tomato;
- @extend .nani
- }
diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/extend.expected.scss b/node_modules/csscomb/test/options/always-semicolon-scss/extend.expected.scss
deleted file mode 100644
index ec45b2e..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-scss/extend.expected.scss
+++ /dev/null
@@ -1 +0,0 @@
-div { color: tomato; @extend .nani; }
diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/extend.scss b/node_modules/csscomb/test/options/always-semicolon-scss/extend.scss
deleted file mode 100644
index 8f545cc..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-scss/extend.scss
+++ /dev/null
@@ -1 +0,0 @@
-div { color: tomato; @extend .nani }
diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/include-1-multiline.expected.scss b/node_modules/csscomb/test/options/always-semicolon-scss/include-1-multiline.expected.scss
deleted file mode 100644
index d8db3e3..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-scss/include-1-multiline.expected.scss
+++ /dev/null
@@ -1,4 +0,0 @@
-div {
- color: tomato;
- @include nani;
- }
diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/include-1-multiline.scss b/node_modules/csscomb/test/options/always-semicolon-scss/include-1-multiline.scss
deleted file mode 100644
index bf95505..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-scss/include-1-multiline.scss
+++ /dev/null
@@ -1,4 +0,0 @@
-div {
- color: tomato;
- @include nani
- }
diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/include-1.expected.scss b/node_modules/csscomb/test/options/always-semicolon-scss/include-1.expected.scss
deleted file mode 100644
index 2feaaec..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-scss/include-1.expected.scss
+++ /dev/null
@@ -1 +0,0 @@
-div { color: tomato; @include nani; }
diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/include-1.scss b/node_modules/csscomb/test/options/always-semicolon-scss/include-1.scss
deleted file mode 100644
index 204e35d..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-scss/include-1.scss
+++ /dev/null
@@ -1 +0,0 @@
-div { color: tomato; @include nani }
diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/include-2-multiline.expected.scss b/node_modules/csscomb/test/options/always-semicolon-scss/include-2-multiline.expected.scss
deleted file mode 100644
index e0c3600..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-scss/include-2-multiline.expected.scss
+++ /dev/null
@@ -1,4 +0,0 @@
-div {
- color: tomato;
- @include nani(10);
- }
diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/include-2-multiline.scss b/node_modules/csscomb/test/options/always-semicolon-scss/include-2-multiline.scss
deleted file mode 100644
index ad05456..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-scss/include-2-multiline.scss
+++ /dev/null
@@ -1,4 +0,0 @@
-div {
- color: tomato;
- @include nani(10)
- }
diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/include-2.expected.scss b/node_modules/csscomb/test/options/always-semicolon-scss/include-2.expected.scss
deleted file mode 100644
index 8771956..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-scss/include-2.expected.scss
+++ /dev/null
@@ -1 +0,0 @@
-div { color: tomato; @include nani(10); }
diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/include-2.scss b/node_modules/csscomb/test/options/always-semicolon-scss/include-2.scss
deleted file mode 100644
index f5bccc9..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-scss/include-2.scss
+++ /dev/null
@@ -1 +0,0 @@
-div { color: tomato; @include nani(10) }
diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/loop-multiline.scss b/node_modules/csscomb/test/options/always-semicolon-scss/loop-multiline.scss
deleted file mode 100644
index 5768e29..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-scss/loop-multiline.scss
+++ /dev/null
@@ -1,6 +0,0 @@
-div {
- color: tomato;
- @while 1 > 2 {
- top: 0;
- }
- }
diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/loop.scss b/node_modules/csscomb/test/options/always-semicolon-scss/loop.scss
deleted file mode 100644
index afb46f9..0000000
--- a/node_modules/csscomb/test/options/always-semicolon-scss/loop.scss
+++ /dev/null
@@ -1 +0,0 @@
-div { color: tomato; @while 1 > 2 { top: 0; } }
diff --git a/node_modules/csscomb/test/options/always-semicolon.js b/node_modules/csscomb/test/options/always-semicolon.js
deleted file mode 100644
index a20f8d3..0000000
--- a/node_modules/csscomb/test/options/always-semicolon.js
+++ /dev/null
@@ -1,125 +0,0 @@
-var assert = require('assert');
-
-describe('options/always-semicolon', function() {
- it('Should add semicolon for last property if missing. Test 1', function() {
- this.comb.configure({ 'always-semicolon': true });
- assert.equal(
- this.comb.processString(
- 'div { height: 0 }'
- ),
- 'div { height: 0; }'
- );
- });
-
- it('Should add semicolon for last property if missing. Test 2', function() {
- this.comb.configure({ 'always-semicolon': true });
- assert.equal(
- this.comb.processString(
- 'div {\nheight: 0\n}'
- ),
- 'div {\nheight: 0;\n}'
- );
- });
-
- it('Should add semicolon for last property if missing. Test 3', function() {
- this.comb.configure({ 'always-semicolon': true });
- assert.equal(
- this.comb.processString(
- 'div {height: 0}'
- ),
- 'div {height: 0;}'
- );
- });
-
- it('Should add semicolon for last property if missing. Test 4', function() {
- this.comb.configure({ 'always-semicolon': true });
- assert.equal(
- this.comb.processString(
- 'div {\nheight: 0 /* Comment */\n}'
- ),
- 'div {\nheight: 0; /* Comment */\n}'
- );
- });
-
- it('Should add semicolon for last property if missing. Test 5', function() {
- this.comb.configure({ 'always-semicolon': true });
- assert.equal(
- this.comb.processString(
- 'div {\ntop: 1px;\nheight: 0 /* 1comment */ /* 2comment */\n}'
- ),
- 'div {\ntop: 1px;\nheight: 0; /* 1comment */ /* 2comment */\n}'
- );
- });
-
- it('Should detect semicolon for last property. Test 1', function() {
- this.shouldDetect(
- ['always-semicolon'],
- 'div { height: 0 }',
- {
- 'always-semicolon': false
- }
- );
- });
-
- it('Should detect semicolon for last property. Test 2', function() {
- this.shouldDetect(
- ['always-semicolon'],
- 'div { height: 0; }',
- {
- 'always-semicolon': true
- }
- );
- });
-
- it('Should detect semicolon for last property. Test 3', function() {
- this.shouldDetect(
- ['always-semicolon'],
- 'div { height: 0; } div { height: 0 }',
- {
- 'always-semicolon': true
- }
- );
- });
-
- it('Should detect semicolon for last property. Test 4', function() {
- this.shouldDetect(
- ['always-semicolon'],
- 'div { height: 0 } div { height: 0; } div { height: 0 }',
- {
- 'always-semicolon': false
- }
- );
- });
-
- it('Should detect semicolon for last property. Test 5', function() {
- this.shouldDetect(
- ['always-semicolon'],
- 'div {\nheight: 0 /* Comment */\n} ' +
- 'div { height: 0; }' +
- 'div {\ntop: 1px;\nheight: 0 /* 1comment */ /* 2comment */\n}',
- {
- 'always-semicolon': false
- }
- );
- });
-
-
- it('Should detect semicolon for last property. Test 6', function() {
- this.shouldDetect(
- ['always-semicolon'],
- 'a{\n border:0;\n}',
- {
- 'always-semicolon': true
- }
- );
- });
-
- it('Should not detect semicolon for last property if there are no properties', function() {
- this.shouldDetect(
- ['always-semicolon'],
- 'div {}',
- {}
- );
- });
-
-});
diff --git a/node_modules/csscomb/test/options/block-indent-sass.js b/node_modules/csscomb/test/options/block-indent-sass.js
deleted file mode 100644
index 33b6add..0000000
--- a/node_modules/csscomb/test/options/block-indent-sass.js
+++ /dev/null
@@ -1,21 +0,0 @@
-describe('options/block-indent (sass):', function() {
- beforeEach(function() {
- this.filename = __filename;
- });
-
- it('First level ruleset\'s block', function() {
- this.comb.configure({ 'block-indent': 2 });
- this.shouldBeEqual('block.sass', 'block.expected.sass');
- });
-
- it('Nested ruleset', function() {
- this.comb.configure({ 'block-indent': 2 });
- this.shouldBeEqual('nested-ruleset.sass', 'nested-ruleset.expected.sass');
- });
-
- it('Mixin', function() {
- this.comb.configure({ 'block-indent': 4 });
- this.shouldBeEqual('mixin.sass', 'mixin.expected.sass');
- });
-});
-
diff --git a/node_modules/csscomb/test/options/block-indent-sass/block.expected.sass b/node_modules/csscomb/test/options/block-indent-sass/block.expected.sass
deleted file mode 100644
index ddae383..0000000
--- a/node_modules/csscomb/test/options/block-indent-sass/block.expected.sass
+++ /dev/null
@@ -1,6 +0,0 @@
-a
- color: tomato
- top: 0
-
-p
- bottom: 0
diff --git a/node_modules/csscomb/test/options/block-indent-sass/block.sass b/node_modules/csscomb/test/options/block-indent-sass/block.sass
deleted file mode 100644
index 9be6816..0000000
--- a/node_modules/csscomb/test/options/block-indent-sass/block.sass
+++ /dev/null
@@ -1,6 +0,0 @@
-a
- color: tomato
- top: 0
-
-p
- bottom: 0
diff --git a/node_modules/csscomb/test/options/block-indent-sass/mixin.expected.sass b/node_modules/csscomb/test/options/block-indent-sass/mixin.expected.sass
deleted file mode 100644
index f935113..0000000
--- a/node_modules/csscomb/test/options/block-indent-sass/mixin.expected.sass
+++ /dev/null
@@ -1,8 +0,0 @@
-@mixin sexy-border($color, $width: 1px)
- border:
- color: $color
- width: $width
- style: dashed
-
-p
- +sexy-border(blue)
diff --git a/node_modules/csscomb/test/options/block-indent-sass/mixin.sass b/node_modules/csscomb/test/options/block-indent-sass/mixin.sass
deleted file mode 100644
index d25771d..0000000
--- a/node_modules/csscomb/test/options/block-indent-sass/mixin.sass
+++ /dev/null
@@ -1,8 +0,0 @@
-@mixin sexy-border($color, $width: 1px)
- border:
- color: $color
- width: $width
- style: dashed
-
-p
- +sexy-border(blue)
diff --git a/node_modules/csscomb/test/options/block-indent-sass/nested-ruleset.expected.sass b/node_modules/csscomb/test/options/block-indent-sass/nested-ruleset.expected.sass
deleted file mode 100644
index 2c7edc6..0000000
--- a/node_modules/csscomb/test/options/block-indent-sass/nested-ruleset.expected.sass
+++ /dev/null
@@ -1,9 +0,0 @@
-a
- color: tomato
- top: 0
-
- p
- bottom: 0
-
- &:hover
- color: yellow
diff --git a/node_modules/csscomb/test/options/block-indent-sass/nested-ruleset.sass b/node_modules/csscomb/test/options/block-indent-sass/nested-ruleset.sass
deleted file mode 100644
index 8567d2e..0000000
--- a/node_modules/csscomb/test/options/block-indent-sass/nested-ruleset.sass
+++ /dev/null
@@ -1,9 +0,0 @@
-a
- color: tomato
- top: 0
-
- p
- bottom: 0
-
- &:hover
- color: yellow
diff --git a/node_modules/csscomb/test/options/block-indent-scss.js b/node_modules/csscomb/test/options/block-indent-scss.js
deleted file mode 100644
index 34130dc..0000000
--- a/node_modules/csscomb/test/options/block-indent-scss.js
+++ /dev/null
@@ -1,10 +0,0 @@
-describe('options/block-indent (scss):', function() {
- beforeEach(function() {
- this.filename = __filename;
- });
-
- it('Issue 213', function() {
- this.comb.configure({ 'block-indent': 2 });
- this.shouldBeEqual('nested-include.scss', 'nested-include.expected.scss');
- });
-});
diff --git a/node_modules/csscomb/test/options/block-indent-scss/nested-include.expected.scss b/node_modules/csscomb/test/options/block-indent-scss/nested-include.expected.scss
deleted file mode 100644
index c419883..0000000
--- a/node_modules/csscomb/test/options/block-indent-scss/nested-include.expected.scss
+++ /dev/null
@@ -1,5 +0,0 @@
-li{
- @include respond-to(mobile){ float: none; }
- float: left;
- width: 25%;
- }
diff --git a/node_modules/csscomb/test/options/block-indent-scss/nested-include.scss b/node_modules/csscomb/test/options/block-indent-scss/nested-include.scss
deleted file mode 100644
index 93504be..0000000
--- a/node_modules/csscomb/test/options/block-indent-scss/nested-include.scss
+++ /dev/null
@@ -1,5 +0,0 @@
-li{
- @include respond-to(mobile){ float: none; }
- float: left;
- width: 25%;
-}
diff --git a/node_modules/csscomb/test/options/block-indent.js b/node_modules/csscomb/test/options/block-indent.js
deleted file mode 100644
index 9123961..0000000
--- a/node_modules/csscomb/test/options/block-indent.js
+++ /dev/null
@@ -1,66 +0,0 @@
-describe('options/block-indent:', function() {
- beforeEach(function() {
- this.filename = __filename;
- });
-
- it('Array value => should not change anything', function() {
- this.comb.configure({ 'block-indent': ['', ' '] });
- this.shouldBeEqual('test.css');
- });
-
- it('Invalid string value => should not change anything', function() {
- this.comb.configure({ 'block-indent': ' nani ' });
- this.shouldBeEqual('test.css');
- });
-
- it('Float number value => should not change anything', function() {
- this.comb.configure({ 'block-indent': 3.5 });
- this.shouldBeEqual('test.css');
- });
-
- it('Integer value => should set proper number of spaces', function() {
- this.comb.configure({ 'block-indent': 0 });
- this.shouldBeEqual('test.css', 'test.expected.css');
- });
-
- it('Valid string value => should set proper number of spaces', function() {
- this.comb.configure({ 'block-indent': ' ' });
- this.shouldBeEqual('test.css', 'test-2.expected.css');
- });
-
- it('Should detect nothing with an empty block, test 1', function() {
- this.shouldDetect(
- ['block-indent'],
- 'a{ }',
- {}
- );
- });
-
- it('Should detect nothing with an empty block, test 2', function() {
- this.shouldDetect(
- ['block-indent'],
- 'a{}',
- {}
- );
- });
-
- it('Should detect correct number of spaces', function() {
- this.shouldDetect(
- ['block-indent'],
- 'a{\n top: 0;\n color: tomato;\n}',
- { 'block-indent': ' ' }
- );
- });
-
- it('Should detect no indent for one-line code', function() {
- this.shouldDetect(
- ['block-indent'],
- 'a{ top: 0; color: tomato; }',
- {}
- );
- });
- it('Valid string value => should set proper space after combnator', function() {
- this.comb.configure({ 'block-indent': ' ', 'space-before-closing-brace': '\n' });
- this.shouldBeEqual('test.css', 'test-3.expected.css');
- });
-});
diff --git a/node_modules/csscomb/test/options/block-indent/test-2.expected.css b/node_modules/csscomb/test/options/block-indent/test-2.expected.css
deleted file mode 100644
index 467a932..0000000
--- a/node_modules/csscomb/test/options/block-indent/test-2.expected.css
+++ /dev/null
@@ -1,30 +0,0 @@
-a {color: tomato; top: 0;}
-
-a { color: tomato;
- top: 0; }
-
-a { color: tomato;
- top: 0; }
-
-a {
- color: tomato;
- top: 0; }
-
-a {
- color: tomato;
- top: 0;
- }
-
-a {
- color: tomato;
- top: 0;
- }
-
-@media print { a {color: tomato; top: 0; } }
-
-@media print {
- a {
- color: tomato;
- top: 0;
- }
- }
diff --git a/node_modules/csscomb/test/options/block-indent/test-3.expected.css b/node_modules/csscomb/test/options/block-indent/test-3.expected.css
deleted file mode 100644
index 684ff98..0000000
--- a/node_modules/csscomb/test/options/block-indent/test-3.expected.css
+++ /dev/null
@@ -1,36 +0,0 @@
-a {color: tomato; top: 0;
-}
-
-a { color: tomato;
- top: 0;
-}
-
-a { color: tomato;
- top: 0;
-}
-
-a {
- color: tomato;
- top: 0;
-}
-
-a {
- color: tomato;
- top: 0;
-}
-
-a {
- color: tomato;
- top: 0;
-}
-
-@media print { a {color: tomato; top: 0;
- }
-}
-
-@media print {
- a {
- color: tomato;
- top: 0;
- }
-}
diff --git a/node_modules/csscomb/test/options/block-indent/test.css b/node_modules/csscomb/test/options/block-indent/test.css
deleted file mode 100644
index b1b52eb..0000000
--- a/node_modules/csscomb/test/options/block-indent/test.css
+++ /dev/null
@@ -1,30 +0,0 @@
-a {color: tomato; top: 0;}
-
-a { color: tomato;
-top: 0; }
-
-a { color: tomato;
- top: 0; }
-
-a {
-color: tomato;
-top: 0; }
-
-a {
-color: tomato;
-top: 0;
-}
-
- a {
- color: tomato;
- top: 0;
- }
-
-@media print { a {color: tomato; top: 0; } }
-
- @media print {
-a {
- color: tomato;
- top: 0;
- }
- }
diff --git a/node_modules/csscomb/test/options/block-indent/test.expected.css b/node_modules/csscomb/test/options/block-indent/test.expected.css
deleted file mode 100644
index 0c684ec..0000000
--- a/node_modules/csscomb/test/options/block-indent/test.expected.css
+++ /dev/null
@@ -1,30 +0,0 @@
-a {color: tomato; top: 0;}
-
-a { color: tomato;
-top: 0; }
-
-a { color: tomato;
-top: 0; }
-
-a {
-color: tomato;
-top: 0; }
-
-a {
-color: tomato;
-top: 0;
-}
-
-a {
-color: tomato;
-top: 0;
-}
-
-@media print { a {color: tomato; top: 0; } }
-
-@media print {
-a {
-color: tomato;
-top: 0;
-}
-}
diff --git a/node_modules/csscomb/test/options/color-case.js b/node_modules/csscomb/test/options/color-case.js
deleted file mode 100644
index e94af2f..0000000
--- a/node_modules/csscomb/test/options/color-case.js
+++ /dev/null
@@ -1,102 +0,0 @@
-var assert = require('assert');
-
-describe('options/color-case', function() {
- it('Should switch colors to upper case', function() {
- this.comb.configure({ 'color-case': 'upper' });
- assert.equal(
- this.comb.processString(
- 'div { color: #fff }'
- ),
- 'div { color: #FFF }'
- );
- });
-
- it('Should switch colors to lower case', function() {
- this.comb.configure({ 'color-case': 'lower' });
- assert.equal(
- this.comb.processString(
- 'div { color: #FFF }'
- ),
- 'div { color: #fff }'
- );
- });
-
- it('Should switch color-case in complex rules', function() {
- this.comb.configure({ 'color-case': 'lower' });
- assert.equal(
- this.comb.processString(
- 'div { background: url(img.png#RND) #E3E3E3 0 100% no-repeat;' +
- ' box-shadow: 1px 2px 3px 4px #F0F0F0 inset; }'
- ),
- 'div { background: url(img.png#RND) #e3e3e3 0 100% no-repeat;' +
- ' box-shadow: 1px 2px 3px 4px #f0f0f0 inset; }'
- );
- });
-
- it('Should not switch selector case', function() {
- this.comb.configure({ 'color-case': 'lower' });
- assert.equal(
- this.comb.processString(
- '#Header { color: #FFF }'
- ),
- '#Header { color: #fff }'
- );
- });
-
- it('Should detect uppercase color', function() {
- this.shouldDetect(
- ['color-case'],
- 'a { color: #F3F3F3 }',
- {
- 'color-case': 'upper'
- }
- );
- });
-
- it('Should detect lowercase color', function() {
- this.shouldDetect(
- ['color-case'],
- 'a { color: #f6f6f6 }',
- {
- 'color-case': 'lower'
- }
- );
- });
-
- it('Should detect uppercase color in a shorthand', function() {
- this.shouldDetect(
- ['color-case'],
- 'a { color: #FFF }',
- {
- 'color-case': 'upper'
- }
- );
- });
-
- it('Should detect lowercase color in a shorthand', function() {
- this.shouldDetect(
- ['color-case'],
- 'a { color: #fff }',
- {
- 'color-case': 'lower'
- }
- );
- });
-
- it('Shouldn’t detect color case if it contains only digits', function() {
- this.shouldDetect(
- ['color-case'],
- 'a { color: #333 }',
- {}
- );
- });
-
- it('Shouldn’t detect color case if it is in mixed case', function() {
- this.shouldDetect(
- ['color-case'],
- 'a { color: #fFfFfF }',
- {}
- );
- });
-
-});
diff --git a/node_modules/csscomb/test/options/color-shorthand.js b/node_modules/csscomb/test/options/color-shorthand.js
deleted file mode 100644
index d1708c0..0000000
--- a/node_modules/csscomb/test/options/color-shorthand.js
+++ /dev/null
@@ -1,70 +0,0 @@
-var assert = require('assert');
-
-describe('options/color-shorthand', function() {
- it('Should shrink hexadecimal colors to 3 symbols', function() {
- this.comb.configure({ 'color-shorthand': true });
- assert.equal(
- this.comb.processString(
- 'div { color: #aabbcc }'
- ),
- 'div { color: #abc }'
- );
- });
-
- it('Should expand hexadecimal colors to 6 symbols', function() {
- this.comb.configure({ 'color-shorthand': false });
- assert.equal(
- this.comb.processString(
- 'div { color: #7ad }'
- ),
- 'div { color: #77aadd }'
- );
- });
-
- it('Should save case while processing', function() {
- this.comb.configure({ 'color-shorthand': true });
- assert.equal(
- this.comb.processString(
- 'div { color: #fFAafF }'
- ),
- 'div { color: #fAf }'
- );
- });
-
-
- it('Should detect non-shorthanded color', function() {
- this.shouldDetect(
- ['color-shorthand'],
- 'a { color: #FF33EE }',
- {
- 'color-shorthand': false
- }
- );
- });
-
- it('Should detect shorthanded color', function() {
- this.shouldDetect(
- ['color-shorthand'],
- 'a { color: #fff }',
- {
- 'color-shorthand': true
- }
- );
- });
-
- it('Shouldn’t detect if a color is shorthanded if it can’t be shorthanded', function() {
- this.shouldDetect(
- ['color-shorthand'],
- 'a { color: #F3F3F3 }',
- {}
- );
- });
-
- it('Shouldn’t detect if a color is shorthanded if it is not a vhash', function() {
- this.shouldDetect(
- ['color-shorthand'],
- 'a { color: rgba(0,0,0,0.5) }',
- {}
- );
- });
-});
diff --git a/node_modules/csscomb/test/options/element-case-scss.js b/node_modules/csscomb/test/options/element-case-scss.js
deleted file mode 100644
index 468ffe2..0000000
--- a/node_modules/csscomb/test/options/element-case-scss.js
+++ /dev/null
@@ -1,10 +0,0 @@
-describe('options/element-case (scss):', function() {
- beforeEach(function() {
- this.filename = __filename;
- });
-
- it('Should not touch mixin names', function() {
- this.comb.configure({ 'element-case': 'lower' });
- this.shouldBeEqual('mixin.scss', 'mixin.expected.scss');
- });
-});
diff --git a/node_modules/csscomb/test/options/element-case-scss/mixin.expected.scss b/node_modules/csscomb/test/options/element-case-scss/mixin.expected.scss
deleted file mode 100644
index 8700a0e..0000000
--- a/node_modules/csscomb/test/options/element-case-scss/mixin.expected.scss
+++ /dev/null
@@ -1,3 +0,0 @@
-a {
- @include boxSizingContent();
-}
diff --git a/node_modules/csscomb/test/options/element-case-scss/mixin.scss b/node_modules/csscomb/test/options/element-case-scss/mixin.scss
deleted file mode 100644
index d2b5c33..0000000
--- a/node_modules/csscomb/test/options/element-case-scss/mixin.scss
+++ /dev/null
@@ -1,3 +0,0 @@
-A {
- @include boxSizingContent();
-}
diff --git a/node_modules/csscomb/test/options/element-case.js b/node_modules/csscomb/test/options/element-case.js
deleted file mode 100644
index fb95287..0000000
--- a/node_modules/csscomb/test/options/element-case.js
+++ /dev/null
@@ -1,99 +0,0 @@
-var assert = require('assert');
-
-describe('options/element-case', function() {
- it('Invalid String should not change case of elements', function() {
- this.comb.configure({ 'element-case': 'foobar' });
- assert.equal(
- this.comb.processString(
- 'LI a { color : red }'
- ),
- 'LI a { color : red }'
- );
- });
-
- it('Should switch tag name to upper case', function() {
- this.comb.configure({ 'element-case': 'upper' });
- assert.equal(
- this.comb.processString(
- 'div { color: #fff }'
- ),
- 'DIV { color: #fff }'
- );
- });
-
- it('Should switch tag name to lower case', function() {
- this.comb.configure({ 'element-case': 'lower' });
- assert.equal(
- this.comb.processString(
- 'DIV { color: #FFF }'
- ),
- 'div { color: #FFF }'
- );
- });
-
- it('Should switch element-case in complex rules', function() {
- this.comb.configure({ 'element-case': 'lower' });
- assert.equal(
- this.comb.processString(
- 'UL > LI > .foo:not(A) { color: red }'
- ),
- 'ul > li > .foo:not(a) { color: red }'
- );
- });
-
- it('Should detect lowercase elements', function() {
- this.shouldDetect(
- ['element-case'],
- 'a { color: red }',
- {
- 'element-case': 'lower'
- }
- );
- });
-
- it('Should detect uppercase elements', function() {
- this.shouldDetect(
- ['element-case'],
- 'A { color: red }',
- {
- 'element-case': 'upper'
- }
- );
- });
-
- it('Should detect lowercase elements in a long selector', function() {
- this.shouldDetect(
- ['element-case'],
- 'ul li:not(:hover) A { color: red }',
- {
- 'element-case': 'lower'
- }
- );
- });
-
- it('Should detect uppercase elements in a long selector', function() {
- this.shouldDetect(
- ['element-case'],
- 'ul .lol:not(LI) A { color: red }',
- {
- 'element-case': 'upper'
- }
- );
- });
-
- it('Shouldn’t detect case of elements in a mixed case', function() {
- this.shouldDetect(
- ['element-case'],
- 'aRtIcLe { color: red }',
- {}
- );
- });
-
- it('Shouldn’t detect case of elements when there are no such', function() {
- this.shouldDetect(
- ['element-case'],
- '*.lol { color: red }',
- {}
- );
- });
-});
diff --git a/node_modules/csscomb/test/options/eof-newline.js b/node_modules/csscomb/test/options/eof-newline.js
deleted file mode 100644
index ead5fcf..0000000
--- a/node_modules/csscomb/test/options/eof-newline.js
+++ /dev/null
@@ -1,69 +0,0 @@
-var assert = require('assert');
-
-describe('options/eof-newline', function() {
- it('Invalid value should not change trim trailing brac', function() {
- this.comb.configure({ 'eof-newline': 'foobar' });
- assert.equal(
- this.comb.processString('a { color: red } \n'),
- 'a { color: red } \n'
- );
- });
- it('Boolean true value should insert line-break at eof', function() {
- this.comb.configure({ 'eof-newline': true });
- assert.equal(
- this.comb.processString(
- 'a {color:red} '
- ),
- 'a {color:red} \n'
- );
- });
- it('Boolean false value should remove line-break from eof', function() {
- this.comb.configure({ 'eof-newline': false });
- assert.equal(
- this.comb.processString(
- 'a {color:red} \n'
- ),
- 'a {color:red} '
- );
- });
-
- it('Shouldn’t detect eof newline', function() {
- this.shouldDetect(
- ['eof-newline'],
- 'a { color: red }',
- {
- 'eof-newline': false
- }
- );
- });
-
- it('Should detect eof newline', function() {
- this.shouldDetect(
- ['eof-newline'],
- 'a { color: red }\n',
- {
- 'eof-newline': true
- }
- );
- });
-
- it('Shouldn’t detect eof newline with spaces at the end', function() {
- this.shouldDetect(
- ['eof-newline'],
- 'a { color: red } ',
- {
- 'eof-newline': false
- }
- );
- });
-
- it('Should detect eof newline with mixed spaces at the end', function() {
- this.shouldDetect(
- ['eof-newline'],
- 'a { color: red } \n ',
- {
- 'eof-newline': true
- }
- );
- });
-});
diff --git a/node_modules/csscomb/test/options/integral.js b/node_modules/csscomb/test/options/integral.js
deleted file mode 100644
index 624598d..0000000
--- a/node_modules/csscomb/test/options/integral.js
+++ /dev/null
@@ -1,28 +0,0 @@
-var assert = require('assert');
-
-describe('integral test', function() {
- beforeEach(function() {
- this.filename = __filename;
- });
-
- it('Process result must be equal to expected.css', function() {
- var config = this.Comb.getConfig('csscomb');
- this.comb.configure(config);
- this.shouldBeEqual('integral.css', 'integral.expected.css');
- });
-
- it('Issue 252', function() {
- var config = this.Comb.getConfig('csscomb');
- this.comb.configure(config);
- this.shouldBeEqual('issue-252.sass', 'issue-252.expected.sass');
- });
-
- it('Should detect everything in integral test', function() {
- var input = this.readFile('integral.expected.css');
- // Clone the required config object, otherwise other tests would fail
- var expected = JSON.parse(JSON.stringify(this.Comb.getConfig('csscomb')));
- delete expected['sort-order'];
- delete expected['exclude'];
- this.shouldDetect(undefined, input, expected);
- });
-});
diff --git a/node_modules/csscomb/test/options/integral/integral.css b/node_modules/csscomb/test/options/integral/integral.css
deleted file mode 100644
index cb280a3..0000000
--- a/node_modules/csscomb/test/options/integral/integral.css
+++ /dev/null
@@ -1,129 +0,0 @@
-/* foobar */
-@media all and (min-width:0px) {.radio-button_theme_normal .radio-button__radio:before
- {
- background: rgba(0,0,0,0.4);
- background: -webkit-linear-gradient(top, rgba(0,0,0,0.2) 0,rgba(0,0,0,0.4) 100%);
- background: -moz-linear-gradient(top, rgba(0,0,0,0.2) 0, rgba(0,0,0,0.4) 100%);
- background: -o-linear-gradient(top, rgba(0,0,0,0.2) 0,rgba(0,0,0,0.4) 100%);
- background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0,rgba(0,0,0,0.4) 100%);
-
- -moz-box-shadow: 0 1px 0 rgba(0,0,0,.07);
- box-shadow: 0 1px 0 rgba(0,0,0,.07);
- }
-
- /* :after — фон */
- .radio-button_theme_normal .radio-button__radio[class^="radio"]:after
- {
- background: #fFf;
- background: -webkit-linear-gradient(top, #FffFff 0,#eeeeEe 100%);
- background: -moz-linear-gradient(top, #fff 0, #eEe 100%);
- background: -o-linear-gradient(top, #fff 0,#eee 100%);
- background: linear-gradient(to bottom, #ffffff 0,#eeEeee 100%);
- content: "it's something different";
- }
-
- /* _focused_yes */
- .radio-button_theme_normal .radio-button__radio_focused_yes:before
- {
- content: "hello";
- -moz-box-shadow: 0 0 6px 2px rgba(255,204,0,.7), 0px 1px 0px rgba(0,0,0,.07);
- box-shadow: 0 0 6px 2px rgba(255,204,0,.7), 0px 1px 0px rgba(0,0,0,.07);
- }
-
-}
-
-/* Фигурные скобки. Вариант 1 */
-a, b, i /* foobar */ {
- padding:0;
- margin:0;
- }
- div p{
- font-size:1px;
- top:0;
- }
- div p em{
- font-style:italic;
- border-bottom:1px solid red;
-}
-
-@media all and (min-width:0px){
- /* В нажатом состоянии смещается вниз на 1px вся кнопка, текст не смещается */
- .button_pressed_yes.button_shadow_yes
- {
- top: 1px;
- }
-
- .button_pressed_yes.button_shadow_yes .button__text
- {
- top: 0;
- }
-}
-
-@media all /* media */
- { /* foobar */
-.input__control
-{
- color: #000;
- font-size: 100%;
- margin: 0;
- position: relative;
- width: 100%;
- z-index: 3;
-}}
-
-@media screen and (min-width: 35em) /* screen */,
- print and (min-width: 40em) /* print */ { /* foobar */
-.input__control
-{
- -moz-box-sizing: border-box;
- background: none;
- border: 0;
- box-sizing: border-box;
- outline: 0;
- padding: 0.4em 0;
-}
-}.empty-rule{}
-
-/* Фигурные скобки. Вариант 2 */
-div
-{
- padding:0;
- margin:0;
-}
- div p
- {
- font-size:1px;
- top:0;
- }
- div p em
- {
- font-style:italic;/* inline comment*/
- border-bottom:1px solid red;
- }
-
-/* Фигурные скобки. Вариант 3 */
-div {
- padding:0;
- margin:0;
-}
-/* foo */ div~p {
- font-size:1px;
- top:0
- }
- div> P +EM {
- /* upline comment*/
- font-style:italic;
-
- border-bottom:1px solid red /* trololo */ /* trololo */
- }
-
- a:not(B){
-top: 0;/* ololo */margin :0;}
- b
- {
-top :0/* trololo */;margin : 0}
-.empty-rule{}
-
-
-
-
diff --git a/node_modules/csscomb/test/options/integral/integral.expected.css b/node_modules/csscomb/test/options/integral/integral.expected.css
deleted file mode 100644
index f59d0a2..0000000
--- a/node_modules/csscomb/test/options/integral/integral.expected.css
+++ /dev/null
@@ -1,151 +0,0 @@
-/* foobar */
-@media all and (min-width:0)
-{
- .radio-button_theme_normal .radio-button__radio:before
- {
- background: rgba(0,0,0,.4);
- background: -webkit-linear-gradient(top, rgba(0,0,0,.2) 0,rgba(0,0,0,.4) 100%);
- background: -moz-linear-gradient(top, rgba(0,0,0,.2) 0, rgba(0,0,0,.4) 100%);
- background: -o-linear-gradient(top, rgba(0,0,0,.2) 0,rgba(0,0,0,.4) 100%);
- background: linear-gradient(to bottom, rgba(0,0,0,.2) 0,rgba(0,0,0,.4) 100%);
- -moz-box-shadow: 0 1px 0 rgba(0,0,0,.07);
- box-shadow: 0 1px 0 rgba(0,0,0,.07);
- }
-
- /* :after — фон */
- .radio-button_theme_normal .radio-button__radio[class^='radio']:after
- {
- content: 'it\'s something different';
-
- background: #fff;
- background: -webkit-linear-gradient(top, #fff 0,#eee 100%);
- background: -moz-linear-gradient(top, #fff 0, #eee 100%);
- background: -o-linear-gradient(top, #fff 0,#eee 100%);
- background: linear-gradient(to bottom, #fff 0,#eee 100%);
- }
-
- /* _focused_yes */
- .radio-button_theme_normal .radio-button__radio_focused_yes:before
- {
- content: 'hello';
-
- -moz-box-shadow: 0 0 6px 2px rgba(255,204,0,.7), 0 1px 0 rgba(0,0,0,.07);
- box-shadow: 0 0 6px 2px rgba(255,204,0,.7), 0 1px 0 rgba(0,0,0,.07);
- }
-}
-
-/* Фигурные скобки. Вариант 1 */
-a,
-b,
-i /* foobar */
-{
- margin: 0;
- padding: 0;
-}
-div p
-{
- font-size: 1px;
-
- top: 0;
-}
-div p em
-{
- font-style: italic;
-
- border-bottom: 1px solid red;
-}
-
-@media all and (min-width:0)
-{
- /* В нажатом состоянии смещается вниз на 1px вся кнопка, текст не смещается */
- .button_pressed_yes.button_shadow_yes
- {
- top: 1px;
- }
-
- .button_pressed_yes.button_shadow_yes .button__text
- {
- top: 0;
- }
-}
-
-@media all /* media */
-{
- /* foobar */
- .input__control
- {
- font-size: 100%;
-
- position: relative;
- z-index: 3;
-
- width: 100%;
- margin: 0;
-
- color: #000;
- }
-}
-
-@media screen and (min-width: 35em) /* screen */,
- print and (min-width: 40em) /* print */
-{
- /* foobar */
- .input__control
- {
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- padding: .4em 0;
-
- border: 0;
- outline: 0;
- background: none;
- }
-}
-
-/* Фигурные скобки. Вариант 2 */
-div
-{
- margin: 0;
- padding: 0;
-}
-div p
-{
- font-size: 1px;
-
- top: 0;
-}
-div p em
-{
- font-style: italic;/* inline comment*/
-
- border-bottom: 1px solid red;
-}
-
-/* Фигурные скобки. Вариант 3 */
-div
-{
- margin: 0;
- padding: 0;
-}
-/* foo */ div ~ p
-{
- font-size: 1px;
-
- top: 0;
-}
-div > p + em
-{
- /* upline comment*/
- font-style: italic;
-
- border-bottom: 1px solid red; /* trololo */ /* trololo */
-}
-
-a:not(b)
-{
- top: 0;/* ololo */margin: 0;
-}
-b
-{
- top: 0/* trololo */;margin: 0;
-}
diff --git a/node_modules/csscomb/test/options/integral/issue-252.expected.sass b/node_modules/csscomb/test/options/integral/issue-252.expected.sass
deleted file mode 100644
index f3fb55f..0000000
--- a/node_modules/csscomb/test/options/integral/issue-252.expected.sass
+++ /dev/null
@@ -1,11 +0,0 @@
-.partner
- font-size: 0
-
- color: transparent
-
- +inline-block
- &--motor
- background-image: url('/i/partners1.png')
- &--motor
- background-image: url('/i/partners2.png')
-
diff --git a/node_modules/csscomb/test/options/integral/issue-252.sass b/node_modules/csscomb/test/options/integral/issue-252.sass
deleted file mode 100644
index 6369eef..0000000
--- a/node_modules/csscomb/test/options/integral/issue-252.sass
+++ /dev/null
@@ -1,8 +0,0 @@
-.partner
- +inline-block
- font-size: 0
- color: transparent
- &--motor
- background-image: url('/i/partners1.png')
- &--motor
- background-image: url('/i/partners2.png')
diff --git a/node_modules/csscomb/test/options/leading-zero.js b/node_modules/csscomb/test/options/leading-zero.js
deleted file mode 100644
index dbd5c2b..0000000
--- a/node_modules/csscomb/test/options/leading-zero.js
+++ /dev/null
@@ -1,51 +0,0 @@
-var assert = require('assert');
-
-describe('options/leading-zero', function() {
- it('Should add leading zero in dimensions', function() {
- this.comb.configure({ 'leading-zero': true });
- assert.equal(
- this.comb.processString(
- 'div { margin: .5em }'
- ),
- 'div { margin: 0.5em }'
- );
- });
-
- it('Should remove leading zero in dimensions', function() {
- this.comb.configure({ 'leading-zero': false });
- assert.equal(
- this.comb.processString(
- 'div { margin: 0.5em }'
- ),
- 'div { margin: .5em }'
- );
- });
-
- it('Should detect leading zero option', function() {
- this.shouldDetect(
- ['leading-zero'],
- 'a { width: 0.5em }',
- {
- 'leading-zero': true
- }
- );
- });
-
- it('Should detect leading zero option set to false', function() {
- this.shouldDetect(
- ['leading-zero'],
- 'a { width: .5em }',
- {
- 'leading-zero': false
- }
- );
- });
-
- it('Shouldn’t detect leading zero option', function() {
- this.shouldDetect(
- ['leading-zero'],
- 'a { width: 10.5em }',
- {}
- );
- });
-});
diff --git a/node_modules/csscomb/test/options/quotes.js b/node_modules/csscomb/test/options/quotes.js
deleted file mode 100644
index 5ed3a89..0000000
--- a/node_modules/csscomb/test/options/quotes.js
+++ /dev/null
@@ -1,120 +0,0 @@
-var assert = require('assert');
-
-describe('options/quotes', function() {
- it('Invalid String should not change quotes', function() {
- this.comb.configure({ quotes: 3 });
- assert.equal(
- this.comb.processString(
- 'a { content: "" }' +
- 'b { content: \'\' }'
- ),
- 'a { content: "" }' +
- 'b { content: \'\' }'
- );
- });
-
- it('`single` value should set the quotes to single', function() {
- this.comb.configure({ quotes: 'single' });
- assert.equal(
- this.comb.processString(
- 'a { content: "" }' +
- 'b { content: \'\' }'
- ),
- 'a { content: \'\' }' +
- 'b { content: \'\' }'
- );
- });
-
- it('`double` value should set the quotes to double', function() {
- this.comb.configure({ quotes: 'double' });
- assert.equal(
- this.comb.processString(
- 'a { content: "" }' +
- 'b { content: \'\' }'
- ),
- 'a { content: "" }' +
- 'b { content: "" }'
- );
- });
-
- it('`double` value should set the quotes to double in attrs and urls', function() {
- this.comb.configure({ quotes: 'double' });
- assert.equal(
- this.comb.processString(
- 'a[class^=\'foo\'] { background: url(\'foo.png\') }'
- ),
- 'a[class^="foo"] { background: url("foo.png") }'
- );
- });
-
- it('`double` value should escape the unescaped double quotes on change', function() {
- this.comb.configure({ quotes: 'double' });
- assert.equal(
- this.comb.processString(
- 'a { content: "\\"" }' +
- 'b { content: \'"\' }'
- ),
- 'a { content: "\\"" }' +
- 'b { content: "\\"" }'
- );
- });
-
-
- it('`single` value should unescape the escaped double quotes on change', function() {
- this.comb.configure({ quotes: 'single' });
- assert.equal(
- this.comb.processString(
- 'a { content: "\\"" }'
- ),
- 'a { content: \'"\' }'
- );
- });
-
- it('Should not detect quotes when there are none', function() {
- this.shouldDetect(
- ['quotes'],
- 'a { color:red }',
- {}
- );
- });
-
- it('Should detect double quotes', function() {
- this.shouldDetect(
- ['quotes'],
- 'a { content: "foo" }',
- {
- quotes: 'double'
- }
- );
- });
-
- it('Should detect single quotes', function() {
- this.shouldDetect(
- ['quotes'],
- 'a { content: \'foo\' }',
- {
- quotes: 'single'
- }
- );
- });
-
- it('Should detect single quotes in attribute', function() {
- this.shouldDetect(
- ['quotes'],
- 'a[class^=\'foo\'] { color: red }',
- {
- quotes: 'single'
- }
- );
- });
-
- it('Should detect double quotes in url', function() {
- this.shouldDetect(
- ['quotes'],
- 'a { background: url("foo.png") }',
- {
- quotes: 'double'
- }
- );
- });
-});
diff --git a/node_modules/csscomb/test/options/remove-empty-rulesets-less.js b/node_modules/csscomb/test/options/remove-empty-rulesets-less.js
deleted file mode 100644
index 8cf54fc..0000000
--- a/node_modules/csscomb/test/options/remove-empty-rulesets-less.js
+++ /dev/null
@@ -1,27 +0,0 @@
-var assert = require('assert');
-
-describe('options/remove-empty-rulesets (less):', function() {
- beforeEach(function() {
- this.filename = __filename;
- });
-
- it('Issue 201. Test 1', function() {
- this.comb.configure({ 'remove-empty-rulesets': true });
- this.shouldBeEqual('1.less', '1.expected.less');
- });
-
- it('Issue 201. Test 2', function() {
- this.comb.configure({ 'remove-empty-rulesets': true });
- var string = '#a {#b {} #d {}}';
- assert.equal(this.comb.processString(string, { syntax: 'less' }), '');
- });
-
- it('Issue 201. Test 3', function() {
- this.comb.configure({
- 'remove-empty-rulesets': false,
- 'always-semicolon': true
- });
- var string = '#a {#b {} #d {}}';
- assert.equal(this.comb.processString(string, { syntax: 'less' }), string);
- });
-});
diff --git a/node_modules/csscomb/test/options/remove-empty-rulesets-less/1.expected.less b/node_modules/csscomb/test/options/remove-empty-rulesets-less/1.expected.less
deleted file mode 100644
index fbb7651..0000000
--- a/node_modules/csscomb/test/options/remove-empty-rulesets-less/1.expected.less
+++ /dev/null
@@ -1,14 +0,0 @@
-#a {
-
- #b {
- text-align: right;
- }
-
-
-
- #d {
- .e {
- text-align: center;
- }
- }
-}
diff --git a/node_modules/csscomb/test/options/remove-empty-rulesets-less/1.less b/node_modules/csscomb/test/options/remove-empty-rulesets-less/1.less
deleted file mode 100644
index 6abc247..0000000
--- a/node_modules/csscomb/test/options/remove-empty-rulesets-less/1.less
+++ /dev/null
@@ -1,14 +0,0 @@
-#a {
-
- #b {
- text-align: right;
- }
-
- #c { }
-
- #d {
- .e {
- text-align: center;
- }
- }
-}
diff --git a/node_modules/csscomb/test/options/remove-empty-rulesets-scss.js b/node_modules/csscomb/test/options/remove-empty-rulesets-scss.js
deleted file mode 100644
index 237b0e3..0000000
--- a/node_modules/csscomb/test/options/remove-empty-rulesets-scss.js
+++ /dev/null
@@ -1,22 +0,0 @@
-describe('options/remove-empty-rulesets (scss)', function() {
- beforeEach(function() {
- this.filename = __filename;
- this.comb.configure({ 'remove-empty-rulesets': true });
- });
-
- it('Should not remove rulesets which contain only includes', function() {
- this.shouldBeEqual('include.scss');
- });
-
- it('Should remove rulesets with contain only empty nested rules', function() {
- this.shouldBeEqual('empty-nested-rule.scss', 'empty-nested-rule.expected.scss');
- });
-
- it('Should not remove rulesets with non-empty nested rules. Test 1', function() {
- this.shouldBeEqual('nested-rule-1.scss');
- });
-
- it('Should not remove rulesets with non-empty nested rules. Test 2', function() {
- this.shouldBeEqual('nested-rule-2.scss', 'nested-rule-2.expected.scss');
- });
-});
diff --git a/node_modules/csscomb/test/options/remove-empty-rulesets-scss/empty-nested-rule.expected.scss b/node_modules/csscomb/test/options/remove-empty-rulesets-scss/empty-nested-rule.expected.scss
deleted file mode 100644
index 8b13789..0000000
--- a/node_modules/csscomb/test/options/remove-empty-rulesets-scss/empty-nested-rule.expected.scss
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/node_modules/csscomb/test/options/remove-empty-rulesets-scss/empty-nested-rule.scss b/node_modules/csscomb/test/options/remove-empty-rulesets-scss/empty-nested-rule.scss
deleted file mode 100644
index 89b0d97..0000000
--- a/node_modules/csscomb/test/options/remove-empty-rulesets-scss/empty-nested-rule.scss
+++ /dev/null
@@ -1,5 +0,0 @@
-.parent {
- .child {
- .grandchild { }
- }
-}
diff --git a/node_modules/csscomb/test/options/remove-empty-rulesets-scss/include.scss b/node_modules/csscomb/test/options/remove-empty-rulesets-scss/include.scss
deleted file mode 100644
index 70d39a5..0000000
--- a/node_modules/csscomb/test/options/remove-empty-rulesets-scss/include.scss
+++ /dev/null
@@ -1,4 +0,0 @@
-.parent {
- @include mix-all;
- @include mix-top;
-}
diff --git a/node_modules/csscomb/test/options/remove-empty-rulesets-scss/nested-rule-1.scss b/node_modules/csscomb/test/options/remove-empty-rulesets-scss/nested-rule-1.scss
deleted file mode 100644
index f69f70a..0000000
--- a/node_modules/csscomb/test/options/remove-empty-rulesets-scss/nested-rule-1.scss
+++ /dev/null
@@ -1,6 +0,0 @@
-.parent {
- .child {
- @include mix-all;
- @include mix-top;
- }
-}
diff --git a/node_modules/csscomb/test/options/remove-empty-rulesets-scss/nested-rule-2.expected.scss b/node_modules/csscomb/test/options/remove-empty-rulesets-scss/nested-rule-2.expected.scss
deleted file mode 100644
index b020e30..0000000
--- a/node_modules/csscomb/test/options/remove-empty-rulesets-scss/nested-rule-2.expected.scss
+++ /dev/null
@@ -1,7 +0,0 @@
-.parent {
- .child1 {
- @include mix-all;
- @include mix-top;
- }
-
-}
diff --git a/node_modules/csscomb/test/options/remove-empty-rulesets-scss/nested-rule-2.scss b/node_modules/csscomb/test/options/remove-empty-rulesets-scss/nested-rule-2.scss
deleted file mode 100644
index f5eedd4..0000000
--- a/node_modules/csscomb/test/options/remove-empty-rulesets-scss/nested-rule-2.scss
+++ /dev/null
@@ -1,9 +0,0 @@
-.parent {
- .child1 {
- @include mix-all;
- @include mix-top;
- }
- .child2 {
- .grandchild { }
- }
-}
diff --git a/node_modules/csscomb/test/options/remove-empty-rulesets.js b/node_modules/csscomb/test/options/remove-empty-rulesets.js
deleted file mode 100644
index a516227..0000000
--- a/node_modules/csscomb/test/options/remove-empty-rulesets.js
+++ /dev/null
@@ -1,112 +0,0 @@
-var assert = require('assert');
-
-describe('options/remove-empty-rulesets', function() {
- it('Configured with invalid value, should not remove empty ruleset', function() {
- this.comb.configure({ 'remove-empty-rulesets': 'foobar' });
- assert.equal(this.comb.processString('a { width: 10px; } b {}'), 'a { width: 10px; } b {}');
- });
-
- describe('configured with Boolean "true" value', function() {
- beforeEach(function() {
- this.comb.configure({ 'remove-empty-rulesets': true });
- });
-
- it('should remove empty ruleset', function() {
- assert.equal(this.comb.processString(' b {} '), ' ');
- });
-
- it('should remove ruleset with spaces', function() {
- assert.equal(this.comb.processString(' b { } '), ' ');
- });
-
- it('should leave ruleset with declarations', function() {
- assert.equal(this.comb.processString('a { width: 10px; }\nb {} '), 'a { width: 10px; }\n ');
- });
-
- it('should leave ruleset with comments', function() {
- assert.equal(this.comb.processString('a { /* comment */ }\nb {} '), 'a { /* comment */ }\n ');
- });
- });
-
- describe('detecting the value', function() {
- it('Should detect this option set to `true`', function() {
- this.shouldDetect(
- ['remove-empty-rulesets'],
- 'a { color: red }',
- {
- 'remove-empty-rulesets': true
- }
- );
- });
-
- it('Should detect this option set to `false` with empty block', function() {
- this.shouldDetect(
- ['remove-empty-rulesets'],
- 'a {}',
- {
- 'remove-empty-rulesets': false
- }
- );
- });
-
- it('Should detect this option set to `false` with block containing whitespace', function() {
- this.shouldDetect(
- ['remove-empty-rulesets'],
- 'a { }',
- {
- 'remove-empty-rulesets': false
- }
- );
- });
-
- it('Should detect this option set to `true` with block containing comment', function() {
- this.shouldDetect(
- ['remove-empty-rulesets'],
- 'a { /* Hello */ }',
- {
- 'remove-empty-rulesets': true
- }
- );
- });
-
- it('Should detect this option set to `true` with media query containing block', function() {
- this.shouldDetect(
- ['remove-empty-rulesets'],
- '@media all and (min-width:0) { a { /* Hello */ } }',
- {
- 'remove-empty-rulesets': true
- }
- );
- });
-
- it('Should detect this option set to `true` with media query containing comment', function() {
- this.shouldDetect(
- ['remove-empty-rulesets'],
- '@media all and (min-width:0) {/* Hello */}',
- {
- 'remove-empty-rulesets': true
- }
- );
- });
-
- it('Should detect this option set to `false` with empty media query', function() {
- this.shouldDetect(
- ['remove-empty-rulesets'],
- '@media all and (min-width:0) {}',
- {
- 'remove-empty-rulesets': false
- }
- );
- });
-
- it('Should detect this option set to `false` with media query containing whitespace', function() {
- this.shouldDetect(
- ['remove-empty-rulesets'],
- '@media all and (min-width:0) { \n }',
- {
- 'remove-empty-rulesets': false
- }
- );
- });
- });
-});
diff --git a/node_modules/csscomb/test/options/sass.js b/node_modules/csscomb/test/options/sass.js
deleted file mode 100644
index 1593c33..0000000
--- a/node_modules/csscomb/test/options/sass.js
+++ /dev/null
@@ -1,108 +0,0 @@
-describe('Sass', function() {
- beforeEach(function() {
- this.filename = __filename;
- this.comb.configure({});
- });
-
- it('Should parse nested rules', function() {
- this.shouldBeEqual('nested-rule.sass');
- });
-
- it('Should parse parent selector &', function() {
- this.shouldBeEqual('parent-selector.sass');
- });
-
- it('Should parse nested properties', function() {
- this.shouldBeEqual('nested-property.sass');
- });
-
- it('Should parse variables', function() {
- this.shouldBeEqual('variable.sass');
- });
-
- it('Should parse interpolated variables inside selectors', function() {
- this.shouldBeEqual('interpolated-variable-1.sass');
- });
-
- it('Should parse interpolated variables inside values', function() {
- this.shouldBeEqual('interpolated-variable-2.sass');
- });
-
- it('Should parse defaults', function() {
- this.shouldBeEqual('default.sass');
- });
-
- it('Should parse @import', function() {
- this.shouldBeEqual('import.sass');
- });
-
- it('Should parse @include', function() {
- this.shouldBeEqual('include.sass');
- });
-
- it('Should parse nested @media', function() {
- this.shouldBeEqual('nested-media.sass');
- });
-
- it('Should parse @extend with classes', function() {
- this.shouldBeEqual('extend-1.sass');
- });
-
- it('Should parse @extend with placeholders', function() {
- this.shouldBeEqual('extend-2.sass');
- });
-
- it('Should parse @warn', function() {
- this.shouldBeEqual('warn.sass');
- });
-
- it('Should parse @if', function() {
- this.shouldBeEqual('if.sass');
- });
-
- it('Should parse @if and @else', function() {
- this.shouldBeEqual('if-else.sass');
- });
-
- it('Should parse @if and @else if', function() {
- this.shouldBeEqual('if-else-if.sass');
- });
-
- it('Should parse @for', function() {
- this.shouldBeEqual('for.sass');
- });
-
- it('Should parse @each', function() {
- this.shouldBeEqual('each.sass');
- });
-
- it('Should parse @while', function() {
- this.shouldBeEqual('while.sass');
- });
-
- it('Should parse mixins', function() {
- this.shouldBeEqual('mixin-1.sass');
- });
-
- it('Should parse passing several variables to a mixin', function() {
- this.shouldBeEqual('mixin-2.sass');
- });
-
- it('Should parse passing a list of variables to a mixin', function() {
- this.shouldBeEqual('mixin-3.sass');
- });
-
- it('Should parse passing a content block to a mixin', function() {
- this.shouldBeEqual('mixin-4.sass');
- });
-
- it('Should parse @content', function() {
- this.shouldBeEqual('content.sass');
- });
-
- it('Should parse functions', function() {
- this.shouldBeEqual('function.sass');
- });
-});
-
-
diff --git a/node_modules/csscomb/test/options/sass/content.sass b/node_modules/csscomb/test/options/sass/content.sass
deleted file mode 100644
index e1bb2b9..0000000
--- a/node_modules/csscomb/test/options/sass/content.sass
+++ /dev/null
@@ -1,3 +0,0 @@
-@mixin nani
- a
- @content
diff --git a/node_modules/csscomb/test/options/sass/default.sass b/node_modules/csscomb/test/options/sass/default.sass
deleted file mode 100644
index 3c10834..0000000
--- a/node_modules/csscomb/test/options/sass/default.sass
+++ /dev/null
@@ -1,3 +0,0 @@
-div
- $color: tomato !default
- top: 0
diff --git a/node_modules/csscomb/test/options/sass/each.sass b/node_modules/csscomb/test/options/sass/each.sass
deleted file mode 100644
index 477c5de..0000000
--- a/node_modules/csscomb/test/options/sass/each.sass
+++ /dev/null
@@ -1,4 +0,0 @@
-div
- @each $animal in puma, sea-slug, erget
- .#{$animal}-icon
- background-image: url("/images/#{$animal}.png")
diff --git a/node_modules/csscomb/test/options/sass/extend-1.sass b/node_modules/csscomb/test/options/sass/extend-1.sass
deleted file mode 100644
index ef4beac..0000000
--- a/node_modules/csscomb/test/options/sass/extend-1.sass
+++ /dev/null
@@ -1,3 +0,0 @@
-div
- @extend .nani
- top: 0
diff --git a/node_modules/csscomb/test/options/sass/extend-2.sass b/node_modules/csscomb/test/options/sass/extend-2.sass
deleted file mode 100644
index 8da2b0d..0000000
--- a/node_modules/csscomb/test/options/sass/extend-2.sass
+++ /dev/null
@@ -1,3 +0,0 @@
-div
- @extend %nani
- top: 0
diff --git a/node_modules/csscomb/test/options/sass/for.sass b/node_modules/csscomb/test/options/sass/for.sass
deleted file mode 100644
index 9449c47..0000000
--- a/node_modules/csscomb/test/options/sass/for.sass
+++ /dev/null
@@ -1,4 +0,0 @@
-div
- @for $i from 1 through 3
- .item-#{$i}
- width: 2em * 1
diff --git a/node_modules/csscomb/test/options/sass/function.sass b/node_modules/csscomb/test/options/sass/function.sass
deleted file mode 100644
index 33901cb..0000000
--- a/node_modules/csscomb/test/options/sass/function.sass
+++ /dev/null
@@ -1,2 +0,0 @@
-@function nani($n)
- @return $n * 2
diff --git a/node_modules/csscomb/test/options/sass/if-else-if.sass b/node_modules/csscomb/test/options/sass/if-else-if.sass
deleted file mode 100644
index 91648b8..0000000
--- a/node_modules/csscomb/test/options/sass/if-else-if.sass
+++ /dev/null
@@ -1,5 +0,0 @@
-div
- @if $type == ocean
- top: 0
- @else if $type == monster
- left: 0
diff --git a/node_modules/csscomb/test/options/sass/if-else.sass b/node_modules/csscomb/test/options/sass/if-else.sass
deleted file mode 100644
index 2863d4d..0000000
--- a/node_modules/csscomb/test/options/sass/if-else.sass
+++ /dev/null
@@ -1,5 +0,0 @@
-div
- @if $type == ocean
- top: 0
- @else
- left: 0
diff --git a/node_modules/csscomb/test/options/sass/if.sass b/node_modules/csscomb/test/options/sass/if.sass
deleted file mode 100644
index ab29f15..0000000
--- a/node_modules/csscomb/test/options/sass/if.sass
+++ /dev/null
@@ -1,3 +0,0 @@
-div
- @if $type == ocean
- top: 0
diff --git a/node_modules/csscomb/test/options/sass/import.sass b/node_modules/csscomb/test/options/sass/import.sass
deleted file mode 100644
index ed47208..0000000
--- a/node_modules/csscomb/test/options/sass/import.sass
+++ /dev/null
@@ -1,3 +0,0 @@
-div
- @import "foo.css"
- top: 0
diff --git a/node_modules/csscomb/test/options/sass/include.sass b/node_modules/csscomb/test/options/sass/include.sass
deleted file mode 100644
index 3b753a7..0000000
--- a/node_modules/csscomb/test/options/sass/include.sass
+++ /dev/null
@@ -1,3 +0,0 @@
-div
- @include nani($panda)
- top: 0
diff --git a/node_modules/csscomb/test/options/sass/interpolated-variable-1.sass b/node_modules/csscomb/test/options/sass/interpolated-variable-1.sass
deleted file mode 100644
index 3ba50e5..0000000
--- a/node_modules/csscomb/test/options/sass/interpolated-variable-1.sass
+++ /dev/null
@@ -1,3 +0,0 @@
-div.#{$nani}
- color: tomato
- top:0
diff --git a/node_modules/csscomb/test/options/sass/interpolated-variable-2.sass b/node_modules/csscomb/test/options/sass/interpolated-variable-2.sass
deleted file mode 100644
index 3f134b4..0000000
--- a/node_modules/csscomb/test/options/sass/interpolated-variable-2.sass
+++ /dev/null
@@ -1,3 +0,0 @@
-div
- color: #{$tomato}
- top: 0
diff --git a/node_modules/csscomb/test/options/sass/mixin-1.sass b/node_modules/csscomb/test/options/sass/mixin-1.sass
deleted file mode 100644
index f633d80..0000000
--- a/node_modules/csscomb/test/options/sass/mixin-1.sass
+++ /dev/null
@@ -1,4 +0,0 @@
-@mixin nani
- color: tomato
-.foo
- @include nani
diff --git a/node_modules/csscomb/test/options/sass/mixin-2.sass b/node_modules/csscomb/test/options/sass/mixin-2.sass
deleted file mode 100644
index 0e3513e..0000000
--- a/node_modules/csscomb/test/options/sass/mixin-2.sass
+++ /dev/null
@@ -1,4 +0,0 @@
-@mixin nani($tomato)
- color: $tomato
-.foo
- @include nani(red)
diff --git a/node_modules/csscomb/test/options/sass/mixin-3.sass b/node_modules/csscomb/test/options/sass/mixin-3.sass
deleted file mode 100644
index cf20ed5..0000000
--- a/node_modules/csscomb/test/options/sass/mixin-3.sass
+++ /dev/null
@@ -1,4 +0,0 @@
-@mixin nani($shadows...)
- box-shadow: $shadows
-.foo
- @include nani(0px 4px 5px #666, 2px 6px 10px #999)
diff --git a/node_modules/csscomb/test/options/sass/mixin-4.sass b/node_modules/csscomb/test/options/sass/mixin-4.sass
deleted file mode 100644
index d22987c..0000000
--- a/node_modules/csscomb/test/options/sass/mixin-4.sass
+++ /dev/null
@@ -1,4 +0,0 @@
-.foo
- @include nani
- color: tomato
- top: 0
diff --git a/node_modules/csscomb/test/options/sass/nested-media.sass b/node_modules/csscomb/test/options/sass/nested-media.sass
deleted file mode 100644
index 244755f..0000000
--- a/node_modules/csscomb/test/options/sass/nested-media.sass
+++ /dev/null
@@ -1,4 +0,0 @@
-div
- @media screen and (orientation: landscape)
- color: tomato
- top: 0
diff --git a/node_modules/csscomb/test/options/sass/nested-property.sass b/node_modules/csscomb/test/options/sass/nested-property.sass
deleted file mode 100644
index 84af654..0000000
--- a/node_modules/csscomb/test/options/sass/nested-property.sass
+++ /dev/null
@@ -1,6 +0,0 @@
-div
- color: tomato
- font: 2px/3px
- family: fantasy
- size: 30em
- left: 0
diff --git a/node_modules/csscomb/test/options/sass/nested-rule.sass b/node_modules/csscomb/test/options/sass/nested-rule.sass
deleted file mode 100644
index 8e90913..0000000
--- a/node_modules/csscomb/test/options/sass/nested-rule.sass
+++ /dev/null
@@ -1,4 +0,0 @@
-div
- color: tomato
- a
- top: 0
diff --git a/node_modules/csscomb/test/options/sass/parent-selector.sass b/node_modules/csscomb/test/options/sass/parent-selector.sass
deleted file mode 100644
index 388fecd..0000000
--- a/node_modules/csscomb/test/options/sass/parent-selector.sass
+++ /dev/null
@@ -1,6 +0,0 @@
-div
- color: tomato
- &.top
- color: nani
- top: 0
- left: 0
diff --git a/node_modules/csscomb/test/options/sass/variable.sass b/node_modules/csscomb/test/options/sass/variable.sass
deleted file mode 100644
index 24f437d..0000000
--- a/node_modules/csscomb/test/options/sass/variable.sass
+++ /dev/null
@@ -1,3 +0,0 @@
-$red: tomato
-div
- color: $tomato
diff --git a/node_modules/csscomb/test/options/sass/warn.sass b/node_modules/csscomb/test/options/sass/warn.sass
deleted file mode 100644
index ebf821b..0000000
--- a/node_modules/csscomb/test/options/sass/warn.sass
+++ /dev/null
@@ -1,3 +0,0 @@
-div
- @warn "nani"
- top: 0
diff --git a/node_modules/csscomb/test/options/sass/while.sass b/node_modules/csscomb/test/options/sass/while.sass
deleted file mode 100644
index 8b07b31..0000000
--- a/node_modules/csscomb/test/options/sass/while.sass
+++ /dev/null
@@ -1,5 +0,0 @@
-div
- @while $i > 6
- .item
- width: 2em * $i
- $i: $i - 2
diff --git a/node_modules/csscomb/test/options/sort-order-fallback.js b/node_modules/csscomb/test/options/sort-order-fallback.js
deleted file mode 100644
index 418fcfd..0000000
--- a/node_modules/csscomb/test/options/sort-order-fallback.js
+++ /dev/null
@@ -1,36 +0,0 @@
-describe('options/sort-order-fallback', function() {
- beforeEach(function() {
- this.filename = __filename;
- });
-
- it('Should sort leftovers alphabetically if `sort-order-fallback` is set', function() {
- var config = {
- 'sort-order-fallback': 'abc',
- 'sort-order': [
- ['top', 'left'],
- ['...'],
- ['color']
- ]
- };
- this.comb.configure(config);
- this.shouldBeEqual('test.css', 'test.expected.css');
- });
-
- it('Should sort unknown properties alphabetically if `sort-order-fallback` is set', function() {
- var config = {
- 'sort-order-fallback': 'abc',
- 'sort-order': ['top', 'left']
- };
- this.comb.configure(config);
- this.shouldBeEqual('test.css', 'test-2.expected.css');
- });
-
- it('Should leave leftovers as is if `sort-order-fallback` is not set', function() {
- var config = {
- 'sort-order': ['top', 'left']
- };
- this.comb.configure(config);
- this.shouldBeEqual('test.css', 'test-3.expected.css');
- });
-});
-
diff --git a/node_modules/csscomb/test/options/sort-order-fallback/test-2.expected.css b/node_modules/csscomb/test/options/sort-order-fallback/test-2.expected.css
deleted file mode 100644
index dd35868..0000000
--- a/node_modules/csscomb/test/options/sort-order-fallback/test-2.expected.css
+++ /dev/null
@@ -1,11 +0,0 @@
-a {
- top: 0;
- left: 0;
-
- -moz-color: zebra;
- color: tomato;
- -webkit-float: left;
- float: right;
- font-size: 1em;
- position: absolute;
- }
diff --git a/node_modules/csscomb/test/options/sort-order-fallback/test-3.expected.css b/node_modules/csscomb/test/options/sort-order-fallback/test-3.expected.css
deleted file mode 100644
index 8e31298..0000000
--- a/node_modules/csscomb/test/options/sort-order-fallback/test-3.expected.css
+++ /dev/null
@@ -1,11 +0,0 @@
-a {
- top: 0;
- left: 0;
-
- color: tomato;
- font-size: 1em;
- position: absolute;
- -webkit-float: left;
- -moz-color: zebra;
- float: right;
- }
diff --git a/node_modules/csscomb/test/options/sort-order-fallback/test.css b/node_modules/csscomb/test/options/sort-order-fallback/test.css
deleted file mode 100644
index d57de84..0000000
--- a/node_modules/csscomb/test/options/sort-order-fallback/test.css
+++ /dev/null
@@ -1,10 +0,0 @@
-a {
- color: tomato;
- font-size: 1em;
- top: 0;
- position: absolute;
- left: 0;
- -webkit-float: left;
- -moz-color: zebra;
- float: right;
- }
diff --git a/node_modules/csscomb/test/options/sort-order-fallback/test.expected.css b/node_modules/csscomb/test/options/sort-order-fallback/test.expected.css
deleted file mode 100644
index ec1c2a8..0000000
--- a/node_modules/csscomb/test/options/sort-order-fallback/test.expected.css
+++ /dev/null
@@ -1,12 +0,0 @@
-a {
- top: 0;
- left: 0;
-
- -moz-color: zebra;
- -webkit-float: left;
- float: right;
- font-size: 1em;
- position: absolute;
-
- color: tomato;
- }
diff --git a/node_modules/csscomb/test/options/sort-order-less.js b/node_modules/csscomb/test/options/sort-order-less.js
deleted file mode 100644
index f0c36a5..0000000
--- a/node_modules/csscomb/test/options/sort-order-less.js
+++ /dev/null
@@ -1,96 +0,0 @@
-describe('options/sort-order (less)', function() {
- beforeEach(function() {
- this.filename = __filename;
- });
-
- it('Should sort properties inside rules', function() {
- this.comb.configure({ 'sort-order': [
- ['top', 'color']
- ] });
- this.shouldBeEqual('rule.less', 'rule.expected.less');
- });
-
- it('Should sort properties inside nested rules', function() {
- this.comb.configure({ 'sort-order': [
- ['top', 'color']
- ] });
- this.shouldBeEqual('nested-rule-1.less', 'nested-rule-1.expected.less');
- });
-
- it('Should sort properties divided by nested rules', function() {
- this.comb.configure({ 'sort-order': [
- ['top', 'left', 'color']
- ] });
- this.shouldBeEqual('nested-rule-2.less', 'nested-rule-2.expected.less');
- });
-
- it('Should group declarations with proper comments and spaces (single line)', function() {
- this.comb.configure({ 'sort-order': [
- ['top', 'color']
- ] });
- this.shouldBeEqual('comments-1.less', 'comments-1.expected.less');
- });
-
- it('Should group declarations with proper comments and spaces (multiple lines). Test 1', function() {
- this.comb.configure({ 'sort-order': [
- ['top', 'color']
- ] });
- this.shouldBeEqual('comments-2.less', 'comments-2.expected.less');
- });
-
- it('Should group declarations with proper comments and spaces (multiple lines). Test 2', function() {
- this.comb.configure({ 'sort-order': [
- ['$variable', 'color']
- ] });
- this.shouldBeEqual('comments-3.less', 'comments-3.expected.less');
- });
-
- it('Should group declarations with proper comments and spaces (multiple lines). Test 3', function() {
- this.comb.configure({ 'sort-order': [
- ['$variable', 'color']
- ] });
- this.shouldBeEqual('comments-3.less', 'comments-3.expected.less');
- });
-
- it('Should divide properties from different groups with an empty line', function() {
- this.comb.configure({ 'sort-order': [
- ['top'], ['color']
- ] });
- this.shouldBeEqual('different-groups.less', 'different-groups.expected.less');
- });
-
- it('Should sort variables', function() {
- this.comb.configure({ 'sort-order': [
- ['$variable', 'color']
- ] });
- this.shouldBeEqual('variable.less', 'variable.expected.less');
- });
-
- it('Should sort imports', function() {
- this.comb.configure({ 'sort-order': [
- ['$import', 'color']
- ] });
- this.shouldBeEqual('import.less', 'import.expected.less');
- });
-
- it('Should sort included mixins. Test 1', function() {
- this.comb.configure({ 'sort-order': [
- ['$include', 'color', 'border-top', 'border-bottom']
- ] });
- this.shouldBeEqual('mixin-1.less', 'mixin-1.expected.less');
- });
-
- it('Should sort included mixins. Test 2', function() {
- this.comb.configure({ 'sort-order': [
- ['$include', 'top', 'color']
- ] });
- this.shouldBeEqual('mixin-2.less', 'mixin-2.expected.less');
- });
-
- it('Should sort included mixins. Test 3', function() {
- this.comb.configure({ 'sort-order': [
- ['$include', 'border', 'color']
- ] });
- this.shouldBeEqual('mixin-3.less', 'mixin-3.expected.less');
- });
-});
diff --git a/node_modules/csscomb/test/options/sort-order-less/comments-1.expected.less b/node_modules/csscomb/test/options/sort-order-less/comments-1.expected.less
deleted file mode 100644
index a9b2976..0000000
--- a/node_modules/csscomb/test/options/sort-order-less/comments-1.expected.less
+++ /dev/null
@@ -1 +0,0 @@
-div {top: 0; /* 3 */ /* 4 *//* 1 */ color: tomato; /* 2 */ }
diff --git a/node_modules/csscomb/test/options/sort-order-less/comments-1.less b/node_modules/csscomb/test/options/sort-order-less/comments-1.less
deleted file mode 100644
index 617d4fd..0000000
--- a/node_modules/csscomb/test/options/sort-order-less/comments-1.less
+++ /dev/null
@@ -1 +0,0 @@
-div {/* 1 */ color: tomato; /* 2 */ top: 0; /* 3 */ /* 4 */}
diff --git a/node_modules/csscomb/test/options/sort-order-less/comments-2.expected.less b/node_modules/csscomb/test/options/sort-order-less/comments-2.expected.less
deleted file mode 100644
index 0aa257a..0000000
--- a/node_modules/csscomb/test/options/sort-order-less/comments-2.expected.less
+++ /dev/null
@@ -1,7 +0,0 @@
-div {
- /* 2 */
- /* 3 */
- top: 0; /* 4 */
- color: tomato; /* 1 */
- /* 5 */
-}
diff --git a/node_modules/csscomb/test/options/sort-order-less/comments-2.less b/node_modules/csscomb/test/options/sort-order-less/comments-2.less
deleted file mode 100644
index 18e6319..0000000
--- a/node_modules/csscomb/test/options/sort-order-less/comments-2.less
+++ /dev/null
@@ -1,7 +0,0 @@
-div {
- color: tomato; /* 1 */
- /* 2 */
- /* 3 */
- top: 0; /* 4 */
- /* 5 */
-}
diff --git a/node_modules/csscomb/test/options/sort-order-less/comments-3.expected.less b/node_modules/csscomb/test/options/sort-order-less/comments-3.expected.less
deleted file mode 100644
index 7bf0938..0000000
--- a/node_modules/csscomb/test/options/sort-order-less/comments-3.expected.less
+++ /dev/null
@@ -1,6 +0,0 @@
-p {
- // Get in line!
- @var: white;
- /* One hell of a comment */
- color: tomato;
-}
diff --git a/node_modules/csscomb/test/options/sort-order-less/comments-3.less b/node_modules/csscomb/test/options/sort-order-less/comments-3.less
deleted file mode 100644
index c7f0a84..0000000
--- a/node_modules/csscomb/test/options/sort-order-less/comments-3.less
+++ /dev/null
@@ -1,6 +0,0 @@
-p {
- /* One hell of a comment */
- color: tomato;
- // Get in line!
- @var: white;
-}
diff --git a/node_modules/csscomb/test/options/sort-order-less/comments-4.expected.less b/node_modules/csscomb/test/options/sort-order-less/comments-4.expected.less
deleted file mode 100644
index 349b770..0000000
--- a/node_modules/csscomb/test/options/sort-order-less/comments-4.expected.less
+++ /dev/null
@@ -1,4 +0,0 @@
-p {
- @var: white; // Get in line!
- color: tomato; /* One hell of a comment */
- }
diff --git a/node_modules/csscomb/test/options/sort-order-less/comments-4.less b/node_modules/csscomb/test/options/sort-order-less/comments-4.less
deleted file mode 100644
index b1db838..0000000
--- a/node_modules/csscomb/test/options/sort-order-less/comments-4.less
+++ /dev/null
@@ -1,4 +0,0 @@
-p {
- color: tomato; /* One hell of a comment */
- @var: white; // Get in line!
- }
diff --git a/node_modules/csscomb/test/options/sort-order-less/different-groups.expected.less b/node_modules/csscomb/test/options/sort-order-less/different-groups.expected.less
deleted file mode 100644
index dddc16f..0000000
--- a/node_modules/csscomb/test/options/sort-order-less/different-groups.expected.less
+++ /dev/null
@@ -1,5 +0,0 @@
-div {
- top: 0;
-
- color: tomato;
-}
diff --git a/node_modules/csscomb/test/options/sort-order-less/different-groups.less b/node_modules/csscomb/test/options/sort-order-less/different-groups.less
deleted file mode 100644
index 7ffa908..0000000
--- a/node_modules/csscomb/test/options/sort-order-less/different-groups.less
+++ /dev/null
@@ -1,4 +0,0 @@
-div {
- color: tomato;
- top: 0;
-}
diff --git a/node_modules/csscomb/test/options/sort-order-less/import.expected.less b/node_modules/csscomb/test/options/sort-order-less/import.expected.less
deleted file mode 100644
index 9c403df..0000000
--- a/node_modules/csscomb/test/options/sort-order-less/import.expected.less
+++ /dev/null
@@ -1 +0,0 @@
-div {@import "foo.css"; color: tomato; }
diff --git a/node_modules/csscomb/test/options/sort-order-less/import.less b/node_modules/csscomb/test/options/sort-order-less/import.less
deleted file mode 100644
index 681ccd0..0000000
--- a/node_modules/csscomb/test/options/sort-order-less/import.less
+++ /dev/null
@@ -1 +0,0 @@
-div { color: tomato; @import "foo.css"; }
diff --git a/node_modules/csscomb/test/options/sort-order-less/mixin-1.expected.less b/node_modules/csscomb/test/options/sort-order-less/mixin-1.expected.less
deleted file mode 100644
index 11ac5fa..0000000
--- a/node_modules/csscomb/test/options/sort-order-less/mixin-1.expected.less
+++ /dev/null
@@ -1,12 +0,0 @@
-.bordered {
- border-top: dotted 1px black;
- border-bottom: solid 2px black;
-}
-#menu a {
- .bordered;
- color: #111;
- }
-.post a {
- .bordered;
- color: red;
- }
diff --git a/node_modules/csscomb/test/options/sort-order-less/mixin-1.less b/node_modules/csscomb/test/options/sort-order-less/mixin-1.less
deleted file mode 100644
index e5d5ad0..0000000
--- a/node_modules/csscomb/test/options/sort-order-less/mixin-1.less
+++ /dev/null
@@ -1,12 +0,0 @@
-.bordered {
- border-bottom: solid 2px black;
- border-top: dotted 1px black;
-}
-#menu a {
- color: #111;
- .bordered;
- }
-.post a {
- color: red;
- .bordered;
- }
diff --git a/node_modules/csscomb/test/options/sort-order-less/mixin-2.expected.less b/node_modules/csscomb/test/options/sort-order-less/mixin-2.expected.less
deleted file mode 100644
index 1535db1..0000000
--- a/node_modules/csscomb/test/options/sort-order-less/mixin-2.expected.less
+++ /dev/null
@@ -1,6 +0,0 @@
-.test {
- .test1();
- .test2();
- top: 0;
- color: tomato;
- }
diff --git a/node_modules/csscomb/test/options/sort-order-less/mixin-2.less b/node_modules/csscomb/test/options/sort-order-less/mixin-2.less
deleted file mode 100644
index cbd0c8e..0000000
--- a/node_modules/csscomb/test/options/sort-order-less/mixin-2.less
+++ /dev/null
@@ -1,6 +0,0 @@
-.test {
- .test1();
- color: tomato;
- .test2();
- top: 0;
- }
diff --git a/node_modules/csscomb/test/options/sort-order-less/mixin-3.expected.less b/node_modules/csscomb/test/options/sort-order-less/mixin-3.expected.less
deleted file mode 100644
index 0e4c018..0000000
--- a/node_modules/csscomb/test/options/sort-order-less/mixin-3.expected.less
+++ /dev/null
@@ -1,5 +0,0 @@
-.foo {
- .linear-gradient(#fff; #000);
- border: 1px solid #f00;
- color: #0f0;
-}
diff --git a/node_modules/csscomb/test/options/sort-order-less/mixin-3.less b/node_modules/csscomb/test/options/sort-order-less/mixin-3.less
deleted file mode 100644
index fce214a..0000000
--- a/node_modules/csscomb/test/options/sort-order-less/mixin-3.less
+++ /dev/null
@@ -1,5 +0,0 @@
-.foo {
- color: #0f0;
- border: 1px solid #f00;
- .linear-gradient(#fff; #000);
-}
diff --git a/node_modules/csscomb/test/options/sort-order-less/nested-rule-1.expected.less b/node_modules/csscomb/test/options/sort-order-less/nested-rule-1.expected.less
deleted file mode 100644
index e85581f..0000000
--- a/node_modules/csscomb/test/options/sort-order-less/nested-rule-1.expected.less
+++ /dev/null
@@ -1,6 +0,0 @@
-div {
- color: tomato; a {
- top: 0;
- color: nani;
- }
-}
diff --git a/node_modules/csscomb/test/options/sort-order-less/nested-rule-1.less b/node_modules/csscomb/test/options/sort-order-less/nested-rule-1.less
deleted file mode 100644
index af11594..0000000
--- a/node_modules/csscomb/test/options/sort-order-less/nested-rule-1.less
+++ /dev/null
@@ -1,6 +0,0 @@
-div {
- color: tomato; a {
- color: nani;
- top: 0;
- }
-}
diff --git a/node_modules/csscomb/test/options/sort-order-less/nested-rule-2.expected.less b/node_modules/csscomb/test/options/sort-order-less/nested-rule-2.expected.less
deleted file mode 100644
index 30c8b65..0000000
--- a/node_modules/csscomb/test/options/sort-order-less/nested-rule-2.expected.less
+++ /dev/null
@@ -1,7 +0,0 @@
-div {
- left: 0;
- color: tomato; a {
- top: 0;
- color: nani;
- }
-}
diff --git a/node_modules/csscomb/test/options/sort-order-less/nested-rule-2.less b/node_modules/csscomb/test/options/sort-order-less/nested-rule-2.less
deleted file mode 100644
index 52df599..0000000
--- a/node_modules/csscomb/test/options/sort-order-less/nested-rule-2.less
+++ /dev/null
@@ -1,7 +0,0 @@
-div {
- color: tomato; a {
- color: nani;
- top: 0;
- }
- left: 0;
-}
diff --git a/node_modules/csscomb/test/options/sort-order-less/rule.expected.less b/node_modules/csscomb/test/options/sort-order-less/rule.expected.less
deleted file mode 100644
index 918bd37..0000000
--- a/node_modules/csscomb/test/options/sort-order-less/rule.expected.less
+++ /dev/null
@@ -1,4 +0,0 @@
-div {
- top: 0;
- color: tomato;
-}
diff --git a/node_modules/csscomb/test/options/sort-order-less/rule.less b/node_modules/csscomb/test/options/sort-order-less/rule.less
deleted file mode 100644
index 7ffa908..0000000
--- a/node_modules/csscomb/test/options/sort-order-less/rule.less
+++ /dev/null
@@ -1,4 +0,0 @@
-div {
- color: tomato;
- top: 0;
-}
diff --git a/node_modules/csscomb/test/options/sort-order-less/variable.expected.less b/node_modules/csscomb/test/options/sort-order-less/variable.expected.less
deleted file mode 100644
index e391754..0000000
--- a/node_modules/csscomb/test/options/sort-order-less/variable.expected.less
+++ /dev/null
@@ -1 +0,0 @@
-div {@red: tomato; color: @red; }
diff --git a/node_modules/csscomb/test/options/sort-order-less/variable.less b/node_modules/csscomb/test/options/sort-order-less/variable.less
deleted file mode 100644
index 5c6756b..0000000
--- a/node_modules/csscomb/test/options/sort-order-less/variable.less
+++ /dev/null
@@ -1 +0,0 @@
-div { color: @red; @red: tomato; }
diff --git a/node_modules/csscomb/test/options/sort-order-sass.js b/node_modules/csscomb/test/options/sort-order-sass.js
deleted file mode 100644
index d6997e5..0000000
--- a/node_modules/csscomb/test/options/sort-order-sass.js
+++ /dev/null
@@ -1,89 +0,0 @@
-describe('options/sort-order (sass)', function() {
- beforeEach(function() {
- this.filename = __filename;
- });
-
- it('Should sort properties inside rules', function() {
- this.comb.configure({ 'sort-order': [
- ['top', 'color']
- ] });
- this.shouldBeEqual('rule.sass', 'rule.expected.sass');
- });
-
- it('Should sort properties inside nested rules', function() {
- this.comb.configure({ 'sort-order': [
- ['top', 'color']
- ] });
- this.shouldBeEqual('nested-rule-1.sass', 'nested-rule-1.expected.sass');
- });
-
- it('Should sort properties divided by nested rules', function() {
- this.comb.configure({ 'sort-order': [
- ['top', 'left', 'color']
- ] });
- this.shouldBeEqual('nested-rule-2.sass', 'nested-rule-2.expected.sass');
- });
-
- it('Should group declarations with proper comments and spaces (multiple lines)', function() {
- this.comb.configure({ 'sort-order': [
- ['top', 'color']
- ] });
- this.shouldBeEqual('comments.sass', 'comments.expected.sass');
- });
-
- it('Should divide properties from different groups with an empty line', function() {
- this.comb.configure({ 'sort-order': [
- ['top'], ['color']
- ] });
- this.shouldBeEqual('different-groups.sass', 'different-groups.expected.sass');
- });
-
- it('Should sort variables', function() {
- this.comb.configure({ 'sort-order': [
- ['$variable', 'color']
- ] });
- this.shouldBeEqual('variable.sass', 'variable.expected.sass');
- });
-
- it('Should sort imports', function() {
- this.comb.configure({ 'sort-order': [
- ['$import', 'color']
- ] });
- this.shouldBeEqual('import.sass', 'import.expected.sass');
- });
-
- it('Should sort @include-s', function() {
- this.comb.configure({ 'sort-order': [
- ['$include', 'color']
- ] });
- this.shouldBeEqual('include.sass', 'include.expected.sass');
- });
-
- it('Should sort @extend-s', function() {
- this.comb.configure({ 'sort-order': [
- ['$include', 'color']
- ] });
- this.shouldBeEqual('extend.sass', 'extend.expected.sass');
- });
-
- it('Should sort properties inside blocks passed to mixins', function() {
- this.comb.configure({ 'sort-order': [
- ['top', 'color']
- ] });
- this.shouldBeEqual('mixin.sass', 'mixin.expected.sass');
- });
-
- it('Should handle properties preceeding rulesets', function() {
- this.comb.configure({ 'sort-order': [
- ['top', 'left', 'color']
- ] });
- this.shouldBeEqual('ruleset.sass', 'ruleset.expected.sass');
- });
-
- it('Should handle properties preceeding conditions', function() {
- this.comb.configure({ 'sort-order': [
- ['font-size', 'display', 'top', 'color']
- ] });
- this.shouldBeEqual('condition.sass', 'condition.expected.sass');
- });
-});
diff --git a/node_modules/csscomb/test/options/sort-order-sass/comments.expected.sass b/node_modules/csscomb/test/options/sort-order-sass/comments.expected.sass
deleted file mode 100644
index a798642..0000000
--- a/node_modules/csscomb/test/options/sort-order-sass/comments.expected.sass
+++ /dev/null
@@ -1,6 +0,0 @@
-div
- /* 2 */
- /* 3 */
- top: 0 // 4
- color: tomato // 1
- /* 5 */
diff --git a/node_modules/csscomb/test/options/sort-order-sass/comments.sass b/node_modules/csscomb/test/options/sort-order-sass/comments.sass
deleted file mode 100644
index 5f3f7cc..0000000
--- a/node_modules/csscomb/test/options/sort-order-sass/comments.sass
+++ /dev/null
@@ -1,6 +0,0 @@
-div
- color: tomato // 1
- /* 2 */
- /* 3 */
- top: 0 // 4
- /* 5 */
diff --git a/node_modules/csscomb/test/options/sort-order-sass/condition.expected.sass b/node_modules/csscomb/test/options/sort-order-sass/condition.expected.sass
deleted file mode 100644
index 8ffeb9f..0000000
--- a/node_modules/csscomb/test/options/sort-order-sass/condition.expected.sass
+++ /dev/null
@@ -1,6 +0,0 @@
-div
- top: 0
- color: tomato
- @if $color == tomato
- font-size: 2px
- display: block
diff --git a/node_modules/csscomb/test/options/sort-order-sass/condition.sass b/node_modules/csscomb/test/options/sort-order-sass/condition.sass
deleted file mode 100644
index 66379ee..0000000
--- a/node_modules/csscomb/test/options/sort-order-sass/condition.sass
+++ /dev/null
@@ -1,6 +0,0 @@
-div
- color: tomato
- @if $color == tomato
- display: block
- font-size: 2px
- top: 0
diff --git a/node_modules/csscomb/test/options/sort-order-sass/different-groups.expected.sass b/node_modules/csscomb/test/options/sort-order-sass/different-groups.expected.sass
deleted file mode 100644
index 2ffd199..0000000
--- a/node_modules/csscomb/test/options/sort-order-sass/different-groups.expected.sass
+++ /dev/null
@@ -1,4 +0,0 @@
-div
- top: 0
-
- color: tomato
diff --git a/node_modules/csscomb/test/options/sort-order-sass/different-groups.sass b/node_modules/csscomb/test/options/sort-order-sass/different-groups.sass
deleted file mode 100644
index 6d835e2..0000000
--- a/node_modules/csscomb/test/options/sort-order-sass/different-groups.sass
+++ /dev/null
@@ -1,3 +0,0 @@
-div
- color: tomato
- top: 0
diff --git a/node_modules/csscomb/test/options/sort-order-sass/extend.expected.sass b/node_modules/csscomb/test/options/sort-order-sass/extend.expected.sass
deleted file mode 100644
index a0ba2c9..0000000
--- a/node_modules/csscomb/test/options/sort-order-sass/extend.expected.sass
+++ /dev/null
@@ -1,3 +0,0 @@
- div
- @extend %nani
- color: tomato
diff --git a/node_modules/csscomb/test/options/sort-order-sass/extend.sass b/node_modules/csscomb/test/options/sort-order-sass/extend.sass
deleted file mode 100644
index fe9c177..0000000
--- a/node_modules/csscomb/test/options/sort-order-sass/extend.sass
+++ /dev/null
@@ -1,3 +0,0 @@
- div
- color: tomato
- @extend %nani
diff --git a/node_modules/csscomb/test/options/sort-order-sass/import.expected.sass b/node_modules/csscomb/test/options/sort-order-sass/import.expected.sass
deleted file mode 100644
index f1f2c6a..0000000
--- a/node_modules/csscomb/test/options/sort-order-sass/import.expected.sass
+++ /dev/null
@@ -1,3 +0,0 @@
- div
- @import "foo.css"
- color: tomato
diff --git a/node_modules/csscomb/test/options/sort-order-sass/import.sass b/node_modules/csscomb/test/options/sort-order-sass/import.sass
deleted file mode 100644
index 659f76e..0000000
--- a/node_modules/csscomb/test/options/sort-order-sass/import.sass
+++ /dev/null
@@ -1,3 +0,0 @@
- div
- color: tomato
- @import "foo.css"
diff --git a/node_modules/csscomb/test/options/sort-order-sass/include.expected.sass b/node_modules/csscomb/test/options/sort-order-sass/include.expected.sass
deleted file mode 100644
index f7a50a7..0000000
--- a/node_modules/csscomb/test/options/sort-order-sass/include.expected.sass
+++ /dev/null
@@ -1,3 +0,0 @@
-div
- @include .nani
- color: tomato
diff --git a/node_modules/csscomb/test/options/sort-order-sass/include.sass b/node_modules/csscomb/test/options/sort-order-sass/include.sass
deleted file mode 100644
index 9c7ac8b..0000000
--- a/node_modules/csscomb/test/options/sort-order-sass/include.sass
+++ /dev/null
@@ -1,3 +0,0 @@
-div
- color: tomato
- @include .nani
diff --git a/node_modules/csscomb/test/options/sort-order-sass/mixin.expected.sass b/node_modules/csscomb/test/options/sort-order-sass/mixin.expected.sass
deleted file mode 100644
index e441062..0000000
--- a/node_modules/csscomb/test/options/sort-order-sass/mixin.expected.sass
+++ /dev/null
@@ -1,4 +0,0 @@
-.foo
- @include nani
- top: 0
- color: tomato
diff --git a/node_modules/csscomb/test/options/sort-order-sass/mixin.sass b/node_modules/csscomb/test/options/sort-order-sass/mixin.sass
deleted file mode 100644
index d22987c..0000000
--- a/node_modules/csscomb/test/options/sort-order-sass/mixin.sass
+++ /dev/null
@@ -1,4 +0,0 @@
-.foo
- @include nani
- color: tomato
- top: 0
diff --git a/node_modules/csscomb/test/options/sort-order-sass/nested-rule-1.expected.sass b/node_modules/csscomb/test/options/sort-order-sass/nested-rule-1.expected.sass
deleted file mode 100644
index 101521f..0000000
--- a/node_modules/csscomb/test/options/sort-order-sass/nested-rule-1.expected.sass
+++ /dev/null
@@ -1,5 +0,0 @@
-div
- color: tomato
- a
- top: 0
- color: nani
diff --git a/node_modules/csscomb/test/options/sort-order-sass/nested-rule-1.sass b/node_modules/csscomb/test/options/sort-order-sass/nested-rule-1.sass
deleted file mode 100644
index 3394a7c..0000000
--- a/node_modules/csscomb/test/options/sort-order-sass/nested-rule-1.sass
+++ /dev/null
@@ -1,5 +0,0 @@
-div
- color: tomato
- a
- color: nani
- top: 0
diff --git a/node_modules/csscomb/test/options/sort-order-sass/nested-rule-2.expected.sass b/node_modules/csscomb/test/options/sort-order-sass/nested-rule-2.expected.sass
deleted file mode 100644
index 54a0fb8..0000000
--- a/node_modules/csscomb/test/options/sort-order-sass/nested-rule-2.expected.sass
+++ /dev/null
@@ -1,6 +0,0 @@
-div
- left: 0
- color: tomato
- a
- top: 0
- color: nani
diff --git a/node_modules/csscomb/test/options/sort-order-sass/nested-rule-2.sass b/node_modules/csscomb/test/options/sort-order-sass/nested-rule-2.sass
deleted file mode 100644
index 9815840..0000000
--- a/node_modules/csscomb/test/options/sort-order-sass/nested-rule-2.sass
+++ /dev/null
@@ -1,6 +0,0 @@
-div
- color: tomato
- a
- color: nani
- top: 0
- left: 0
diff --git a/node_modules/csscomb/test/options/sort-order-sass/rule.expected.sass b/node_modules/csscomb/test/options/sort-order-sass/rule.expected.sass
deleted file mode 100644
index c6e1f54..0000000
--- a/node_modules/csscomb/test/options/sort-order-sass/rule.expected.sass
+++ /dev/null
@@ -1,3 +0,0 @@
-div
- top: 0
- color: tomato
diff --git a/node_modules/csscomb/test/options/sort-order-sass/rule.sass b/node_modules/csscomb/test/options/sort-order-sass/rule.sass
deleted file mode 100644
index 6d835e2..0000000
--- a/node_modules/csscomb/test/options/sort-order-sass/rule.sass
+++ /dev/null
@@ -1,3 +0,0 @@
-div
- color: tomato
- top: 0
diff --git a/node_modules/csscomb/test/options/sort-order-sass/ruleset.expected.sass b/node_modules/csscomb/test/options/sort-order-sass/ruleset.expected.sass
deleted file mode 100644
index 54a0fb8..0000000
--- a/node_modules/csscomb/test/options/sort-order-sass/ruleset.expected.sass
+++ /dev/null
@@ -1,6 +0,0 @@
-div
- left: 0
- color: tomato
- a
- top: 0
- color: nani
diff --git a/node_modules/csscomb/test/options/sort-order-sass/ruleset.sass b/node_modules/csscomb/test/options/sort-order-sass/ruleset.sass
deleted file mode 100644
index 9815840..0000000
--- a/node_modules/csscomb/test/options/sort-order-sass/ruleset.sass
+++ /dev/null
@@ -1,6 +0,0 @@
-div
- color: tomato
- a
- color: nani
- top: 0
- left: 0
diff --git a/node_modules/csscomb/test/options/sort-order-sass/variable.expected.sass b/node_modules/csscomb/test/options/sort-order-sass/variable.expected.sass
deleted file mode 100644
index c7c3634..0000000
--- a/node_modules/csscomb/test/options/sort-order-sass/variable.expected.sass
+++ /dev/null
@@ -1,3 +0,0 @@
-div
- $red: tomato
- color: $tomato
diff --git a/node_modules/csscomb/test/options/sort-order-sass/variable.sass b/node_modules/csscomb/test/options/sort-order-sass/variable.sass
deleted file mode 100644
index 31bc5a3..0000000
--- a/node_modules/csscomb/test/options/sort-order-sass/variable.sass
+++ /dev/null
@@ -1,3 +0,0 @@
-div
- color: $tomato
- $red: tomato
diff --git a/node_modules/csscomb/test/options/sort-order-scss.js b/node_modules/csscomb/test/options/sort-order-scss.js
deleted file mode 100644
index 517724d..0000000
--- a/node_modules/csscomb/test/options/sort-order-scss.js
+++ /dev/null
@@ -1,116 +0,0 @@
-describe('options/sort-order (scss)', function() {
- beforeEach(function() {
- this.filename = __filename;
- });
-
- it('Should sort properties inside rules (single line)', function() {
- this.comb.configure({ 'sort-order': [
- ['top', 'color']
- ] });
- this.shouldBeEqual('rule.scss', 'rule.expected.scss');
- });
-
- it('Should sort properties inside rules (multiple lines)', function() {
- this.comb.configure({ 'sort-order': [
- ['top', 'color']
- ] });
- this.shouldBeEqual('rule.scss', 'rule.expected.scss');
- });
-
- it('Should sort properties inside nested rules', function() {
- this.comb.configure({ 'sort-order': [
- ['top', 'color']
- ] });
- this.shouldBeEqual('nested-rule-1.scss', 'nested-rule-1.expected.scss');
- });
-
- it('Should sort properties divided by nested rules', function() {
- this.comb.configure({ 'sort-order': [
- ['top', 'left', 'color']
- ] });
- this.shouldBeEqual('nested-rule-2.scss', 'nested-rule-2.expected.scss');
- });
-
- it('Should group declarations with proper comments and spaces (multiple lines)', function() {
- this.comb.configure({ 'sort-order': [
- ['top', 'color']
- ] });
- this.shouldBeEqual('comments-1.scss', 'comments-1.expected.scss');
- });
-
- it('Should group declarations with proper comments and spaces (single line)', function() {
- this.comb.configure({ 'sort-order': [
- ['top', 'color']
- ] });
- this.shouldBeEqual('comments-2.scss', 'comments-2.expected.scss');
- });
-
- it('Should divide properties from different groups with an empty line', function() {
- this.comb.configure({ 'sort-order': [
- ['top'], ['color']
- ] });
- this.shouldBeEqual('different-groups.scss', 'different-groups.expected.scss');
- });
-
- it('Should sort variables', function() {
- this.comb.configure({ 'sort-order': [
- ['$variable', 'color']
- ] });
- this.shouldBeEqual('variable.scss', 'variable.expected.scss');
- });
-
- it('Should sort imports', function() {
- this.comb.configure({ 'sort-order': [
- ['$import', 'color']
- ] });
- this.shouldBeEqual('import.scss', 'import.expected.scss');
- });
-
- it('Should sort @include-s', function() {
- this.comb.configure({ 'sort-order': [
- ['$include', 'color']
- ] });
- this.shouldBeEqual('include.scss', 'include.expected.scss');
- });
-
- it('Should sort @extend-s', function() {
- this.comb.configure({ 'sort-order': [
- ['$include', 'color']
- ] });
- this.shouldBeEqual('extend.scss', 'extend.expected.scss');
- });
-
- it('Should sort properties inside blocks passed to mixins', function() {
- this.comb.configure({ 'sort-order': [
- ['top', 'color']
- ] });
- this.shouldBeEqual('mixin.scss', 'mixin.expected.scss');
- });
-
- it('Should handle properties preceeding rulesets', function() {
- this.comb.configure({ 'sort-order': [
- ['top', 'left', 'color']
- ] });
- this.shouldBeEqual('ruleset.scss', 'ruleset.expected.scss');
- });
-
- it('Should handle properties preceeding conditions', function() {
- this.comb.configure({ 'sort-order': [
- ['font-size', 'display', 'top', 'color']
- ] });
- this.shouldBeEqual('condition.scss', 'condition.expected.scss');
- });
-
- it('Should sort complex case with leftovers', function() {
- this.comb.configure({
- "sort-order": [
- ["$variable"],
- ["position"],
- ["...", "border"],
- ["$include"],
- ["font"]
- ]
- });
- this.shouldBeEqual('leftovers.scss', 'leftovers.expected.scss');
- });
-});
diff --git a/node_modules/csscomb/test/options/sort-order-scss/comments-1.expected.scss b/node_modules/csscomb/test/options/sort-order-scss/comments-1.expected.scss
deleted file mode 100644
index 0aa257a..0000000
--- a/node_modules/csscomb/test/options/sort-order-scss/comments-1.expected.scss
+++ /dev/null
@@ -1,7 +0,0 @@
-div {
- /* 2 */
- /* 3 */
- top: 0; /* 4 */
- color: tomato; /* 1 */
- /* 5 */
-}
diff --git a/node_modules/csscomb/test/options/sort-order-scss/comments-1.scss b/node_modules/csscomb/test/options/sort-order-scss/comments-1.scss
deleted file mode 100644
index 18e6319..0000000
--- a/node_modules/csscomb/test/options/sort-order-scss/comments-1.scss
+++ /dev/null
@@ -1,7 +0,0 @@
-div {
- color: tomato; /* 1 */
- /* 2 */
- /* 3 */
- top: 0; /* 4 */
- /* 5 */
-}
diff --git a/node_modules/csscomb/test/options/sort-order-scss/comments-2.expected.scss b/node_modules/csscomb/test/options/sort-order-scss/comments-2.expected.scss
deleted file mode 100644
index a9b2976..0000000
--- a/node_modules/csscomb/test/options/sort-order-scss/comments-2.expected.scss
+++ /dev/null
@@ -1 +0,0 @@
-div {top: 0; /* 3 */ /* 4 *//* 1 */ color: tomato; /* 2 */ }
diff --git a/node_modules/csscomb/test/options/sort-order-scss/comments-2.scss b/node_modules/csscomb/test/options/sort-order-scss/comments-2.scss
deleted file mode 100644
index 617d4fd..0000000
--- a/node_modules/csscomb/test/options/sort-order-scss/comments-2.scss
+++ /dev/null
@@ -1 +0,0 @@
-div {/* 1 */ color: tomato; /* 2 */ top: 0; /* 3 */ /* 4 */}
diff --git a/node_modules/csscomb/test/options/sort-order-scss/condition.expected.scss b/node_modules/csscomb/test/options/sort-order-scss/condition.expected.scss
deleted file mode 100644
index e56af51..0000000
--- a/node_modules/csscomb/test/options/sort-order-scss/condition.expected.scss
+++ /dev/null
@@ -1,8 +0,0 @@
-div {
- top: 0;
- color: tomato;
- @if @color == tomato {
- font-size: 2px;
- display: block;
- }
- }
diff --git a/node_modules/csscomb/test/options/sort-order-scss/condition.scss b/node_modules/csscomb/test/options/sort-order-scss/condition.scss
deleted file mode 100644
index 9211813..0000000
--- a/node_modules/csscomb/test/options/sort-order-scss/condition.scss
+++ /dev/null
@@ -1,8 +0,0 @@
-div {
- color: tomato;
- @if @color == tomato {
- display: block;
- font-size: 2px;
- }
- top: 0;
- }
diff --git a/node_modules/csscomb/test/options/sort-order-scss/different-groups.expected.scss b/node_modules/csscomb/test/options/sort-order-scss/different-groups.expected.scss
deleted file mode 100644
index dddc16f..0000000
--- a/node_modules/csscomb/test/options/sort-order-scss/different-groups.expected.scss
+++ /dev/null
@@ -1,5 +0,0 @@
-div {
- top: 0;
-
- color: tomato;
-}
diff --git a/node_modules/csscomb/test/options/sort-order-scss/different-groups.scss b/node_modules/csscomb/test/options/sort-order-scss/different-groups.scss
deleted file mode 100644
index 7ffa908..0000000
--- a/node_modules/csscomb/test/options/sort-order-scss/different-groups.scss
+++ /dev/null
@@ -1,4 +0,0 @@
-div {
- color: tomato;
- top: 0;
-}
diff --git a/node_modules/csscomb/test/options/sort-order-scss/extend.expected.scss b/node_modules/csscomb/test/options/sort-order-scss/extend.expected.scss
deleted file mode 100644
index a1ac4c7..0000000
--- a/node_modules/csscomb/test/options/sort-order-scss/extend.expected.scss
+++ /dev/null
@@ -1 +0,0 @@
-div {@extend %nani; color: tomato; }
diff --git a/node_modules/csscomb/test/options/sort-order-scss/extend.scss b/node_modules/csscomb/test/options/sort-order-scss/extend.scss
deleted file mode 100644
index 381bc92..0000000
--- a/node_modules/csscomb/test/options/sort-order-scss/extend.scss
+++ /dev/null
@@ -1 +0,0 @@
-div { color: tomato; @extend %nani; }
diff --git a/node_modules/csscomb/test/options/sort-order-scss/import.expected.scss b/node_modules/csscomb/test/options/sort-order-scss/import.expected.scss
deleted file mode 100644
index 9c403df..0000000
--- a/node_modules/csscomb/test/options/sort-order-scss/import.expected.scss
+++ /dev/null
@@ -1 +0,0 @@
-div {@import "foo.css"; color: tomato; }
diff --git a/node_modules/csscomb/test/options/sort-order-scss/import.scss b/node_modules/csscomb/test/options/sort-order-scss/import.scss
deleted file mode 100644
index 681ccd0..0000000
--- a/node_modules/csscomb/test/options/sort-order-scss/import.scss
+++ /dev/null
@@ -1 +0,0 @@
-div { color: tomato; @import "foo.css"; }
diff --git a/node_modules/csscomb/test/options/sort-order-scss/include.expected.scss b/node_modules/csscomb/test/options/sort-order-scss/include.expected.scss
deleted file mode 100644
index ea381a7..0000000
--- a/node_modules/csscomb/test/options/sort-order-scss/include.expected.scss
+++ /dev/null
@@ -1 +0,0 @@
-div {@include .nani; color: tomato; }
diff --git a/node_modules/csscomb/test/options/sort-order-scss/include.scss b/node_modules/csscomb/test/options/sort-order-scss/include.scss
deleted file mode 100644
index c0ed134..0000000
--- a/node_modules/csscomb/test/options/sort-order-scss/include.scss
+++ /dev/null
@@ -1 +0,0 @@
-div { color: tomato; @include .nani; }
diff --git a/node_modules/csscomb/test/options/sort-order-scss/leftovers.expected.scss b/node_modules/csscomb/test/options/sort-order-scss/leftovers.expected.scss
deleted file mode 100644
index bac4c99..0000000
--- a/node_modules/csscomb/test/options/sort-order-scss/leftovers.expected.scss
+++ /dev/null
@@ -1,36 +0,0 @@
-a {
- $red: tomato;
-
- position: $tomato;
-
- leftover: yay;
- border: 1px solid;
-
- @include .nani;
-
- font: 20px/16px Arial, sans-serif;
-}
-b {
- $red: tomato;
-
- position: $tomato;
-
- leftover: yay;
- border: 1px solid;
-
- @include .nani;
-
- font: 20px/16px Arial, sans-serif;
-}
-c {
- $red: tomato;
-
- position: $tomato;
-
- leftover: yay;
- border: 1px solid;
-
- @include .nani;
-
- font: 20px/16px Arial, sans-serif;
-}
diff --git a/node_modules/csscomb/test/options/sort-order-scss/leftovers.scss b/node_modules/csscomb/test/options/sort-order-scss/leftovers.scss
deleted file mode 100644
index 0068e54..0000000
--- a/node_modules/csscomb/test/options/sort-order-scss/leftovers.scss
+++ /dev/null
@@ -1,24 +0,0 @@
-a {
- leftover: yay;
- border: 1px solid;
- @include .nani;
- font: 20px/16px Arial, sans-serif;
- position: $tomato;
- $red: tomato;
-}
-b {
- border: 1px solid;
- @include .nani;
- position: $tomato;
- leftover: yay;
- font: 20px/16px Arial, sans-serif;
- $red: tomato;
-}
-c {
- border: 1px solid;
- @include .nani;
- font: 20px/16px Arial, sans-serif;
- position: $tomato;
- $red: tomato;
- leftover: yay;
-}
diff --git a/node_modules/csscomb/test/options/sort-order-scss/mixin.expected.scss b/node_modules/csscomb/test/options/sort-order-scss/mixin.expected.scss
deleted file mode 100644
index abfbef4..0000000
--- a/node_modules/csscomb/test/options/sort-order-scss/mixin.expected.scss
+++ /dev/null
@@ -1 +0,0 @@
-.foo { @include nani {top: 0; color: tomato; } }
diff --git a/node_modules/csscomb/test/options/sort-order-scss/mixin.scss b/node_modules/csscomb/test/options/sort-order-scss/mixin.scss
deleted file mode 100644
index b174d3b..0000000
--- a/node_modules/csscomb/test/options/sort-order-scss/mixin.scss
+++ /dev/null
@@ -1 +0,0 @@
-.foo { @include nani { color: tomato; top: 0; } }
diff --git a/node_modules/csscomb/test/options/sort-order-scss/nested-rule-1.expected.scss b/node_modules/csscomb/test/options/sort-order-scss/nested-rule-1.expected.scss
deleted file mode 100644
index 54dada6..0000000
--- a/node_modules/csscomb/test/options/sort-order-scss/nested-rule-1.expected.scss
+++ /dev/null
@@ -1 +0,0 @@
-div { color: tomato; a {top: 0; color: nani; } }
diff --git a/node_modules/csscomb/test/options/sort-order-scss/nested-rule-1.scss b/node_modules/csscomb/test/options/sort-order-scss/nested-rule-1.scss
deleted file mode 100644
index ee50453..0000000
--- a/node_modules/csscomb/test/options/sort-order-scss/nested-rule-1.scss
+++ /dev/null
@@ -1 +0,0 @@
-div { color: tomato; a { color: nani; top: 0; } }
diff --git a/node_modules/csscomb/test/options/sort-order-scss/nested-rule-2.expected.scss b/node_modules/csscomb/test/options/sort-order-scss/nested-rule-2.expected.scss
deleted file mode 100644
index f5c2e9f..0000000
--- a/node_modules/csscomb/test/options/sort-order-scss/nested-rule-2.expected.scss
+++ /dev/null
@@ -1 +0,0 @@
-div { left: 0; color: tomato; a {top: 0; color: nani; }}
diff --git a/node_modules/csscomb/test/options/sort-order-scss/nested-rule-2.scss b/node_modules/csscomb/test/options/sort-order-scss/nested-rule-2.scss
deleted file mode 100644
index 0bc6212..0000000
--- a/node_modules/csscomb/test/options/sort-order-scss/nested-rule-2.scss
+++ /dev/null
@@ -1 +0,0 @@
-div { color: tomato; a { color: nani; top: 0; } left: 0; }
diff --git a/node_modules/csscomb/test/options/sort-order-scss/rule-multiline.expected.scss b/node_modules/csscomb/test/options/sort-order-scss/rule-multiline.expected.scss
deleted file mode 100644
index 5f6d5e3..0000000
--- a/node_modules/csscomb/test/options/sort-order-scss/rule-multiline.expected.scss
+++ /dev/null
@@ -1,4 +0,0 @@
-div {
- top: 0;
- color: tomato;
- }
diff --git a/node_modules/csscomb/test/options/sort-order-scss/rule-multiline.scss b/node_modules/csscomb/test/options/sort-order-scss/rule-multiline.scss
deleted file mode 100644
index 8ae2931..0000000
--- a/node_modules/csscomb/test/options/sort-order-scss/rule-multiline.scss
+++ /dev/null
@@ -1,4 +0,0 @@
-div {
- color: tomato;
- top: 0;
- }
diff --git a/node_modules/csscomb/test/options/sort-order-scss/rule.expected.scss b/node_modules/csscomb/test/options/sort-order-scss/rule.expected.scss
deleted file mode 100644
index a7669bd..0000000
--- a/node_modules/csscomb/test/options/sort-order-scss/rule.expected.scss
+++ /dev/null
@@ -1 +0,0 @@
-div {top: 0; color: tomato; }
diff --git a/node_modules/csscomb/test/options/sort-order-scss/rule.scss b/node_modules/csscomb/test/options/sort-order-scss/rule.scss
deleted file mode 100644
index 561b980..0000000
--- a/node_modules/csscomb/test/options/sort-order-scss/rule.scss
+++ /dev/null
@@ -1 +0,0 @@
-div { color: tomato; top: 0; }
diff --git a/node_modules/csscomb/test/options/sort-order-scss/ruleset.expected.scss b/node_modules/csscomb/test/options/sort-order-scss/ruleset.expected.scss
deleted file mode 100644
index 194ff87..0000000
--- a/node_modules/csscomb/test/options/sort-order-scss/ruleset.expected.scss
+++ /dev/null
@@ -1,8 +0,0 @@
-div {
- left: 0;
- color: tomato;
- a {
- top: 0;
- color: nani;
- }
-}
diff --git a/node_modules/csscomb/test/options/sort-order-scss/ruleset.scss b/node_modules/csscomb/test/options/sort-order-scss/ruleset.scss
deleted file mode 100644
index d7ed641..0000000
--- a/node_modules/csscomb/test/options/sort-order-scss/ruleset.scss
+++ /dev/null
@@ -1,8 +0,0 @@
-div {
- color: tomato;
- a {
- color: nani;
- top: 0;
- }
- left: 0;
-}
diff --git a/node_modules/csscomb/test/options/sort-order-scss/variable.expected.scss b/node_modules/csscomb/test/options/sort-order-scss/variable.expected.scss
deleted file mode 100644
index c17c634..0000000
--- a/node_modules/csscomb/test/options/sort-order-scss/variable.expected.scss
+++ /dev/null
@@ -1 +0,0 @@
-div {$red: tomato; color: $tomato; }
diff --git a/node_modules/csscomb/test/options/sort-order-scss/variable.scss b/node_modules/csscomb/test/options/sort-order-scss/variable.scss
deleted file mode 100644
index f759f22..0000000
--- a/node_modules/csscomb/test/options/sort-order-scss/variable.scss
+++ /dev/null
@@ -1 +0,0 @@
-div { color: $tomato; $red: tomato; }
diff --git a/node_modules/csscomb/test/options/sort-order.js b/node_modules/csscomb/test/options/sort-order.js
deleted file mode 100644
index c8f7077..0000000
--- a/node_modules/csscomb/test/options/sort-order.js
+++ /dev/null
@@ -1,115 +0,0 @@
-var assert = require('assert');
-
-describe('options/sort-order', function() {
- beforeEach(function() {
- this.filename = __filename;
- });
-
- it('Should be in expected order in case properties are not grouped', function() {
- this.comb.configure({ 'sort-order': ['position', 'z-index'] });
- this.shouldBeEqual('single-group.css', 'single-group.expected.css');
- });
-
- it('Should be in expected order in case of 1 group', function() {
- this.comb.configure({ 'sort-order': [
- ['position', 'z-index']
- ] });
- this.shouldBeEqual('single-group.css', 'single-group.expected.css');
- });
-
- it('Shuld be in expected order in case of multiple groups', function() {
- this.comb.configure({ 'sort-order': [
- ['position', 'z-index'],
- ['width', 'height']
- ] });
- this.shouldBeEqual('multiple-groups.css', 'multiple-groups.expected.css');
-
- });
-
- it('Should work correctly with comments in case of 1 group', function() {
- this.comb.configure({ 'sort-order': [
- ['border-bottom', 'font-style'],
- ] });
- this.shouldBeEqual('single-group-comments.css', 'single-group-comments.expected.css');
- });
-
- it('Should work correctly with comments in case of multiple groups', function() {
- this.comb.configure({ 'sort-order': [
- ['margin'],
- ['padding']
- ] });
- this.shouldBeEqual('multiple-groups-comments.css', 'multiple-groups-comments.expected.css');
- });
-
- it('Should parse semicolons inside data uri correctly', function() {
- this.comb.configure({
- 'sort-order': [
- ['position', 'background', 'color']
- ]
- });
- this.shouldBeEqual('data-uri.css', 'data-uri.expected.css');
- });
-
- it('Should not add more than 1 line between groups', function() {
- var input = this.readFile('multiple-groups-2.css');
- var expected = this.readFile('multiple-groups-2.expected.css');
- this.comb.configure({
- 'sort-order': [
- ['top'], ['color']
- ]
- });
-
- for (var i = 6; i--;) {
- input = this.comb.processString(input);
- }
- assert.equal(input, expected);
- });
-
- it('Issue 94. Test 1', function() {
- var config = this.Comb.getConfig('csscomb');
- this.comb.configure(config);
- this.shouldBeEqual('issue-94-1.css', 'issue-94-1.expected.css');
- });
-
- it('Issue 94. Test 2', function() {
- var config = this.Comb.getConfig('csscomb');
- this.comb.configure(config);
- this.shouldBeEqual('issue-94-2.css', 'issue-94-2.expected.css');
- });
-
- it('Issue 94. Test 3', function() {
- var config = this.Comb.getConfig('csscomb');
- this.comb.configure(config);
- this.shouldBeEqual('issue-94-3.css', 'issue-94-3.expected.css');
- });
-
- it('Should place the leftovers in the end', function() {
- var config = this.Comb.getConfig('csscomb');
- this.comb.configure(config);
- this.shouldBeEqual('leftovers-1.css', 'leftovers-1.expected.css');
- });
-
- it('Should place the leftovers in the beginning', function() {
- var config = this.Comb.getConfig('csscomb');
- config['sort-order'][0].unshift(['...']);
- this.comb.configure(config);
- this.shouldBeEqual('leftovers-2.css', 'leftovers-2.expected.css');
- config['sort-order'][0].shift();
- });
-
- it('Should place the leftovers in the beginning of its group', function() {
- var config = this.Comb.getConfig('csscomb');
- config['sort-order'][1].unshift('...');
- this.comb.configure(config);
- this.shouldBeEqual('leftovers-3.css', 'leftovers-3.expected.css');
- config['sort-order'][1].shift();
- });
-
- it('Should place the leftovers in the middle of its group', function() {
- var config = this.Comb.getConfig('csscomb');
- config['sort-order'][1].splice(1, 0, '...');
- this.comb.configure(config);
- this.shouldBeEqual('leftovers-4.css', 'leftovers-4.expected.css');
- config['sort-order'][1].splice(1, 1);
- });
-});
diff --git a/node_modules/csscomb/test/options/sort-order/data-uri.css b/node_modules/csscomb/test/options/sort-order/data-uri.css
deleted file mode 100644
index 3552dfe..0000000
--- a/node_modules/csscomb/test/options/sort-order/data-uri.css
+++ /dev/null
@@ -1,7 +0,0 @@
-a
-{
- color: tomato;
- background: #D2D2D2 no-repeat url('data:image/svg+xml;charset=US-ASCII.naninani');
- position: absolute;
-}
-
diff --git a/node_modules/csscomb/test/options/sort-order/data-uri.expected.css b/node_modules/csscomb/test/options/sort-order/data-uri.expected.css
deleted file mode 100644
index 74b14a2..0000000
--- a/node_modules/csscomb/test/options/sort-order/data-uri.expected.css
+++ /dev/null
@@ -1,7 +0,0 @@
-a
-{
- position: absolute;
- background: #D2D2D2 no-repeat url('data:image/svg+xml;charset=US-ASCII.naninani');
- color: tomato;
-}
-
diff --git a/node_modules/csscomb/test/options/sort-order/issue-94-1.css b/node_modules/csscomb/test/options/sort-order/issue-94-1.css
deleted file mode 100644
index 54131c5..0000000
--- a/node_modules/csscomb/test/options/sort-order/issue-94-1.css
+++ /dev/null
@@ -1,18 +0,0 @@
-.test
-{
- position: absolute;
- top: -1px;
- right: -1px;
- bottom: -1px;
- left: -1px;
-
- border: 1px solid transparent;
- border-color: rgba(0,0,0,0.38) rgba(0,0,0,0.27) rgba(0,0,0,0.16);
-
- background: -webkit-linear-gradient(#fff, #fff);
- background: linear-gradient(#fff, #fff);
- background-clip: padding-box;
- background-size: 16px 16px;
-
- -webkit-appearance: textfield;
-}
diff --git a/node_modules/csscomb/test/options/sort-order/issue-94-1.expected.css b/node_modules/csscomb/test/options/sort-order/issue-94-1.expected.css
deleted file mode 100644
index 0943808..0000000
--- a/node_modules/csscomb/test/options/sort-order/issue-94-1.expected.css
+++ /dev/null
@@ -1,17 +0,0 @@
-.test
-{
- position: absolute;
- top: -1px;
- right: -1px;
- bottom: -1px;
- left: -1px;
-
- border: 1px solid transparent;
- border-color: rgba(0,0,0,.38) rgba(0,0,0,.27) rgba(0,0,0,.16);
- background: -webkit-linear-gradient(#fff, #fff);
- background: linear-gradient(#fff, #fff);
- background-clip: padding-box;
- background-size: 16px 16px;
-
- -webkit-appearance: textfield;
-}
diff --git a/node_modules/csscomb/test/options/sort-order/issue-94-2.css b/node_modules/csscomb/test/options/sort-order/issue-94-2.css
deleted file mode 100644
index 0365913..0000000
--- a/node_modules/csscomb/test/options/sort-order/issue-94-2.css
+++ /dev/null
@@ -1,19 +0,0 @@
-.test
-{
- width: 0;
- width: 100%;
- height: 0;
-
- background: #fff;
- color: #000;
-
- display: -moz-inline-stack;
- display: inline-block;
-
- position: absolute;
- position: fixed;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
-}
diff --git a/node_modules/csscomb/test/options/sort-order/issue-94-2.expected.css b/node_modules/csscomb/test/options/sort-order/issue-94-2.expected.css
deleted file mode 100644
index 85e618d..0000000
--- a/node_modules/csscomb/test/options/sort-order/issue-94-2.expected.css
+++ /dev/null
@@ -1,19 +0,0 @@
-.test
-{
- position: absolute;
- position: fixed;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
-
- display: -moz-inline-stack;
- display: inline-block;
-
- width: 0;
- width: 100%;
- height: 0;
-
- color: #000;
- background: #fff;
-}
diff --git a/node_modules/csscomb/test/options/sort-order/issue-94-3.css b/node_modules/csscomb/test/options/sort-order/issue-94-3.css
deleted file mode 100644
index 872eddc..0000000
--- a/node_modules/csscomb/test/options/sort-order/issue-94-3.css
+++ /dev/null
@@ -1,21 +0,0 @@
-.input-view {
- position: absolute;
- -webkit-appearance: none;
- right: -1px;
- bottom: -1px;
- left: -1px;
-
- border: 1px solid transparent;
-
- top: -1px;
-
- background: -webkit-linear-gradient(#FFF, #FFF);
- background: linear-gradient(#FFF, #FFF);
- background-clip: padding-box;
- background-size: 16px 16px;
- box-shadow: 0 1px 0 rgba(255,255,255,0.2), inset 0 1px 1px rgba(0,0,0,0.1);
-
- border-color: rgba(0,0,0,0.27);
- border-top-color: rgba(0,0,0,0.38);
- border-bottom-color: rgba(0,0,0,0.16);
-}
diff --git a/node_modules/csscomb/test/options/sort-order/issue-94-3.expected.css b/node_modules/csscomb/test/options/sort-order/issue-94-3.expected.css
deleted file mode 100644
index 92f2943..0000000
--- a/node_modules/csscomb/test/options/sort-order/issue-94-3.expected.css
+++ /dev/null
@@ -1,20 +0,0 @@
-.input-view
-{
- position: absolute;
- top: -1px;
- right: -1px;
- bottom: -1px;
- left: -1px;
-
- border: 1px solid transparent;
- border-color: rgba(0,0,0,.27);
- border-top-color: rgba(0,0,0,.38);
- border-bottom-color: rgba(0,0,0,.16);
- background: -webkit-linear-gradient(#fff, #fff);
- background: linear-gradient(#fff, #fff);
- background-clip: padding-box;
- background-size: 16px 16px;
- box-shadow: 0 1px 0 rgba(255,255,255,.2), inset 0 1px 1px rgba(0,0,0,.1);
-
- -webkit-appearance: none;
-}
diff --git a/node_modules/csscomb/test/options/sort-order/leftovers-1.css b/node_modules/csscomb/test/options/sort-order/leftovers-1.css
deleted file mode 100644
index d559d4e..0000000
--- a/node_modules/csscomb/test/options/sort-order/leftovers-1.css
+++ /dev/null
@@ -1,20 +0,0 @@
-a
-{
- leftover: yay;
- z-index: 1;
- position: absolute;
-}
-
-b
-{
- z-index: 2;
- leftover: yay;
- position: absolute;
-}
-
-c
-{
- z-index: 3;
- position: absolute;
- leftover: yay;
-}
diff --git a/node_modules/csscomb/test/options/sort-order/leftovers-1.expected.css b/node_modules/csscomb/test/options/sort-order/leftovers-1.expected.css
deleted file mode 100644
index 145b83d..0000000
--- a/node_modules/csscomb/test/options/sort-order/leftovers-1.expected.css
+++ /dev/null
@@ -1,23 +0,0 @@
-a
-{
- position: absolute;
- z-index: 1;
-
- leftover: yay;
-}
-
-b
-{
- position: absolute;
- z-index: 2;
-
- leftover: yay;
-}
-
-c
-{
- position: absolute;
- z-index: 3;
-
- leftover: yay;
-}
diff --git a/node_modules/csscomb/test/options/sort-order/leftovers-2.css b/node_modules/csscomb/test/options/sort-order/leftovers-2.css
deleted file mode 100644
index d559d4e..0000000
--- a/node_modules/csscomb/test/options/sort-order/leftovers-2.css
+++ /dev/null
@@ -1,20 +0,0 @@
-a
-{
- leftover: yay;
- z-index: 1;
- position: absolute;
-}
-
-b
-{
- z-index: 2;
- leftover: yay;
- position: absolute;
-}
-
-c
-{
- z-index: 3;
- position: absolute;
- leftover: yay;
-}
diff --git a/node_modules/csscomb/test/options/sort-order/leftovers-2.expected.css b/node_modules/csscomb/test/options/sort-order/leftovers-2.expected.css
deleted file mode 100644
index 05c8292..0000000
--- a/node_modules/csscomb/test/options/sort-order/leftovers-2.expected.css
+++ /dev/null
@@ -1,23 +0,0 @@
-a
-{
- leftover: yay;
-
- position: absolute;
- z-index: 1;
-}
-
-b
-{
- leftover: yay;
-
- position: absolute;
- z-index: 2;
-}
-
-c
-{
- leftover: yay;
-
- position: absolute;
- z-index: 3;
-}
diff --git a/node_modules/csscomb/test/options/sort-order/leftovers-3.css b/node_modules/csscomb/test/options/sort-order/leftovers-3.css
deleted file mode 100644
index d559d4e..0000000
--- a/node_modules/csscomb/test/options/sort-order/leftovers-3.css
+++ /dev/null
@@ -1,20 +0,0 @@
-a
-{
- leftover: yay;
- z-index: 1;
- position: absolute;
-}
-
-b
-{
- z-index: 2;
- leftover: yay;
- position: absolute;
-}
-
-c
-{
- z-index: 3;
- position: absolute;
- leftover: yay;
-}
diff --git a/node_modules/csscomb/test/options/sort-order/leftovers-3.expected.css b/node_modules/csscomb/test/options/sort-order/leftovers-3.expected.css
deleted file mode 100644
index 9522dc5..0000000
--- a/node_modules/csscomb/test/options/sort-order/leftovers-3.expected.css
+++ /dev/null
@@ -1,20 +0,0 @@
-a
-{
- leftover: yay;
- position: absolute;
- z-index: 1;
-}
-
-b
-{
- leftover: yay;
- position: absolute;
- z-index: 2;
-}
-
-c
-{
- leftover: yay;
- position: absolute;
- z-index: 3;
-}
diff --git a/node_modules/csscomb/test/options/sort-order/leftovers-4.css b/node_modules/csscomb/test/options/sort-order/leftovers-4.css
deleted file mode 100644
index d559d4e..0000000
--- a/node_modules/csscomb/test/options/sort-order/leftovers-4.css
+++ /dev/null
@@ -1,20 +0,0 @@
-a
-{
- leftover: yay;
- z-index: 1;
- position: absolute;
-}
-
-b
-{
- z-index: 2;
- leftover: yay;
- position: absolute;
-}
-
-c
-{
- z-index: 3;
- position: absolute;
- leftover: yay;
-}
diff --git a/node_modules/csscomb/test/options/sort-order/leftovers-4.expected.css b/node_modules/csscomb/test/options/sort-order/leftovers-4.expected.css
deleted file mode 100644
index 874c72a..0000000
--- a/node_modules/csscomb/test/options/sort-order/leftovers-4.expected.css
+++ /dev/null
@@ -1,20 +0,0 @@
-a
-{
- position: absolute;
- leftover: yay;
- z-index: 1;
-}
-
-b
-{
- position: absolute;
- leftover: yay;
- z-index: 2;
-}
-
-c
-{
- position: absolute;
- leftover: yay;
- z-index: 3;
-}
diff --git a/node_modules/csscomb/test/options/sort-order/multiple-groups-2.css b/node_modules/csscomb/test/options/sort-order/multiple-groups-2.css
deleted file mode 100644
index 79291ab..0000000
--- a/node_modules/csscomb/test/options/sort-order/multiple-groups-2.css
+++ /dev/null
@@ -1,6 +0,0 @@
-a
-{
- color: tomato;
- top: 0;
-}
-
diff --git a/node_modules/csscomb/test/options/sort-order/multiple-groups-2.expected.css b/node_modules/csscomb/test/options/sort-order/multiple-groups-2.expected.css
deleted file mode 100644
index 96a0ec2..0000000
--- a/node_modules/csscomb/test/options/sort-order/multiple-groups-2.expected.css
+++ /dev/null
@@ -1,7 +0,0 @@
-a
-{
- top: 0;
-
- color: tomato;
-}
-
diff --git a/node_modules/csscomb/test/options/sort-order/multiple-groups-comments.css b/node_modules/csscomb/test/options/sort-order/multiple-groups-comments.css
deleted file mode 100644
index 5012f20..0000000
--- a/node_modules/csscomb/test/options/sort-order/multiple-groups-comments.css
+++ /dev/null
@@ -1,5 +0,0 @@
-a, b, i /* foobar */
-{
- padding: 0;
- margin: 0;
- }
diff --git a/node_modules/csscomb/test/options/sort-order/multiple-groups-comments.expected.css b/node_modules/csscomb/test/options/sort-order/multiple-groups-comments.expected.css
deleted file mode 100644
index 49a1ba8..0000000
--- a/node_modules/csscomb/test/options/sort-order/multiple-groups-comments.expected.css
+++ /dev/null
@@ -1,6 +0,0 @@
-a, b, i /* foobar */
-{
- margin: 0;
-
- padding: 0;
- }
diff --git a/node_modules/csscomb/test/options/sort-order/multiple-groups.css b/node_modules/csscomb/test/options/sort-order/multiple-groups.css
deleted file mode 100644
index a16d45e..0000000
--- a/node_modules/csscomb/test/options/sort-order/multiple-groups.css
+++ /dev/null
@@ -1,7 +0,0 @@
-a
-{
- z-index: 2;
- position: absolute;
- height: 2px;
- width: 2px;
-}
diff --git a/node_modules/csscomb/test/options/sort-order/multiple-groups.expected.css b/node_modules/csscomb/test/options/sort-order/multiple-groups.expected.css
deleted file mode 100644
index 3f27b45..0000000
--- a/node_modules/csscomb/test/options/sort-order/multiple-groups.expected.css
+++ /dev/null
@@ -1,8 +0,0 @@
-a
-{
- position: absolute;
- z-index: 2;
-
- width: 2px;
- height: 2px;
-}
diff --git a/node_modules/csscomb/test/options/sort-order/single-group-comments.css b/node_modules/csscomb/test/options/sort-order/single-group-comments.css
deleted file mode 100644
index dc78ba3..0000000
--- a/node_modules/csscomb/test/options/sort-order/single-group-comments.css
+++ /dev/null
@@ -1,5 +0,0 @@
-div p em {
- /* upline comment */
- font-style:italic;
- border-bottom:1px solid red; /* trololo */ /* trololo */
-}
diff --git a/node_modules/csscomb/test/options/sort-order/single-group-comments.expected.css b/node_modules/csscomb/test/options/sort-order/single-group-comments.expected.css
deleted file mode 100644
index ca4e166..0000000
--- a/node_modules/csscomb/test/options/sort-order/single-group-comments.expected.css
+++ /dev/null
@@ -1,5 +0,0 @@
-div p em {
- border-bottom:1px solid red; /* trololo */ /* trololo */
- /* upline comment */
- font-style:italic;
-}
diff --git a/node_modules/csscomb/test/options/sort-order/single-group.css b/node_modules/csscomb/test/options/sort-order/single-group.css
deleted file mode 100644
index ed8925d..0000000
--- a/node_modules/csscomb/test/options/sort-order/single-group.css
+++ /dev/null
@@ -1,5 +0,0 @@
-a
-{
- z-index: 2;
- position: absolute;
-}
diff --git a/node_modules/csscomb/test/options/sort-order/single-group.expected.css b/node_modules/csscomb/test/options/sort-order/single-group.expected.css
deleted file mode 100644
index 5bcb46c..0000000
--- a/node_modules/csscomb/test/options/sort-order/single-group.expected.css
+++ /dev/null
@@ -1,5 +0,0 @@
-a
-{
- position: absolute;
- z-index: 2;
-}
diff --git a/node_modules/csscomb/test/options/space-after-colon-sass.js b/node_modules/csscomb/test/options/space-after-colon-sass.js
deleted file mode 100644
index 98f14be..0000000
--- a/node_modules/csscomb/test/options/space-after-colon-sass.js
+++ /dev/null
@@ -1,15 +0,0 @@
-describe('options/space-after-colon (sass):', function() {
- beforeEach(function() {
- this.filename = __filename;
- });
-
- it('Should set proper space if colon is after property name', function() {
- this.comb.configure({ 'space-after-colon': 2 });
- this.shouldBeEqual('colon-after-property-name.sass', 'colon-after-property-name.expected.sass');
- });
-
- it('Should not change space after colon which is before property name', function() {
- this.comb.configure({ 'space-after-colon': 1 });
- this.shouldBeEqual('colon-before-property-name.sass', 'colon-before-property-name.expected.sass');
- });
-});
diff --git a/node_modules/csscomb/test/options/space-after-colon-sass/colon-after-property-name.expected.sass b/node_modules/csscomb/test/options/space-after-colon-sass/colon-after-property-name.expected.sass
deleted file mode 100644
index 9b55f4a..0000000
--- a/node_modules/csscomb/test/options/space-after-colon-sass/colon-after-property-name.expected.sass
+++ /dev/null
@@ -1,3 +0,0 @@
-a
- color: panda
- top: 0
diff --git a/node_modules/csscomb/test/options/space-after-colon-sass/colon-after-property-name.sass b/node_modules/csscomb/test/options/space-after-colon-sass/colon-after-property-name.sass
deleted file mode 100644
index 5e4e236..0000000
--- a/node_modules/csscomb/test/options/space-after-colon-sass/colon-after-property-name.sass
+++ /dev/null
@@ -1,3 +0,0 @@
-a
- color: panda
- top:0
diff --git a/node_modules/csscomb/test/options/space-after-colon-sass/colon-before-property-name.expected.sass b/node_modules/csscomb/test/options/space-after-colon-sass/colon-before-property-name.expected.sass
deleted file mode 100644
index a8a5e3e..0000000
--- a/node_modules/csscomb/test/options/space-after-colon-sass/colon-before-property-name.expected.sass
+++ /dev/null
@@ -1,3 +0,0 @@
-a
- :color panda
- :top 0
diff --git a/node_modules/csscomb/test/options/space-after-colon-sass/colon-before-property-name.sass b/node_modules/csscomb/test/options/space-after-colon-sass/colon-before-property-name.sass
deleted file mode 100644
index a8a5e3e..0000000
--- a/node_modules/csscomb/test/options/space-after-colon-sass/colon-before-property-name.sass
+++ /dev/null
@@ -1,3 +0,0 @@
-a
- :color panda
- :top 0
diff --git a/node_modules/csscomb/test/options/space-after-colon-scss.js b/node_modules/csscomb/test/options/space-after-colon-scss.js
deleted file mode 100644
index 5a9f83b..0000000
--- a/node_modules/csscomb/test/options/space-after-colon-scss.js
+++ /dev/null
@@ -1,10 +0,0 @@
-describe('options/space-after-colon (scss):', function() {
- beforeEach(function() {
- this.filename = __filename;
- });
-
- it('Space after colon should not affect pseudo elements', function() {
- this.comb.configure({ 'space-after-colon': 1 });
- this.shouldBeEqual('pseudo-elements.scss', 'pseudo-elements.expected.scss');
- });
-});
diff --git a/node_modules/csscomb/test/options/space-after-colon-scss/pseudo-elements.expected.scss b/node_modules/csscomb/test/options/space-after-colon-scss/pseudo-elements.expected.scss
deleted file mode 100644
index 46b16d2..0000000
--- a/node_modules/csscomb/test/options/space-after-colon-scss/pseudo-elements.expected.scss
+++ /dev/null
@@ -1,11 +0,0 @@
-li{
- float: left;
-
- a:hover{
- text-decoration: underline;
- }
-}
-
-li:before {
- color: tomato;
-}
diff --git a/node_modules/csscomb/test/options/space-after-colon-scss/pseudo-elements.scss b/node_modules/csscomb/test/options/space-after-colon-scss/pseudo-elements.scss
deleted file mode 100644
index dbb4ace..0000000
--- a/node_modules/csscomb/test/options/space-after-colon-scss/pseudo-elements.scss
+++ /dev/null
@@ -1,11 +0,0 @@
-li{
- float:left;
-
- a:hover{
- text-decoration:underline;
- }
-}
-
-li:before {
- color:tomato;
-}
diff --git a/node_modules/csscomb/test/options/space-after-colon.js b/node_modules/csscomb/test/options/space-after-colon.js
deleted file mode 100644
index a0abb4f..0000000
--- a/node_modules/csscomb/test/options/space-after-colon.js
+++ /dev/null
@@ -1,68 +0,0 @@
-describe('options/space-after-colon:', function() {
- beforeEach(function() {
- this.filename = __filename;
- });
-
- it('Array value => should not change anything', function() {
- this.comb.configure({ 'space-after-colon': ['', ' '] });
- this.shouldBeEqual('test.css');
- });
-
- it('Invalid string value => should not change anything', function() {
- this.comb.configure({ 'space-after-colon': ' nani ' });
- this.shouldBeEqual('test.css');
- });
-
- it('Float number value => should not change anything', function() {
- this.comb.configure({ 'space-after-colon': 3.5 });
- this.shouldBeEqual('test.css');
- });
-
- it('Integer value => should set proper space after colon', function() {
- this.comb.configure({ 'space-after-colon': 0 });
- this.shouldBeEqual('test.css', 'test.expected.css');
- });
-
- it('Valid string value (spaces only)=> should set proper space after colon', function() {
- this.comb.configure({ 'space-after-colon': ' ' });
- this.shouldBeEqual('test.css', 'test-2.expected.css');
- });
-
- it('Valid string value (spacesand newlines)=> should set proper space after colon', function() {
- this.comb.configure({ 'space-after-colon': '\n ' });
- this.shouldBeEqual('test.css', 'test-3.expected.css');
- });
-
- it('Should detect no whitespaces', function() {
- this.shouldDetect(
- ['space-after-colon'],
- 'a { color:red }',
- { 'space-after-colon': '' }
- );
- });
-
- it('Should detect space from two variants', function() {
- this.shouldDetect(
- ['space-after-colon'],
- 'a { color: red; color :red }',
- { 'space-after-colon': ' ' }
- );
- });
-
- it('Should detect no whitespaces along three variants', function() {
- this.shouldDetect(
- ['space-after-colon'],
- 'a { color: red; background :red } b { width:10px }',
- { 'space-after-colon': '' }
- );
- });
-
- it('Should detect space', function() {
- this.shouldDetect(
- ['space-after-colon'],
- 'a { color : red; background :red } b { width: 10px }',
- { 'space-after-colon': ' ' }
- );
- });
-});
-
diff --git a/node_modules/csscomb/test/options/space-after-colon/test-2.expected.css b/node_modules/csscomb/test/options/space-after-colon/test-2.expected.css
deleted file mode 100644
index c1355f3..0000000
--- a/node_modules/csscomb/test/options/space-after-colon/test-2.expected.css
+++ /dev/null
@@ -1,5 +0,0 @@
-a { color: red }
-a{color: red}
-a {color : red}
-a {color : /* foo */ red }
-a {color /* bar */ : red }
diff --git a/node_modules/csscomb/test/options/space-after-colon/test-3.expected.css b/node_modules/csscomb/test/options/space-after-colon/test-3.expected.css
deleted file mode 100644
index 63d57dc..0000000
--- a/node_modules/csscomb/test/options/space-after-colon/test-3.expected.css
+++ /dev/null
@@ -1,10 +0,0 @@
-a { color:
- red }
-a{color:
- red}
-a {color :
- red}
-a {color :
- /* foo */ red }
-a {color /* bar */ :
- red }
diff --git a/node_modules/csscomb/test/options/space-after-colon/test.css b/node_modules/csscomb/test/options/space-after-colon/test.css
deleted file mode 100644
index 637656f..0000000
--- a/node_modules/csscomb/test/options/space-after-colon/test.css
+++ /dev/null
@@ -1,5 +0,0 @@
-a { color: red }
-a{color:red}
-a {color : red}
-a {color : /* foo */ red }
-a {color /* bar */ : red }
diff --git a/node_modules/csscomb/test/options/space-after-colon/test.expected.css b/node_modules/csscomb/test/options/space-after-colon/test.expected.css
deleted file mode 100644
index 2d13781..0000000
--- a/node_modules/csscomb/test/options/space-after-colon/test.expected.css
+++ /dev/null
@@ -1,5 +0,0 @@
-a { color:red }
-a{color:red}
-a {color :red}
-a {color :/* foo */ red }
-a {color /* bar */ :red }
diff --git a/node_modules/csscomb/test/options/space-after-combinator.js b/node_modules/csscomb/test/options/space-after-combinator.js
deleted file mode 100644
index 8088bca..0000000
--- a/node_modules/csscomb/test/options/space-after-combinator.js
+++ /dev/null
@@ -1,84 +0,0 @@
-describe('options/space-after-combinator:', function() {
- beforeEach(function() {
- this.filename = __filename;
- });
-
- it('Array value => should not change anything', function() {
- this.comb.configure({ 'space-after-combinator': ['', ' '] });
- this.shouldBeEqual('test.css');
- });
-
- it('Invalid string value => should not change anything', function() {
- this.comb.configure({ 'space-after-combinator': ' nani ' });
- this.shouldBeEqual('test.css');
- });
-
- it('Float number value => should not change anything', function() {
- this.comb.configure({ 'space-after-combinator': 3.5 });
- this.shouldBeEqual('test.css');
- });
-
- it('Integer value => should set proper space after combinator', function() {
- this.comb.configure({ 'space-after-combinator': 0 });
- this.shouldBeEqual('test.css', 'test.expected.css');
- });
-
- it('Valid string value (spaces only) => should set proper space after combinator', function() {
- this.comb.configure({ 'space-after-combinator': ' ' });
- this.shouldBeEqual('test.css', 'test-2.expected.css');
- });
-
- it('Valid string value (spaces and newlines) => should set proper space after combinator', function() {
- this.comb.configure({ 'space-after-combinator': '\n ' });
- this.shouldBeEqual('test.css', 'test-3.expected.css');
- });
-
- it('Should detect no whitespaces after combinator', function() {
- this.shouldDetect(
- ['space-after-combinator'],
- 'a+b { color:red }',
- { 'space-after-combinator': '' }
- );
- });
-
- it('Should detect a space after combinator', function() {
- this.shouldDetect(
- ['space-after-combinator'],
- 'a + \n b { color:red }',
- { 'space-after-combinator': ' \n ' }
- );
- });
-
- it('Should detect a space after combinator in long selector', function() {
- this.shouldDetect(
- ['space-after-combinator'],
- 'a + b ~ c>d { color:red }',
- { 'space-after-combinator': ' ' }
- );
- });
-
- it('Should detect a space after combinator in long selector, test 2', function() {
- this.shouldDetect(
- ['space-after-combinator'],
- 'a>b + c + d { color:red }',
- { 'space-after-combinator': ' ' }
- );
- });
-
- it('Should detect no whitespaces after combinator in long selector', function() {
- this.shouldDetect(
- ['space-after-combinator'],
- 'a+b ~ c+d { color:red }',
- { 'space-after-combinator': '' }
- );
- });
-
- it('Shouldn’t detect whitespaces after combinator in selector without combinators', function() {
- this.shouldDetect(
- ['space-after-combinator'],
- 'a { color:red }',
- {}
- );
- });
-});
-
diff --git a/node_modules/csscomb/test/options/space-after-combinator/test-2.expected.css b/node_modules/csscomb/test/options/space-after-combinator/test-2.expected.css
deleted file mode 100644
index 32df439..0000000
--- a/node_modules/csscomb/test/options/space-after-combinator/test-2.expected.css
+++ /dev/null
@@ -1,10 +0,0 @@
-a> b { color: red }
-a> b { color: red }
-a > b { color: red }
-a+ b { color: red }
-a+ b { color: red }
-a + b { color: red }
-a~ b { color: red }
-a~ b { color: red }
-a ~ b { color: red }
-a ~ b+ c> d { color: red }
diff --git a/node_modules/csscomb/test/options/space-after-combinator/test-3.expected.css b/node_modules/csscomb/test/options/space-after-combinator/test-3.expected.css
deleted file mode 100644
index 9d34666..0000000
--- a/node_modules/csscomb/test/options/space-after-combinator/test-3.expected.css
+++ /dev/null
@@ -1,22 +0,0 @@
-a>
- b { color: red }
-a>
- b { color: red }
-a >
- b { color: red }
-a+
- b { color: red }
-a+
- b { color: red }
-a +
- b { color: red }
-a~
- b { color: red }
-a~
- b { color: red }
-a ~
- b { color: red }
-a ~
- b+
- c>
- d { color: red }
diff --git a/node_modules/csscomb/test/options/space-after-combinator/test.css b/node_modules/csscomb/test/options/space-after-combinator/test.css
deleted file mode 100644
index 4ad8d86..0000000
--- a/node_modules/csscomb/test/options/space-after-combinator/test.css
+++ /dev/null
@@ -1,10 +0,0 @@
-a>b { color: red }
-a> b { color: red }
-a >b { color: red }
-a+b { color: red }
-a+ b { color: red }
-a +b { color: red }
-a~b { color: red }
-a~ b { color: red }
-a ~b { color: red }
-a ~b+ c>d { color: red }
diff --git a/node_modules/csscomb/test/options/space-after-combinator/test.expected.css b/node_modules/csscomb/test/options/space-after-combinator/test.expected.css
deleted file mode 100644
index 186958d..0000000
--- a/node_modules/csscomb/test/options/space-after-combinator/test.expected.css
+++ /dev/null
@@ -1,10 +0,0 @@
-a>b { color: red }
-a>b { color: red }
-a >b { color: red }
-a+b { color: red }
-a+b { color: red }
-a +b { color: red }
-a~b { color: red }
-a~b { color: red }
-a ~b { color: red }
-a ~b+c>d { color: red }
diff --git a/node_modules/csscomb/test/options/space-after-opening-brace.js b/node_modules/csscomb/test/options/space-after-opening-brace.js
deleted file mode 100644
index 06176f3..0000000
--- a/node_modules/csscomb/test/options/space-after-opening-brace.js
+++ /dev/null
@@ -1,84 +0,0 @@
-describe('options/space-after-opening-brace:', function() {
- beforeEach(function() {
- this.filename = __filename;
- });
-
- it('Array value => should not change anything', function() {
- this.comb.configure({ 'space-after-opening-brace': ['', ' '] });
- this.shouldBeEqual('test.css');
- });
-
- it('Invalid string value => should not change anything', function() {
- this.comb.configure({ 'space-after-opening-brace': ' nani ' });
- this.shouldBeEqual('test.css');
- });
-
- it('Float number value => should not change anything', function() {
- this.comb.configure({ 'space-after-opening-brace': 3.5 });
- this.shouldBeEqual('test.css');
- });
-
- it('Integer value => should set proper space after {', function() {
- this.comb.configure({ 'space-after-opening-brace': 0 });
- this.shouldBeEqual('test.css', 'test.expected.css');
- });
-
- it('Valid string value (spaces only) => should set proper space after {', function() {
- this.comb.configure({ 'space-after-opening-brace': ' ' });
- this.shouldBeEqual('test.css', 'test-2.expected.css');
- });
-
- it('Valid string value (spaces and newlines) => should set proper space after {', function() {
- this.comb.configure({ 'space-after-opening-brace': '\n ' });
- this.shouldBeEqual('test.css', 'test-3.expected.css');
- });
-
- it('Should detect no whitespace', function() {
- this.shouldDetect(
- ['space-after-opening-brace'],
- 'a{top:0}',
- { 'space-after-opening-brace': '' }
- );
- });
-
- it('Should detect whitespace', function() {
- this.shouldDetect(
- ['space-after-opening-brace'],
- 'a{\n\ttop:0}',
- { 'space-after-opening-brace': '\n\t' }
- );
- });
-
- it('Should detect no whitespace (2 blocks)', function() {
- this.shouldDetect(
- ['space-after-opening-brace'],
- 'a{top:0} b{\n left:0}',
- { 'space-after-opening-brace': '' }
- );
- });
-
- it('Should detect whitespace (2 blocks)', function() {
- this.shouldDetect(
- ['space-after-opening-brace'],
- 'a{ top:0 } b{left:0}',
- { 'space-after-opening-brace': ' ' }
- );
- });
-
- it('Should detect no whitespace (3 blocks)', function() {
- this.shouldDetect(
- ['space-after-opening-brace'],
- 'a{top:0} b { left: 0 } c{\n\tright:0}',
- { 'space-after-opening-brace': '' }
- );
- });
-
- it('Should detect whitespace (3 blocks)', function() {
- this.shouldDetect(
- ['space-after-opening-brace'],
- 'a{\ntop:0} b{\nleft:0} c{\n right:0}',
- { 'space-after-opening-brace': '\n' }
- );
- });
-});
-
diff --git a/node_modules/csscomb/test/options/space-after-opening-brace/test-2.expected.css b/node_modules/csscomb/test/options/space-after-opening-brace/test-2.expected.css
deleted file mode 100644
index a34ef36..0000000
--- a/node_modules/csscomb/test/options/space-after-opening-brace/test-2.expected.css
+++ /dev/null
@@ -1,5 +0,0 @@
-a{ top: 0}
-a { top: 0 }
-
-@media print{ a{ top: 0}}
-@media print { a { top: 0 } }
diff --git a/node_modules/csscomb/test/options/space-after-opening-brace/test-3.expected.css b/node_modules/csscomb/test/options/space-after-opening-brace/test-3.expected.css
deleted file mode 100644
index 4c044b4..0000000
--- a/node_modules/csscomb/test/options/space-after-opening-brace/test-3.expected.css
+++ /dev/null
@@ -1,11 +0,0 @@
-a{
- top: 0}
-a {
- top: 0 }
-
-@media print{
- a{
- top: 0}}
-@media print {
- a {
- top: 0 } }
diff --git a/node_modules/csscomb/test/options/space-after-opening-brace/test.css b/node_modules/csscomb/test/options/space-after-opening-brace/test.css
deleted file mode 100644
index 7c71281..0000000
--- a/node_modules/csscomb/test/options/space-after-opening-brace/test.css
+++ /dev/null
@@ -1,5 +0,0 @@
-a{top: 0}
-a { top: 0 }
-
-@media print{a{top: 0}}
-@media print { a { top: 0 } }
diff --git a/node_modules/csscomb/test/options/space-after-opening-brace/test.expected.css b/node_modules/csscomb/test/options/space-after-opening-brace/test.expected.css
deleted file mode 100644
index fa761a5..0000000
--- a/node_modules/csscomb/test/options/space-after-opening-brace/test.expected.css
+++ /dev/null
@@ -1,5 +0,0 @@
-a{top: 0}
-a {top: 0 }
-
-@media print{a{top: 0}}
-@media print {a {top: 0 } }
diff --git a/node_modules/csscomb/test/options/space-after-selector-delimiter-sass.js b/node_modules/csscomb/test/options/space-after-selector-delimiter-sass.js
deleted file mode 100644
index 0c98282..0000000
--- a/node_modules/csscomb/test/options/space-after-selector-delimiter-sass.js
+++ /dev/null
@@ -1,10 +0,0 @@
-describe('options/space-after-selector-delimiter (sass):', function() {
- beforeEach(function() {
- this.filename = __filename;
- });
-
- it('Issue 238', function() {
- this.comb.configure({ 'space-after-selector-delimiter': '\n' });
- this.shouldBeEqual('issue-238.sass', 'issue-238.expected.sass');
- });
-});
diff --git a/node_modules/csscomb/test/options/space-after-selector-delimiter-sass/issue-238.expected.sass b/node_modules/csscomb/test/options/space-after-selector-delimiter-sass/issue-238.expected.sass
deleted file mode 100644
index 1857160..0000000
--- a/node_modules/csscomb/test/options/space-after-selector-delimiter-sass/issue-238.expected.sass
+++ /dev/null
@@ -1,5 +0,0 @@
-html,
-body,
-p
- background: #fff
- color: #000
diff --git a/node_modules/csscomb/test/options/space-after-selector-delimiter-sass/issue-238.sass b/node_modules/csscomb/test/options/space-after-selector-delimiter-sass/issue-238.sass
deleted file mode 100644
index 5fc2e13..0000000
--- a/node_modules/csscomb/test/options/space-after-selector-delimiter-sass/issue-238.sass
+++ /dev/null
@@ -1,4 +0,0 @@
-html,
-body, p
- background: #fff
- color: #000
diff --git a/node_modules/csscomb/test/options/space-after-selector-delimiter.js b/node_modules/csscomb/test/options/space-after-selector-delimiter.js
deleted file mode 100644
index 8d82ae1..0000000
--- a/node_modules/csscomb/test/options/space-after-selector-delimiter.js
+++ /dev/null
@@ -1,83 +0,0 @@
-describe('options/space-after-selector-delimiter:', function() {
- beforeEach(function() {
- this.filename = __filename;
- });
-
- it('Array value => should not change anything', function() {
- this.comb.configure({ 'space-after-selector-delimiter': ['', ' '] });
- this.shouldBeEqual('test.css');
- });
-
- it('Invalid string value => should not change anything', function() {
- this.comb.configure({ 'space-after-selector-delimiter': ' nani ' });
- this.shouldBeEqual('test.css');
- });
-
- it('Float number value => should not change anything', function() {
- this.comb.configure({ 'space-after-selector-delimiter': 3.5 });
- this.shouldBeEqual('test.css');
- });
-
- it('Integer value => should set proper space after selector delimiter', function() {
- this.comb.configure({ 'space-after-selector-delimiter': 0 });
- this.shouldBeEqual('test.css', 'test.expected.css');
- });
-
- it('Valid string value (spaces only) => should set proper space after selector delimiter', function() {
- this.comb.configure({ 'space-after-selector-delimiter': ' ' });
- this.shouldBeEqual('test.css', 'test-2.expected.css');
- });
-
- it('Valid string value (spaces and newlines) => should set proper space after selector delimiter', function() {
- this.comb.configure({ 'space-after-selector-delimiter': '\n ' });
- this.shouldBeEqual('test.css', 'test-3.expected.css');
- });
-
- it('Should detect no whitespace', function() {
- this.shouldDetect(
- ['space-after-selector-delimiter'],
- 'a,b{top:0}',
- { 'space-after-selector-delimiter': '' }
- );
- });
-
- it('Should detect whitespace', function() {
- this.shouldDetect(
- ['space-after-selector-delimiter'],
- 'a, \n b {top:0}',
- { 'space-after-selector-delimiter': ' \n ' }
- );
- });
-
- it('Should detect no whitespace (2 blocks)', function() {
- this.shouldDetect(
- ['space-after-selector-delimiter'],
- 'a,b{top:0} a, b{left:0}',
- { 'space-after-selector-delimiter': '' }
- );
- });
-
- it('Should detect whitespace (2 blocks)', function() {
- this.shouldDetect(
- ['space-after-selector-delimiter'],
- 'a, b {top:0} b,a{left:0}',
- { 'space-after-selector-delimiter': ' ' }
- );
- });
-
- it('Should detect no whitespace (3 blocks)', function() {
- this.shouldDetect(
- ['space-after-selector-delimiter'],
- 'a, b{top:0} b,c{left:0} c,d{right:0}',
- { 'space-after-selector-delimiter': '' }
- );
- });
-
- it('Should detect whitespace (3 blocks)', function() {
- this.shouldDetect(
- ['space-after-selector-delimiter'],
- 'a,b{top:0} b, c{left:0} c, sd{right:0}',
- { 'space-after-selector-delimiter': ' ' }
- );
- });
-});
diff --git a/node_modules/csscomb/test/options/space-after-selector-delimiter/test-2.expected.css b/node_modules/csscomb/test/options/space-after-selector-delimiter/test-2.expected.css
deleted file mode 100644
index 92d1ece..0000000
--- a/node_modules/csscomb/test/options/space-after-selector-delimiter/test-2.expected.css
+++ /dev/null
@@ -1,5 +0,0 @@
-a, b { color: red }
-a, b { color: red }
-a , b { color: red }
-a, b { color: red }
-a+b, c>d, e{ color: red }
\ No newline at end of file
diff --git a/node_modules/csscomb/test/options/space-after-selector-delimiter/test-3.expected.css b/node_modules/csscomb/test/options/space-after-selector-delimiter/test-3.expected.css
deleted file mode 100644
index 6a19848..0000000
--- a/node_modules/csscomb/test/options/space-after-selector-delimiter/test-3.expected.css
+++ /dev/null
@@ -1,11 +0,0 @@
-a,
- b { color: red }
-a,
- b { color: red }
-a ,
- b { color: red }
-a,
- b { color: red }
-a+b,
- c>d,
- e{ color: red }
\ No newline at end of file
diff --git a/node_modules/csscomb/test/options/space-after-selector-delimiter/test.css b/node_modules/csscomb/test/options/space-after-selector-delimiter/test.css
deleted file mode 100644
index cd8e7d7..0000000
--- a/node_modules/csscomb/test/options/space-after-selector-delimiter/test.css
+++ /dev/null
@@ -1,6 +0,0 @@
-a,b { color: red }
-a, b { color: red }
-a ,b { color: red }
-a,
-b { color: red }
-a+b,c>d,e{ color: red }
\ No newline at end of file
diff --git a/node_modules/csscomb/test/options/space-after-selector-delimiter/test.expected.css b/node_modules/csscomb/test/options/space-after-selector-delimiter/test.expected.css
deleted file mode 100644
index b0d4fd2..0000000
--- a/node_modules/csscomb/test/options/space-after-selector-delimiter/test.expected.css
+++ /dev/null
@@ -1,5 +0,0 @@
-a,b { color: red }
-a,b { color: red }
-a ,b { color: red }
-a,b { color: red }
-a+b,c>d,e{ color: red }
\ No newline at end of file
diff --git a/node_modules/csscomb/test/options/space-before-closing-brace.js b/node_modules/csscomb/test/options/space-before-closing-brace.js
deleted file mode 100644
index a9d9a6c..0000000
--- a/node_modules/csscomb/test/options/space-before-closing-brace.js
+++ /dev/null
@@ -1,76 +0,0 @@
-describe('options/space-before-closing-brace:', function() {
- beforeEach(function() {
- this.filename = __filename;
- });
-
- it('Array value => should not change anything', function() {
- this.comb.configure({ 'space-before-closing-brace': ['', ' '] });
- this.shouldBeEqual('test.css');
- });
-
- it('Invalid string value => should not change anything', function() {
- this.comb.configure({ 'space-before-closing-brace': ' nani ' });
- this.shouldBeEqual('test.css');
- });
-
- it('Float number value => should not change anything', function() {
- this.comb.configure({ 'space-before-closing-brace': 3.5 });
- this.shouldBeEqual('test.css');
- });
-
- it('Integer value => should set proper space before }', function() {
- this.comb.configure({ 'space-before-closing-brace': 0 });
- this.shouldBeEqual('test.css', 'test.expected.css');
- });
-
- it('Valid string value (spaces only) => should set proper space before }', function() {
- this.comb.configure({ 'space-before-closing-brace': ' ' });
- this.shouldBeEqual('test.css', 'test-2.expected.css');
- });
-
- it('Valid string value (spaces and newlines) => should set proper space before }', function() {
- this.comb.configure({ 'space-before-closing-brace': '\n ' });
- this.shouldBeEqual('test.css', 'test-3.expected.css');
- });
-
- it('Should detect no whitespace', function() {
- this.shouldDetect(
- ['space-before-closing-brace'],
- 'a{top:0}',
- { 'space-before-closing-brace': '' }
- );
- });
-
- it('Should detect no whitespace (2 blocks)', function() {
- this.shouldDetect(
- ['space-before-closing-brace'],
- 'a{top:0} b { color: tomato; }',
- { 'space-before-closing-brace': '' }
- );
- });
-
- it('Should detect whitespace', function() {
- this.shouldDetect(
- ['space-before-closing-brace'],
- 'a { top:0 }',
- { 'space-before-closing-brace': ' ' }
- );
- });
-
- it('Should detect whitespace (2 blocks)', function() {
- this.shouldDetect(
- ['space-before-closing-brace'],
- 'a { top:0 } b{color:tomato;}',
- { 'space-before-closing-brace': ' ' }
- );
- });
-
- it('Should detect whitespace (mix with block indent)', function() {
- this.shouldDetect(
- ['space-before-closing-brace', 'block-indent'],
- 'a {\n top:0\n }\nb{\n color:tomato;\n }',
- { 'block-indent': ' ', 'space-before-closing-brace': '\n ' }
- );
- });
-});
-
diff --git a/node_modules/csscomb/test/options/space-before-closing-brace/test-2.expected.css b/node_modules/csscomb/test/options/space-before-closing-brace/test-2.expected.css
deleted file mode 100644
index 86ba267..0000000
--- a/node_modules/csscomb/test/options/space-before-closing-brace/test-2.expected.css
+++ /dev/null
@@ -1,5 +0,0 @@
-a{top: 0 }
-a {top: 0 }
-
-@media print{a{top: 0 } }
-@media print { a { top: 0 } }
diff --git a/node_modules/csscomb/test/options/space-before-closing-brace/test-3.expected.css b/node_modules/csscomb/test/options/space-before-closing-brace/test-3.expected.css
deleted file mode 100644
index 9868eaa..0000000
--- a/node_modules/csscomb/test/options/space-before-closing-brace/test-3.expected.css
+++ /dev/null
@@ -1,11 +0,0 @@
-a{top: 0
- }
-a {top: 0
- }
-
-@media print{a{top: 0
- }
- }
-@media print { a { top: 0
- }
- }
diff --git a/node_modules/csscomb/test/options/space-before-closing-brace/test.css b/node_modules/csscomb/test/options/space-before-closing-brace/test.css
deleted file mode 100644
index 2c0a59c..0000000
--- a/node_modules/csscomb/test/options/space-before-closing-brace/test.css
+++ /dev/null
@@ -1,5 +0,0 @@
-a{top: 0}
-a {top: 0 }
-
-@media print{a{top: 0}}
-@media print { a { top: 0 } }
diff --git a/node_modules/csscomb/test/options/space-before-closing-brace/test.expected.css b/node_modules/csscomb/test/options/space-before-closing-brace/test.expected.css
deleted file mode 100644
index 9a2f633..0000000
--- a/node_modules/csscomb/test/options/space-before-closing-brace/test.expected.css
+++ /dev/null
@@ -1,5 +0,0 @@
-a{top: 0}
-a {top: 0}
-
-@media print{a{top: 0}}
-@media print { a { top: 0}}
diff --git a/node_modules/csscomb/test/options/space-before-colon-sass.js b/node_modules/csscomb/test/options/space-before-colon-sass.js
deleted file mode 100644
index ede13e3..0000000
--- a/node_modules/csscomb/test/options/space-before-colon-sass.js
+++ /dev/null
@@ -1,16 +0,0 @@
-describe('options/space-before-colon-sass:', function() {
- beforeEach(function() {
- this.filename = __filename;
- });
-
- it('Should correct space', function() {
- this.comb.configure({ 'space-before-colon': 1 });
- this.shouldBeEqual('test.sass', 'test.expected.sass');
- });
-
- it('Should not correct space', function() {
- this.comb.configure({ 'space-before-colon': 1 });
- this.shouldBeEqual('test2.sass');
- });
-});
-
diff --git a/node_modules/csscomb/test/options/space-before-colon-sass/test.expected.sass b/node_modules/csscomb/test/options/space-before-colon-sass/test.expected.sass
deleted file mode 100644
index a61746f..0000000
--- a/node_modules/csscomb/test/options/space-before-colon-sass/test.expected.sass
+++ /dev/null
@@ -1,3 +0,0 @@
-a
- color : tomato
- top : 0
diff --git a/node_modules/csscomb/test/options/space-before-colon-sass/test.sass b/node_modules/csscomb/test/options/space-before-colon-sass/test.sass
deleted file mode 100644
index f38512b..0000000
--- a/node_modules/csscomb/test/options/space-before-colon-sass/test.sass
+++ /dev/null
@@ -1,3 +0,0 @@
-a
- color: tomato
- top: 0
diff --git a/node_modules/csscomb/test/options/space-before-colon-sass/test2.sass b/node_modules/csscomb/test/options/space-before-colon-sass/test2.sass
deleted file mode 100644
index 3a5df0b..0000000
--- a/node_modules/csscomb/test/options/space-before-colon-sass/test2.sass
+++ /dev/null
@@ -1,3 +0,0 @@
-a
- :color tomato
- :top 0
diff --git a/node_modules/csscomb/test/options/space-before-colon.js b/node_modules/csscomb/test/options/space-before-colon.js
deleted file mode 100644
index 1b9d7f8..0000000
--- a/node_modules/csscomb/test/options/space-before-colon.js
+++ /dev/null
@@ -1,68 +0,0 @@
-describe('options/space-before-colon:', function() {
- beforeEach(function() {
- this.filename = __filename;
- });
-
- it('Array value => should not change anything', function() {
- this.comb.configure({ 'space-before-colon': ['', ' '] });
- this.shouldBeEqual('test.css');
- });
-
- it('Invalid string value => should not change anything', function() {
- this.comb.configure({ 'space-before-colon': ' nani ' });
- this.shouldBeEqual('test.css');
- });
-
- it('Float number value => should not change anything', function() {
- this.comb.configure({ 'space-before-colon': 3.5 });
- this.shouldBeEqual('test.css');
- });
-
- it('Integer value => should set proper space before colon', function() {
- this.comb.configure({ 'space-before-colon': 0 });
- this.shouldBeEqual('test.css', 'test.expected.css');
- });
-
- it('Valid string value (spaces only) => should set proper space before colon', function() {
- this.comb.configure({ 'space-before-colon': ' ' });
- this.shouldBeEqual('test.css', 'test-2.expected.css');
- });
-
- it('Valid string value (spaces and newlines) => should set proper space before colon', function() {
- this.comb.configure({ 'space-before-colon': '\n ' });
- this.shouldBeEqual('test.css', 'test-3.expected.css');
- });
-
- it('Should detect no whitespaces', function() {
- this.shouldDetect(
- ['space-before-colon'],
- 'a { color:red }',
- { 'space-before-colon': '' }
- );
- });
-
- it('Should detect no space from two variants', function() {
- this.shouldDetect(
- ['space-before-colon'],
- 'a { color: red; color :red }',
- { 'space-before-colon': '' }
- );
- });
-
- it('Should detect no whitespaces along three variants', function() {
- this.shouldDetect(
- ['space-before-colon'],
- 'a { color: red; background :red } b { width:10px }',
- { 'space-before-colon': '' }
- );
- });
-
- it('Should detect space', function() {
- this.shouldDetect(
- ['space-before-colon'],
- 'a { color : red; background :red } b { width:10px }',
- { 'space-before-colon': ' ' }
- );
- });
-});
-
diff --git a/node_modules/csscomb/test/options/space-before-colon/test-2.expected.css b/node_modules/csscomb/test/options/space-before-colon/test-2.expected.css
deleted file mode 100644
index 8491cff..0000000
--- a/node_modules/csscomb/test/options/space-before-colon/test-2.expected.css
+++ /dev/null
@@ -1,5 +0,0 @@
-a { color : red }
-a{color :red}
-a {color : red}
-a {color : /* foo */ red }
-a {color /* bar */ : red }
diff --git a/node_modules/csscomb/test/options/space-before-colon/test-3.expected.css b/node_modules/csscomb/test/options/space-before-colon/test-3.expected.css
deleted file mode 100644
index 2d951a7..0000000
--- a/node_modules/csscomb/test/options/space-before-colon/test-3.expected.css
+++ /dev/null
@@ -1,10 +0,0 @@
-a { color
- : red }
-a{color
- :red}
-a {color
- : red}
-a {color
- : /* foo */ red }
-a {color /* bar */
- : red }
diff --git a/node_modules/csscomb/test/options/space-before-colon/test.css b/node_modules/csscomb/test/options/space-before-colon/test.css
deleted file mode 100644
index 637656f..0000000
--- a/node_modules/csscomb/test/options/space-before-colon/test.css
+++ /dev/null
@@ -1,5 +0,0 @@
-a { color: red }
-a{color:red}
-a {color : red}
-a {color : /* foo */ red }
-a {color /* bar */ : red }
diff --git a/node_modules/csscomb/test/options/space-before-colon/test.expected.css b/node_modules/csscomb/test/options/space-before-colon/test.expected.css
deleted file mode 100644
index 9ffc1c4..0000000
--- a/node_modules/csscomb/test/options/space-before-colon/test.expected.css
+++ /dev/null
@@ -1,5 +0,0 @@
-a { color: red }
-a{color:red}
-a {color: red}
-a {color: /* foo */ red }
-a {color /* bar */: red }
diff --git a/node_modules/csscomb/test/options/space-before-combinator.js b/node_modules/csscomb/test/options/space-before-combinator.js
deleted file mode 100644
index a9eccf0..0000000
--- a/node_modules/csscomb/test/options/space-before-combinator.js
+++ /dev/null
@@ -1,84 +0,0 @@
-describe('options/space-before-combinator:', function() {
- beforeEach(function() {
- this.filename = __filename;
- });
-
- it('Array value => should not change anything', function() {
- this.comb.configure({ 'space-before-combinator': ['', ' '] });
- this.shouldBeEqual('test.css');
- });
-
- it('Invalid string value => should not change anything', function() {
- this.comb.configure({ 'space-before-combinator': ' nani ' });
- this.shouldBeEqual('test.css');
- });
-
- it('Float number value => should not change anything', function() {
- this.comb.configure({ 'space-before-combinator': 3.5 });
- this.shouldBeEqual('test.css');
- });
-
- it('Integer value => should set proper space before combinator', function() {
- this.comb.configure({ 'space-before-combinator': 0 });
- this.shouldBeEqual('test.css', 'test.expected.css');
- });
-
- it('Valid string value (spaces only) => should set proper space before combinator', function() {
- this.comb.configure({ 'space-before-combinator': ' ' });
- this.shouldBeEqual('test.css', 'test-2.expected.css');
- });
-
- it('Valid string value (spaces and newlines) => should set proper space before combinator', function() {
- this.comb.configure({ 'space-before-combinator': '\n ' });
- this.shouldBeEqual('test.css', 'test-3.expected.css');
- });
-
- it('Should detect no whitespaces before combinator', function() {
- this.shouldDetect(
- ['space-before-combinator'],
- 'a+b { color:red }',
- { 'space-before-combinator': '' }
- );
- });
-
- it('Should detect a space before combinator', function() {
- this.shouldDetect(
- ['space-before-combinator'],
- 'a + b { color:red }',
- { 'space-before-combinator': ' ' }
- );
- });
-
- it('Should detect a space before combinator in long selector', function() {
- this.shouldDetect(
- ['space-before-combinator'],
- 'a + b ~ c>d { color:red }',
- { 'space-before-combinator': ' ' }
- );
- });
-
- it('Should detect a space before combinator in long selector, test 2', function() {
- this.shouldDetect(
- ['space-before-combinator'],
- 'a>b + c + d { color:red }',
- { 'space-before-combinator': ' ' }
- );
- });
-
- it('Should detect no whitespaces before combinator in long selector', function() {
- this.shouldDetect(
- ['space-before-combinator'],
- 'a+b ~ c+d { color:red }',
- { 'space-before-combinator': '' }
- );
- });
-
- it('Shouldn’t detect whitespaces before combinator in selector without combinators', function() {
- this.shouldDetect(
- ['space-before-combinator'],
- 'a { color:red }',
- {}
- );
- });
-});
-
diff --git a/node_modules/csscomb/test/options/space-before-combinator/test-2.expected.css b/node_modules/csscomb/test/options/space-before-combinator/test-2.expected.css
deleted file mode 100644
index d1320b1..0000000
--- a/node_modules/csscomb/test/options/space-before-combinator/test-2.expected.css
+++ /dev/null
@@ -1,10 +0,0 @@
-a >b { color: red }
-a > b { color: red }
-a >b { color: red }
-a +b { color: red }
-a + b { color: red }
-a +b { color: red }
-a ~b { color: red }
-a ~ b { color: red }
-a ~b { color: red }
-a ~b + c >d { color: red }
diff --git a/node_modules/csscomb/test/options/space-before-combinator/test-3.expected.css b/node_modules/csscomb/test/options/space-before-combinator/test-3.expected.css
deleted file mode 100644
index 2a7f317..0000000
--- a/node_modules/csscomb/test/options/space-before-combinator/test-3.expected.css
+++ /dev/null
@@ -1,22 +0,0 @@
-a
- >b { color: red }
-a
- > b { color: red }
-a
- >b { color: red }
-a
- +b { color: red }
-a
- + b { color: red }
-a
- +b { color: red }
-a
- ~b { color: red }
-a
- ~ b { color: red }
-a
- ~b { color: red }
-a
- ~b
- + c
- >d { color: red }
diff --git a/node_modules/csscomb/test/options/space-before-combinator/test.css b/node_modules/csscomb/test/options/space-before-combinator/test.css
deleted file mode 100644
index 4ad8d86..0000000
--- a/node_modules/csscomb/test/options/space-before-combinator/test.css
+++ /dev/null
@@ -1,10 +0,0 @@
-a>b { color: red }
-a> b { color: red }
-a >b { color: red }
-a+b { color: red }
-a+ b { color: red }
-a +b { color: red }
-a~b { color: red }
-a~ b { color: red }
-a ~b { color: red }
-a ~b+ c>d { color: red }
diff --git a/node_modules/csscomb/test/options/space-before-combinator/test.expected.css b/node_modules/csscomb/test/options/space-before-combinator/test.expected.css
deleted file mode 100644
index 920bd51..0000000
--- a/node_modules/csscomb/test/options/space-before-combinator/test.expected.css
+++ /dev/null
@@ -1,10 +0,0 @@
-a>b { color: red }
-a> b { color: red }
-a>b { color: red }
-a+b { color: red }
-a+ b { color: red }
-a+b { color: red }
-a~b { color: red }
-a~ b { color: red }
-a~b { color: red }
-a~b+ c>d { color: red }
diff --git a/node_modules/csscomb/test/options/space-before-opening-brace-scss.js b/node_modules/csscomb/test/options/space-before-opening-brace-scss.js
deleted file mode 100644
index 3e40c5f..0000000
--- a/node_modules/csscomb/test/options/space-before-opening-brace-scss.js
+++ /dev/null
@@ -1,10 +0,0 @@
-describe('options/space-before-opening-brace (scss):', function() {
- beforeEach(function() {
- this.filename = __filename;
- });
-
- it('Issue 231', function() {
- this.comb.configure({ 'space-before-opening-brace': 1 });
- this.shouldBeEqual('issue-231.scss', 'issue-231.expected.scss');
- });
-});
diff --git a/node_modules/csscomb/test/options/space-before-opening-brace-scss/issue-231.expected.scss b/node_modules/csscomb/test/options/space-before-opening-brace-scss/issue-231.expected.scss
deleted file mode 100644
index 917eb73..0000000
--- a/node_modules/csscomb/test/options/space-before-opening-brace-scss/issue-231.expected.scss
+++ /dev/null
@@ -1,8 +0,0 @@
-li {
- float: left;
- @include respond-to(mobile) {
- float: none;
- width: $width;
- $width: 100%;
- }
-}
diff --git a/node_modules/csscomb/test/options/space-before-opening-brace-scss/issue-231.scss b/node_modules/csscomb/test/options/space-before-opening-brace-scss/issue-231.scss
deleted file mode 100644
index f0abf87..0000000
--- a/node_modules/csscomb/test/options/space-before-opening-brace-scss/issue-231.scss
+++ /dev/null
@@ -1,8 +0,0 @@
-li{
- float: left;
- @include respond-to(mobile){
- float: none;
- width: $width;
- $width: 100%;
- }
-}
diff --git a/node_modules/csscomb/test/options/space-before-opening-brace.js b/node_modules/csscomb/test/options/space-before-opening-brace.js
deleted file mode 100644
index f5eb60d..0000000
--- a/node_modules/csscomb/test/options/space-before-opening-brace.js
+++ /dev/null
@@ -1,89 +0,0 @@
-describe('options/space-before-opening-brace:', function() {
- beforeEach(function() {
- this.filename = __filename;
- });
-
- it('Array value => should not change anything', function() {
- this.comb.configure({ 'space-before-opening-brace': ['', ' '] });
- this.shouldBeEqual('test.css');
- });
-
- it('Invalid string value => should not change anything', function() {
- this.comb.configure({ 'space-before-opening-brace': ' nani ' });
- this.shouldBeEqual('test.css');
- });
-
- it('Float number value => should not change anything', function() {
- this.comb.configure({ 'space-before-opening-brace': 3.5 });
- this.shouldBeEqual('test.css');
- });
-
- it('Integer value => should set proper space before {', function() {
- this.comb.configure({ 'space-before-opening-brace': 0 });
- this.shouldBeEqual('test.css', 'test.expected.css');
- });
-
- it('Valid string value (spaces only) => should set proper space before {', function() {
- this.comb.configure({ 'space-before-opening-brace': ' ' });
- this.shouldBeEqual('test.css', 'test-2.expected.css');
- });
-
- it('Valid string value (spaces and newlines) => should set proper space before {', function() {
- this.comb.configure({ 'space-before-opening-brace': '\n ' });
- this.shouldBeEqual('test.css', 'test-3.expected.css');
- });
-
- it('Issue 232', function() {
- this.comb.configure({ 'space-before-opening-brace': 1 });
- this.shouldBeEqual('issue-232.css', 'issue-232.expected.css');
- });
-
- it('Should detect no whitespace', function() {
- this.shouldDetect(
- ['space-before-opening-brace'],
- 'a{top:0}',
- { 'space-before-opening-brace': '' }
- );
- });
-
- it('Should detect whitespace', function() {
- this.shouldDetect(
- ['space-before-opening-brace'],
- 'a \n {top:0}',
- { 'space-before-opening-brace': ' \n ' }
- );
- });
-
- it('Should detect no whitespace (2 blocks)', function() {
- this.shouldDetect(
- ['space-before-opening-brace'],
- 'a{top:0} b {left:0}',
- { 'space-before-opening-brace': '' }
- );
- });
-
- it('Should detect whitespace (2 blocks)', function() {
- this.shouldDetect(
- ['space-before-opening-brace'],
- 'a {top:0} b{left:0}',
- { 'space-before-opening-brace': ' ' }
- );
- });
-
- it('Should detect no whitespace (3 blocks)', function() {
- this.shouldDetect(
- ['space-before-opening-brace'],
- 'a {top:0} b{left:0} c{right:0}',
- { 'space-before-opening-brace': '' }
- );
- });
-
- it('Should detect whitespace (3 blocks)', function() {
- this.shouldDetect(
- ['space-before-opening-brace'],
- 'a{top:0} b {left:0} c {right:0}',
- { 'space-before-opening-brace': ' ' }
- );
- });
-});
-
diff --git a/node_modules/csscomb/test/options/space-before-opening-brace/issue-232.css b/node_modules/csscomb/test/options/space-before-opening-brace/issue-232.css
deleted file mode 100644
index bc99e74..0000000
--- a/node_modules/csscomb/test/options/space-before-opening-brace/issue-232.css
+++ /dev/null
@@ -1,13 +0,0 @@
-@font-face
-{
- font-family: Panda;
- src: url(panda.ttf);
-}
-
-@media screen and (max-width: 400px)
-{
- @-ms-viewport
- {
- width: 320px;
- }
-}
diff --git a/node_modules/csscomb/test/options/space-before-opening-brace/issue-232.expected.css b/node_modules/csscomb/test/options/space-before-opening-brace/issue-232.expected.css
deleted file mode 100644
index 04d76f3..0000000
--- a/node_modules/csscomb/test/options/space-before-opening-brace/issue-232.expected.css
+++ /dev/null
@@ -1,10 +0,0 @@
-@font-face {
- font-family: Panda;
- src: url(panda.ttf);
-}
-
-@media screen and (max-width: 400px) {
- @-ms-viewport {
- width: 320px;
- }
-}
diff --git a/node_modules/csscomb/test/options/space-before-opening-brace/test-2.expected.css b/node_modules/csscomb/test/options/space-before-opening-brace/test-2.expected.css
deleted file mode 100644
index 68a688a..0000000
--- a/node_modules/csscomb/test/options/space-before-opening-brace/test-2.expected.css
+++ /dev/null
@@ -1,5 +0,0 @@
-a {top: 0}
-a {top: 0}
-
-@media print {a {top: 0}}
-@media print { a { top: 0 } }
diff --git a/node_modules/csscomb/test/options/space-before-opening-brace/test-3.expected.css b/node_modules/csscomb/test/options/space-before-opening-brace/test-3.expected.css
deleted file mode 100644
index 8efc4e9..0000000
--- a/node_modules/csscomb/test/options/space-before-opening-brace/test-3.expected.css
+++ /dev/null
@@ -1,11 +0,0 @@
-a
- {top: 0}
-a
- {top: 0}
-
-@media print
- {a
- {top: 0}}
-@media print
- { a
- { top: 0 } }
diff --git a/node_modules/csscomb/test/options/space-before-opening-brace/test.css b/node_modules/csscomb/test/options/space-before-opening-brace/test.css
deleted file mode 100644
index 0f8fadc..0000000
--- a/node_modules/csscomb/test/options/space-before-opening-brace/test.css
+++ /dev/null
@@ -1,5 +0,0 @@
-a{top: 0}
-a {top: 0}
-
-@media print{a{top: 0}}
-@media print { a { top: 0 } }
diff --git a/node_modules/csscomb/test/options/space-before-opening-brace/test.expected.css b/node_modules/csscomb/test/options/space-before-opening-brace/test.expected.css
deleted file mode 100644
index 32014dd..0000000
--- a/node_modules/csscomb/test/options/space-before-opening-brace/test.expected.css
+++ /dev/null
@@ -1,5 +0,0 @@
-a{top: 0}
-a{top: 0}
-
-@media print{a{top: 0}}
-@media print{ a{ top: 0 } }
diff --git a/node_modules/csscomb/test/options/space-before-selector-delimiter.js b/node_modules/csscomb/test/options/space-before-selector-delimiter.js
deleted file mode 100644
index 3770c75..0000000
--- a/node_modules/csscomb/test/options/space-before-selector-delimiter.js
+++ /dev/null
@@ -1,83 +0,0 @@
-describe('options/space-before-selector-delimiter:', function() {
- beforeEach(function() {
- this.filename = __filename;
- });
-
- it('Array value => should not change anything', function() {
- this.comb.configure({ 'space-before-selector-delimiter': ['', ' '] });
- this.shouldBeEqual('test.css');
- });
-
- it('Invalid string value => should not change anything', function() {
- this.comb.configure({ 'space-before-selector-delimiter': ' nani ' });
- this.shouldBeEqual('test.css');
- });
-
- it('Float number value => should not change anything', function() {
- this.comb.configure({ 'space-before-selector-delimiter': 3.5 });
- this.shouldBeEqual('test.css');
- });
-
- it('Integer value => should set proper space before selector delimiter', function() {
- this.comb.configure({ 'space-before-selector-delimiter': 0 });
- this.shouldBeEqual('test.css', 'test.expected.css');
- });
-
- it('Valid string value (spaces only) => should set proper space before selector delimiter', function() {
- this.comb.configure({ 'space-before-selector-delimiter': ' ' });
- this.shouldBeEqual('test.css', 'test-2.expected.css');
- });
-
- it('Valid string value (spaces and newlines) => should set proper space before selector delimiter', function() {
- this.comb.configure({ 'space-before-selector-delimiter': '\n ' });
- this.shouldBeEqual('test.css', 'test-3.expected.css');
- });
-
- it('Should detect no whitespace', function() {
- this.shouldDetect(
- ['space-before-selector-delimiter'],
- 'a,b{top:0}',
- { 'space-before-selector-delimiter': '' }
- );
- });
-
- it('Should detect whitespace', function() {
- this.shouldDetect(
- ['space-before-selector-delimiter'],
- 'a \n ,b {top:0}',
- { 'space-before-selector-delimiter': ' \n ' }
- );
- });
-
- it('Should detect no whitespace (2 blocks)', function() {
- this.shouldDetect(
- ['space-before-selector-delimiter'],
- 'a,b{top:0} a ,b{left:0}',
- { 'space-before-selector-delimiter': '' }
- );
- });
-
- it('Should detect whitespace (2 blocks)', function() {
- this.shouldDetect(
- ['space-before-selector-delimiter'],
- 'a ,b {top:0} b,a{left:0}',
- { 'space-before-selector-delimiter': ' ' }
- );
- });
-
- it('Should detect no whitespace (3 blocks)', function() {
- this.shouldDetect(
- ['space-before-selector-delimiter'],
- 'a ,b{top:0} b,c{left:0} c,d{right:0}',
- { 'space-before-selector-delimiter': '' }
- );
- });
-
- it('Should detect whitespace (3 blocks)', function() {
- this.shouldDetect(
- ['space-before-selector-delimiter'],
- 'a,b{top:0} b ,c{left:0} c ,d{right:0}',
- { 'space-before-selector-delimiter': ' ' }
- );
- });
-});
diff --git a/node_modules/csscomb/test/options/space-before-selector-delimiter/test-2.expected.css b/node_modules/csscomb/test/options/space-before-selector-delimiter/test-2.expected.css
deleted file mode 100644
index 90b232e..0000000
--- a/node_modules/csscomb/test/options/space-before-selector-delimiter/test-2.expected.css
+++ /dev/null
@@ -1,6 +0,0 @@
-a ,b { color: red }
-a , b { color: red }
-a ,b { color: red }
-a ,
-b { color: red }
-a+b ,c>d ,e{ color: red }
\ No newline at end of file
diff --git a/node_modules/csscomb/test/options/space-before-selector-delimiter/test-3.expected.css b/node_modules/csscomb/test/options/space-before-selector-delimiter/test-3.expected.css
deleted file mode 100644
index 1b454c8..0000000
--- a/node_modules/csscomb/test/options/space-before-selector-delimiter/test-3.expected.css
+++ /dev/null
@@ -1,12 +0,0 @@
-a
- ,b { color: red }
-a
- , b { color: red }
-a
- ,b { color: red }
-a
- ,
-b { color: red }
-a+b
- ,c>d
- ,e{ color: red }
\ No newline at end of file
diff --git a/node_modules/csscomb/test/options/space-before-selector-delimiter/test.css b/node_modules/csscomb/test/options/space-before-selector-delimiter/test.css
deleted file mode 100644
index cd8e7d7..0000000
--- a/node_modules/csscomb/test/options/space-before-selector-delimiter/test.css
+++ /dev/null
@@ -1,6 +0,0 @@
-a,b { color: red }
-a, b { color: red }
-a ,b { color: red }
-a,
-b { color: red }
-a+b,c>d,e{ color: red }
\ No newline at end of file
diff --git a/node_modules/csscomb/test/options/space-before-selector-delimiter/test.expected.css b/node_modules/csscomb/test/options/space-before-selector-delimiter/test.expected.css
deleted file mode 100644
index 3c566c5..0000000
--- a/node_modules/csscomb/test/options/space-before-selector-delimiter/test.expected.css
+++ /dev/null
@@ -1,6 +0,0 @@
-a,b { color: red }
-a, b { color: red }
-a,b { color: red }
-a,
-b { color: red }
-a+b,c>d,e{ color: red }
\ No newline at end of file
diff --git a/node_modules/csscomb/test/options/space-between-declarations.js b/node_modules/csscomb/test/options/space-between-declarations.js
deleted file mode 100644
index 9f02e54..0000000
--- a/node_modules/csscomb/test/options/space-between-declarations.js
+++ /dev/null
@@ -1,45 +0,0 @@
-describe('options/space-between-declarations:', function() {
- beforeEach(function() {
- this.filename = __filename;
- });
-
- it('Array value => should not change anything', function() {
- this.comb.configure({ 'space-between-declarations': ['', ' '] });
- this.shouldBeEqual('test.css');
- });
-
- it('Invalid string value => should not change anything', function() {
- this.comb.configure({ 'space-between-declarations': ' nani ' });
- this.shouldBeEqual('test.css');
- });
-
- it('Float number value => should not change anything', function() {
- this.comb.configure({ 'space-between-declarations': 3.5 });
- this.shouldBeEqual('test.css');
- });
-
- it('Integer value => should set proper space after declaration', function() {
- this.comb.configure({ 'space-between-declarations': 0 });
- this.shouldBeEqual('integer-value.css', 'integer-value.expected.css');
- });
-
- it('Valid string value (spaces only) => should set proper space after declaration', function() {
- this.comb.configure({ 'space-between-declarations': ' ' });
- this.shouldBeEqual('space-value.css', 'space-value.expected.css');
- });
-
- it('Valid string value (spaces and newlines) => should set proper space after declaration', function() {
- this.comb.configure({ 'space-between-declarations': '\n ' });
- this.shouldBeEqual('space-newline-value.css', 'space-newline-value.expected.css');
- });
-
- it('Should leave comments as is', function() {
- this.comb.configure({ 'space-between-declarations': 1 });
- this.shouldBeEqual('comments.css', 'comments.expected.css');
- });
-
- it('Issue 239', function() {
- this.comb.configure({ 'space-between-declarations': '\n ' });
- this.shouldBeEqual('issue-239.css', 'issue-239.expected.css');
- });
-});
diff --git a/node_modules/csscomb/test/options/space-between-declarations/comments.css b/node_modules/csscomb/test/options/space-between-declarations/comments.css
deleted file mode 100644
index 0d8b931..0000000
--- a/node_modules/csscomb/test/options/space-between-declarations/comments.css
+++ /dev/null
@@ -1,8 +0,0 @@
-a {
- color: tomato;
- /* comment */
- top: 0; /* comment */
- left: 10px;
- right: 0;
- /* comment */
- }
diff --git a/node_modules/csscomb/test/options/space-between-declarations/comments.expected.css b/node_modules/csscomb/test/options/space-between-declarations/comments.expected.css
deleted file mode 100644
index 5903c20..0000000
--- a/node_modules/csscomb/test/options/space-between-declarations/comments.expected.css
+++ /dev/null
@@ -1,6 +0,0 @@
-a {
- color: tomato;
- /* comment */
- top: 0; /* comment */ left: 10px; right: 0;
- /* comment */
- }
diff --git a/node_modules/csscomb/test/options/space-between-declarations/integer-value.css b/node_modules/csscomb/test/options/space-between-declarations/integer-value.css
deleted file mode 100644
index de2c649..0000000
--- a/node_modules/csscomb/test/options/space-between-declarations/integer-value.css
+++ /dev/null
@@ -1,6 +0,0 @@
-a {
- color: tomato;
-
- top: 0;
- left: 10px
- }
diff --git a/node_modules/csscomb/test/options/space-between-declarations/integer-value.expected.css b/node_modules/csscomb/test/options/space-between-declarations/integer-value.expected.css
deleted file mode 100644
index 5d12017..0000000
--- a/node_modules/csscomb/test/options/space-between-declarations/integer-value.expected.css
+++ /dev/null
@@ -1,3 +0,0 @@
-a {
- color: tomato;top: 0;left: 10px
- }
diff --git a/node_modules/csscomb/test/options/space-between-declarations/issue-239.css b/node_modules/csscomb/test/options/space-between-declarations/issue-239.css
deleted file mode 100644
index ccf6ba7..0000000
--- a/node_modules/csscomb/test/options/space-between-declarations/issue-239.css
+++ /dev/null
@@ -1,2 +0,0 @@
-html{
- color:#444;font-family:proxima-nova;font-size:62.5%;font-weight:300;line-height:1.5;}
diff --git a/node_modules/csscomb/test/options/space-between-declarations/issue-239.expected.css b/node_modules/csscomb/test/options/space-between-declarations/issue-239.expected.css
deleted file mode 100644
index ab145f7..0000000
--- a/node_modules/csscomb/test/options/space-between-declarations/issue-239.expected.css
+++ /dev/null
@@ -1,6 +0,0 @@
-html{
- color:#444;
- font-family:proxima-nova;
- font-size:62.5%;
- font-weight:300;
- line-height:1.5;}
diff --git a/node_modules/csscomb/test/options/space-between-declarations/space-newline-value.css b/node_modules/csscomb/test/options/space-between-declarations/space-newline-value.css
deleted file mode 100644
index ff86611..0000000
--- a/node_modules/csscomb/test/options/space-between-declarations/space-newline-value.css
+++ /dev/null
@@ -1,4 +0,0 @@
-a {
- color: tomato;top: 0; left: 10px;
- right: 0; width: 100% \9;
-}
diff --git a/node_modules/csscomb/test/options/space-between-declarations/space-newline-value.expected.css b/node_modules/csscomb/test/options/space-between-declarations/space-newline-value.expected.css
deleted file mode 100644
index 17c237a..0000000
--- a/node_modules/csscomb/test/options/space-between-declarations/space-newline-value.expected.css
+++ /dev/null
@@ -1,7 +0,0 @@
-a {
- color: tomato;
- top: 0;
- left: 10px;
- right: 0;
- width: 100% \9;
-}
diff --git a/node_modules/csscomb/test/options/space-between-declarations/space-value.css b/node_modules/csscomb/test/options/space-between-declarations/space-value.css
deleted file mode 100644
index de2c649..0000000
--- a/node_modules/csscomb/test/options/space-between-declarations/space-value.css
+++ /dev/null
@@ -1,6 +0,0 @@
-a {
- color: tomato;
-
- top: 0;
- left: 10px
- }
diff --git a/node_modules/csscomb/test/options/space-between-declarations/space-value.expected.css b/node_modules/csscomb/test/options/space-between-declarations/space-value.expected.css
deleted file mode 100644
index 6795d9c..0000000
--- a/node_modules/csscomb/test/options/space-between-declarations/space-value.expected.css
+++ /dev/null
@@ -1,3 +0,0 @@
-a {
- color: tomato; top: 0; left: 10px
- }
diff --git a/node_modules/csscomb/test/options/space-between-declarations/test.css b/node_modules/csscomb/test/options/space-between-declarations/test.css
deleted file mode 100644
index 7a75e51..0000000
--- a/node_modules/csscomb/test/options/space-between-declarations/test.css
+++ /dev/null
@@ -1,2 +0,0 @@
-a {
- animal: panda;color: tomato; top: 0; }
diff --git a/node_modules/csscomb/test/options/strip-spaces.js b/node_modules/csscomb/test/options/strip-spaces.js
deleted file mode 100644
index b8f19b3..0000000
--- a/node_modules/csscomb/test/options/strip-spaces.js
+++ /dev/null
@@ -1,113 +0,0 @@
-var assert = require('assert');
-
-describe('options/strip-spaces', function() {
- it('Invalid value should not trim trailing spaces', function() {
- this.comb.configure({ 'strip-spaces': 'foobar' });
- assert.equal(
- this.comb.processString('a { color: red } \n'),
- 'a { color: red } \n'
- );
- });
- it('Boolean true value should trim all trailing spaces', function() {
- this.comb.configure({ 'strip-spaces': true });
- assert.equal(
- this.comb.processString(
- 'a { color: red } \n' +
- 'a{color:red}\t /* foobar */\t \n' +
- 'a {color:red} \n \n'
- ),
- 'a { color: red }\n' +
- 'a{color:red}\t /* foobar */\n' +
- 'a {color:red}\n'
- );
- });
- it('Boolean true value should trim trailing spaces at eof', function() {
- this.comb.configure({ 'strip-spaces': true });
- assert.equal(
- this.comb.processString(
- 'a {color:red} '
- ),
- 'a {color:red}'
- );
- });
-
- it('Should detect strip-spaces option set to `true`', function() {
- this.shouldDetect(
- ['strip-spaces'],
- 'a { color: red }',
- {
- 'strip-spaces': true
- }
- );
- });
-
- it('Should detect strip-spaces option set to `false`', function() {
- this.shouldDetect(
- ['strip-spaces'],
- 'a { color: red } ',
- {
- 'strip-spaces': false
- }
- );
- });
-
- it('Should detect strip-spaces option set to `true` with newline', function() {
- this.shouldDetect(
- ['strip-spaces'],
- 'a { color: red }\nb { color: blue }',
- {
- 'strip-spaces': true
- }
- );
- });
-
- it('Should detect strip-spaces option set to `false` with newline', function() {
- this.shouldDetect(
- ['strip-spaces'],
- 'a { color: red } \nb { color: blue }',
- {
- 'strip-spaces': false
- }
- );
- });
-
- it('Should detect strip-spaces option set to `true` inside a value', function() {
- this.shouldDetect(
- ['strip-spaces'],
- 'a {\n color:\n red }',
- {
- 'strip-spaces': true
- }
- );
- });
-
- it('Should detect strip-spaces option set to `false` inside a value', function() {
- this.shouldDetect(
- ['strip-spaces'],
- 'a {\n color: \n red }',
- {
- 'strip-spaces': false
- }
- );
- });
-
- it('Should detect strip-spaces option set to `true` if the only trailing space is the last newline', function() {
- this.shouldDetect(
- ['strip-spaces'],
- 'a { color: red }\n',
- {
- 'strip-spaces': true
- }
- );
- });
-
- it('Should detect strip-spaces option set to `false` if there is more than one newline at the end', function() {
- this.shouldDetect(
- ['strip-spaces'],
- 'a { color: red }\n\n',
- {
- 'strip-spaces': false
- }
- );
- });
-});
diff --git a/node_modules/csscomb/test/options/tab-size.js b/node_modules/csscomb/test/options/tab-size.js
deleted file mode 100644
index 59bb9f0..0000000
--- a/node_modules/csscomb/test/options/tab-size.js
+++ /dev/null
@@ -1,20 +0,0 @@
-describe('options/tab-size:', function() {
- beforeEach(function() {
- this.filename = __filename;
- });
-
- it('Test 1: String value => should not change anything', function() {
- this.comb.configure({ 'tab-size': ' ' });
- this.shouldBeEqual('test.css');
- });
-
- it('Test 2: Float value => should not change anything', function() {
- this.comb.configure({ 'tab-size': 4.5 });
- this.shouldBeEqual('test.css');
- });
-
- it('Test 3: Integer value => should replace tabs with proper number of spaces', function() {
- this.comb.configure({ 'tab-size': 4 });
- this.shouldBeEqual('test.css', 'test.expected.css');
- });
-});
diff --git a/node_modules/csscomb/test/options/tab-size/test.css b/node_modules/csscomb/test/options/tab-size/test.css
deleted file mode 100644
index a5ff8ef..0000000
--- a/node_modules/csscomb/test/options/tab-size/test.css
+++ /dev/null
@@ -1,4 +0,0 @@
-a {
- color: tomato;
- top: 0;
- }
diff --git a/node_modules/csscomb/test/options/tab-size/test.expected.css b/node_modules/csscomb/test/options/tab-size/test.expected.css
deleted file mode 100644
index 248453a..0000000
--- a/node_modules/csscomb/test/options/tab-size/test.expected.css
+++ /dev/null
@@ -1,4 +0,0 @@
-a {
- color: tomato;
- top: 0;
- }
diff --git a/node_modules/csscomb/test/options/unitless-zero.js b/node_modules/csscomb/test/options/unitless-zero.js
deleted file mode 100644
index f47be91..0000000
--- a/node_modules/csscomb/test/options/unitless-zero.js
+++ /dev/null
@@ -1,103 +0,0 @@
-var assert = require('assert');
-
-describe('options/unitless-zero', function() {
- it('Should remove units in zero-valued dimensions', function() {
- this.comb.configure({ 'unitless-zero': true });
- assert.equal(
- this.comb.processString(
- 'div { margin: 0em; padding: 0px }'
- ),
- 'div { margin: 0; padding: 0 }'
- );
- assert.equal(
- this.comb.processString(
- 'div { margin: 0% }'
- ),
- 'div { margin: 0 }'
- );
- });
-
- it('Should remove units in zero-valued media-query params', function() {
- this.comb.configure({ 'unitless-zero': true });
- assert.equal(
- this.comb.processString('@media all and (min-width: 0px) { div { margin: 0em; padding: 0px } }'),
- '@media all and (min-width: 0) { div { margin: 0; padding: 0 } }'
- );
- });
-
- it('Should not remove units (degs) in rotate property', function() {
- this.comb.configure({ 'unitless-zero': true });
- assert.equal(
- this.comb.processString(
- 'div { -webkit-transform: rotate(0deg); }'
- ),
- 'div { -webkit-transform: rotate(0deg); }'
- );
- });
-
- it('Should detect unitless zero option', function() {
- this.shouldDetect(
- ['unitless-zero'],
- 'a { width: 0 }',
- {
- 'unitless-zero': true
- }
- );
- });
-
- it('Should detect zero with unit', function() {
- this.shouldDetect(
- ['unitless-zero'],
- 'a { width: 0px }',
- {
- 'unitless-zero': false
- }
- );
- });
-
- it('Should detect unitless zero option with multiple values', function() {
- this.shouldDetect(
- ['unitless-zero'],
- 'a { padding: 0px 0 0 }',
- {
- 'unitless-zero': true
- }
- );
- });
-
- it('Should detect zero with unit and multiple values', function() {
- this.shouldDetect(
- ['unitless-zero'],
- 'a { padding: 0px 0 0em }',
- {
- 'unitless-zero': false
- }
- );
- });
-
- it('Shouldn’t detect unitless zero option if there is no unit', function() {
- this.shouldDetect(
- ['unitless-zero'],
- 'a { color: red }',
- {}
- );
- });
-
- it('Shouldn’t detect unitless zero option if there is `deg` unit', function() {
- this.shouldDetect(
- ['unitless-zero'],
- 'a { transform: rotate(0deg) }',
- {}
- );
- });
-
- it('Should detect unitless zero option with percents', function() {
- this.shouldDetect(
- ['unitless-zero'],
- 'a { padding: 0% 0 0 }',
- {
- 'unitless-zero': true
- }
- );
- });
-});
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align-sass.js b/node_modules/csscomb/test/options/vendor-prefix-align-sass.js
deleted file mode 100644
index 4e3a746..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align-sass.js
+++ /dev/null
@@ -1,14 +0,0 @@
-describe('options/vendor-prefix-align', function() {
- beforeEach(function() {
- this.filename = __filename;
- this.comb.configure({ 'vendor-prefix-align': true });
- });
-
- it('Should align prexied values', function() {
- this.shouldBeEqual('value.sass', 'value.expected.sass');
- });
-
- it('Should not align prefixed property names', function() {
- this.shouldBeEqual('property.sass');
- });
-});
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align-sass/property.sass b/node_modules/csscomb/test/options/vendor-prefix-align-sass/property.sass
deleted file mode 100644
index b488c7a..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align-sass/property.sass
+++ /dev/null
@@ -1,4 +0,0 @@
-a
- -webkit-color: panda
- color: panda
- -moz-color: panda
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align-sass/value.expected.sass b/node_modules/csscomb/test/options/vendor-prefix-align-sass/value.expected.sass
deleted file mode 100644
index 4df59da..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align-sass/value.expected.sass
+++ /dev/null
@@ -1,4 +0,0 @@
-a
- color: panda
- color: -webkit-panda
- color: -moz-panda
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align-sass/value.sass b/node_modules/csscomb/test/options/vendor-prefix-align-sass/value.sass
deleted file mode 100644
index e3cff56..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align-sass/value.sass
+++ /dev/null
@@ -1,4 +0,0 @@
-a
- color: panda
- color: -webkit-panda
- color: -moz-panda
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align.js b/node_modules/csscomb/test/options/vendor-prefix-align.js
deleted file mode 100644
index 353b3e1..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align.js
+++ /dev/null
@@ -1,156 +0,0 @@
-describe('options/vendor-prefix-align', function() {
- beforeEach(function() {
- this.filename = __filename;
- this.comb.configure({ 'vendor-prefix-align': true });
- });
-
- it('Should correctly work when there is comment before property name', function() {
- this.shouldBeEqual('with-comment-property.css', 'with-comment-property.expected.css');
- });
-
- it('Should correctly work when there is comment before property name. Test 2', function() {
- this.shouldBeEqual('with-comment-property-2.css', 'with-comment-property-2.expected.css');
- });
-
- it('Should correctly work when there is comment before property name. Test 3', function() {
- this.shouldBeEqual('multiline-comments.css', 'multiline-comments.expected.css');
- });
-
- it('Should correctly align prefixes in properties', function() {
- this.shouldBeEqual('property-align.css', 'property-align.expected.css');
- });
-
- it('Should correctly align prefixes in values', function() {
- this.shouldBeEqual('value-align.css', 'value-align.expected.css');
- });
-
- it('Should not touch already align prefixes', function() {
- this.shouldBeEqual('already-aligned.css', 'already-aligned.expected.css');
- });
-
- it('Should correctly align prefixes in properties and values at the same time', function() {
- this.shouldBeEqual('both.css', 'both.expected.css');
- });
-
- it('Should correctly work when value and property names are the same', function() {
- this.shouldBeEqual('same-name.css', 'same-name.expected.css');
- });
-
- it('Should correctly work when there is no whitespace after colon', function() {
- this.shouldBeEqual('without-space.css', 'without-space.expected.css');
- });
-
- it('Should correctly work when there is comment after colon', function() {
- this.shouldBeEqual('with-comment.css', 'with-comment.expected.css');
- });
-
- it('Should not do anything with oneliners', function() {
- this.shouldBeEqual('one-line.css', 'one-line.expected.css');
- });
-
- it('Should not do anything with oneliners. Test 2', function() {
- this.shouldBeEqual('one-line-2.css', 'one-line-2.expected.css');
- });
-
- it('Should always correctly align prefixes', function() {
- this.shouldBeEqual('complex.css', 'complex.expected.css');
- });
-
- it('Issue 193: should handle declarations without preceding spaces', function() {
- this.shouldBeEqual('issue-193.css', 'issue-193.expected.css');
- });
-
- it('Issue 241: should not break tabs', function() {
- this.comb.configure({
- 'block-indent': '\t',
- 'vendor-prefix-align': true
- });
- this.shouldBeEqual('issue-241.css', 'issue-241.expected.css');
- });
-
- it('Shouldn not detect anything if there are no prefixed groups', function() {
- this.shouldDetect(
- ['vendor-prefix-align'],
- 'a{ color: red }a{ -webkit-transform: translateZ(0) }',
- {}
- );
- });
-
- it('Shouldn detect vendor-prefix-align as false in properties', function() {
- this.shouldDetect(
- ['vendor-prefix-align'],
- this.readFile('property-align.css'),
- {
- 'vendor-prefix-align': false
- }
- );
- });
-
- it('Shouldn detect vendor-prefix-align as true in properties', function() {
- this.shouldDetect(
- ['vendor-prefix-align'],
- this.readFile('property-align.expected.css'),
- {
- 'vendor-prefix-align': true
- }
- );
- });
-
- it('Shouldn detect vendor-prefix-align as false in values', function() {
- this.shouldDetect(
- ['vendor-prefix-align'],
- this.readFile('value-align.css'),
- {
- 'vendor-prefix-align': false
- }
- );
- });
-
- it('Shouldn detect vendor-prefix-align as true in values', function() {
- this.shouldDetect(
- ['vendor-prefix-align'],
- this.readFile('value-align.expected.css'),
- {
- 'vendor-prefix-align': true
- }
- );
- });
-
- it('Shouldn detect vendor-prefix-align as true, test 1', function() {
- this.shouldDetect(
- ['vendor-prefix-align'],
- this.readFile('already-aligned.css'),
- {
- 'vendor-prefix-align': true
- }
- );
- });
-
- it('Shouldn detect vendor-prefix-align as true, test 2', function() {
- this.shouldDetect(
- ['vendor-prefix-align'],
- this.readFile('complex.expected.css'),
- {
- 'vendor-prefix-align': true
- }
- );
- });
-
- it('Shouldn detect vendor-prefix-align as false', function() {
- this.shouldDetect(
- ['vendor-prefix-align'],
- this.readFile('complex.css'),
- {
- 'vendor-prefix-align': false
- }
- );
- });
-
- it('Should not detect anything in simple case', function() {
- this.shouldDetect(
- ['vendor-prefix-align'],
- 'a{border:0;}',
- {}
- );
- });
-});
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/already-aligned.css b/node_modules/csscomb/test/options/vendor-prefix-align/already-aligned.css
deleted file mode 100644
index 35b7eee..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align/already-aligned.css
+++ /dev/null
@@ -1,11 +0,0 @@
-.radio-button_theme_normal .radio-button__radio:before
-{
- background: rgba(0,0,0,.4);
- background: -webkit-linear-gradient(top, rgba(0,0,0,.2) 0,rgba(0,0,0,.4) 100%);
- background: -moz-linear-gradient(top, rgba(0,0,0,.2) 0, rgba(0,0,0,.4) 100%);
- background: -o-linear-gradient(top, rgba(0,0,0,.2) 0,rgba(0,0,0,.4) 100%);
- background: linear-gradient(to bottom, rgba(0,0,0,.2) 0,rgba(0,0,0,.4) 100%);
-
- -moz-box-shadow: 0 1px 0 rgba(0,0,0,.07);
- box-shadow: 0 1px 0 rgba(0,0,0,.07);
-}
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/already-aligned.expected.css b/node_modules/csscomb/test/options/vendor-prefix-align/already-aligned.expected.css
deleted file mode 100644
index 35b7eee..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align/already-aligned.expected.css
+++ /dev/null
@@ -1,11 +0,0 @@
-.radio-button_theme_normal .radio-button__radio:before
-{
- background: rgba(0,0,0,.4);
- background: -webkit-linear-gradient(top, rgba(0,0,0,.2) 0,rgba(0,0,0,.4) 100%);
- background: -moz-linear-gradient(top, rgba(0,0,0,.2) 0, rgba(0,0,0,.4) 100%);
- background: -o-linear-gradient(top, rgba(0,0,0,.2) 0,rgba(0,0,0,.4) 100%);
- background: linear-gradient(to bottom, rgba(0,0,0,.2) 0,rgba(0,0,0,.4) 100%);
-
- -moz-box-shadow: 0 1px 0 rgba(0,0,0,.07);
- box-shadow: 0 1px 0 rgba(0,0,0,.07);
-}
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/both.css b/node_modules/csscomb/test/options/vendor-prefix-align/both.css
deleted file mode 100644
index 3791d29..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align/both.css
+++ /dev/null
@@ -1,5 +0,0 @@
-.serp-block__head_animation_yes
-{
- -webkit-transition: -webkit-transform 150ms linear;
- transition: transform 150ms linear;
-}
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/both.expected.css b/node_modules/csscomb/test/options/vendor-prefix-align/both.expected.css
deleted file mode 100644
index f58aa02..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align/both.expected.css
+++ /dev/null
@@ -1,5 +0,0 @@
-.serp-block__head_animation_yes
-{
- -webkit-transition: -webkit-transform 150ms linear;
- transition: transform 150ms linear;
-}
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/complex.css b/node_modules/csscomb/test/options/vendor-prefix-align/complex.css
deleted file mode 100644
index 3f896df..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align/complex.css
+++ /dev/null
@@ -1,30 +0,0 @@
-@media all and (min-width:0)
-{
- .radio-button_theme_normal .radio-button__radio:before
- {
- background: rgba(0,0,0,.4);
- background: -webkit-linear-gradient(top, rgba(0,0,0,.2) 0,rgba(0,0,0,.4) 100%);
- background: -moz-linear-gradient(top, rgba(0,0,0,.2) 0, rgba(0,0,0,.4) 100%);
- background: -o-linear-gradient(top, rgba(0,0,0,.2) 0,rgba(0,0,0,.4) 100%);
- background: linear-gradient(to bottom, rgba(0,0,0,.2) 0,rgba(0,0,0,.4) 100%);
- -moz-box-shadow: 0 1px 0 rgba(0,0,0,.07);
- box-shadow: 0 1px 0 rgba(0,0,0,.07);
- }
-
- /* :after — фон */
- .radio-button_theme_normal .radio-button__radio:after
- {
- background: #fff;
- background: -webkit-linear-gradient(top, #fff 0,#eee 100%);
- background: -moz-linear-gradient(top, #fff 0, #eee 100%);
- background: -o-linear-gradient(top, #fff 0,#eee 100%);
- background: linear-gradient(to bottom, #fff 0,#eee 100%);
- }
-
- /* _focused_yes */
- .radio-button_theme_normal .radio-button__radio_focused_yes:before
- {
- -moz-box-shadow: 0 0 6px 2px rgba(255,204,0,.7), 0 1px 0 rgba(0,0,0,.07);
- box-shadow: 0 0 6px 2px rgba(255,204,0,.7), 0 1px 0 rgba(0,0,0,.07);
- }
-}
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/complex.expected.css b/node_modules/csscomb/test/options/vendor-prefix-align/complex.expected.css
deleted file mode 100644
index 688ecd6..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align/complex.expected.css
+++ /dev/null
@@ -1,30 +0,0 @@
-@media all and (min-width:0)
-{
- .radio-button_theme_normal .radio-button__radio:before
- {
- background: rgba(0,0,0,.4);
- background: -webkit-linear-gradient(top, rgba(0,0,0,.2) 0,rgba(0,0,0,.4) 100%);
- background: -moz-linear-gradient(top, rgba(0,0,0,.2) 0, rgba(0,0,0,.4) 100%);
- background: -o-linear-gradient(top, rgba(0,0,0,.2) 0,rgba(0,0,0,.4) 100%);
- background: linear-gradient(to bottom, rgba(0,0,0,.2) 0,rgba(0,0,0,.4) 100%);
- -moz-box-shadow: 0 1px 0 rgba(0,0,0,.07);
- box-shadow: 0 1px 0 rgba(0,0,0,.07);
- }
-
- /* :after — фон */
- .radio-button_theme_normal .radio-button__radio:after
- {
- background: #fff;
- background: -webkit-linear-gradient(top, #fff 0,#eee 100%);
- background: -moz-linear-gradient(top, #fff 0, #eee 100%);
- background: -o-linear-gradient(top, #fff 0,#eee 100%);
- background: linear-gradient(to bottom, #fff 0,#eee 100%);
- }
-
- /* _focused_yes */
- .radio-button_theme_normal .radio-button__radio_focused_yes:before
- {
- -moz-box-shadow: 0 0 6px 2px rgba(255,204,0,.7), 0 1px 0 rgba(0,0,0,.07);
- box-shadow: 0 0 6px 2px rgba(255,204,0,.7), 0 1px 0 rgba(0,0,0,.07);
- }
-}
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/issue-193.css b/node_modules/csscomb/test/options/vendor-prefix-align/issue-193.css
deleted file mode 100644
index e0047dd..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align/issue-193.css
+++ /dev/null
@@ -1,2 +0,0 @@
-li {color: #7799c8;
- font-size: 10px;}
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/issue-193.expected.css b/node_modules/csscomb/test/options/vendor-prefix-align/issue-193.expected.css
deleted file mode 100644
index e0047dd..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align/issue-193.expected.css
+++ /dev/null
@@ -1,2 +0,0 @@
-li {color: #7799c8;
- font-size: 10px;}
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/issue-241.css b/node_modules/csscomb/test/options/vendor-prefix-align/issue-241.css
deleted file mode 100644
index e562a61..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align/issue-241.css
+++ /dev/null
@@ -1,6 +0,0 @@
-*
-{
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
-}
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/issue-241.expected.css b/node_modules/csscomb/test/options/vendor-prefix-align/issue-241.expected.css
deleted file mode 100644
index bbc0e34..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align/issue-241.expected.css
+++ /dev/null
@@ -1,6 +0,0 @@
-*
-{
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- }
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/multiline-comments.css b/node_modules/csscomb/test/options/vendor-prefix-align/multiline-comments.css
deleted file mode 100644
index 33c66c5..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align/multiline-comments.css
+++ /dev/null
@@ -1,9 +0,0 @@
-a
-{
- -webkit-color: panda;
- /*
- * /\_/\
- * ( o.o )
- * > ^ <
- */ -moz-color: panda;
-}
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/multiline-comments.expected.css b/node_modules/csscomb/test/options/vendor-prefix-align/multiline-comments.expected.css
deleted file mode 100644
index 6bc01b3..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align/multiline-comments.expected.css
+++ /dev/null
@@ -1,9 +0,0 @@
-a
-{
- -webkit-color: panda;
- /*
- * /\_/\
- * ( o.o )
- * > ^ <
- */ -moz-color: panda;
-}
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/one-line-2.css b/node_modules/csscomb/test/options/vendor-prefix-align/one-line-2.css
deleted file mode 100644
index 6050079..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align/one-line-2.css
+++ /dev/null
@@ -1 +0,0 @@
-a{top:0}
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/one-line-2.expected.css b/node_modules/csscomb/test/options/vendor-prefix-align/one-line-2.expected.css
deleted file mode 100644
index 6050079..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align/one-line-2.expected.css
+++ /dev/null
@@ -1 +0,0 @@
-a{top:0}
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/one-line.css b/node_modules/csscomb/test/options/vendor-prefix-align/one-line.css
deleted file mode 100644
index 3426596..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align/one-line.css
+++ /dev/null
@@ -1 +0,0 @@
-a{ -webkit-color:tomato; -moz-color:tomato; top:0 }
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/one-line.expected.css b/node_modules/csscomb/test/options/vendor-prefix-align/one-line.expected.css
deleted file mode 100644
index 3426596..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align/one-line.expected.css
+++ /dev/null
@@ -1 +0,0 @@
-a{ -webkit-color:tomato; -moz-color:tomato; top:0 }
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/property-align.css b/node_modules/csscomb/test/options/vendor-prefix-align/property-align.css
deleted file mode 100644
index b19d6b7..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align/property-align.css
+++ /dev/null
@@ -1,8 +0,0 @@
-a
-{
- color: #fff;
-
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
- border-radius: 3px;
-}
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/property-align.expected.css b/node_modules/csscomb/test/options/vendor-prefix-align/property-align.expected.css
deleted file mode 100644
index 2580857..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align/property-align.expected.css
+++ /dev/null
@@ -1,8 +0,0 @@
-a
-{
- color: #fff;
-
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
- border-radius: 3px;
-}
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/same-name.css b/node_modules/csscomb/test/options/vendor-prefix-align/same-name.css
deleted file mode 100644
index dbdc5c4..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align/same-name.css
+++ /dev/null
@@ -1,7 +0,0 @@
-.test
-{
- -webkit-transition: -webkit-transform .6s;
- transition: transform .6s;
- -webkit-transform: scale(.6, .6);
- transform: scale(.6, .6);
-}
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/same-name.expected.css b/node_modules/csscomb/test/options/vendor-prefix-align/same-name.expected.css
deleted file mode 100644
index 9059807..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align/same-name.expected.css
+++ /dev/null
@@ -1,7 +0,0 @@
-.test
-{
- -webkit-transition: -webkit-transform .6s;
- transition: transform .6s;
- -webkit-transform: scale(.6, .6);
- transform: scale(.6, .6);
-}
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/value-align.css b/node_modules/csscomb/test/options/vendor-prefix-align/value-align.css
deleted file mode 100644
index f15a362..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align/value-align.css
+++ /dev/null
@@ -1,10 +0,0 @@
-b
-{
- color: #fff;
-
- background: -webkit-linear-gradient(linear, left top, right top, color-stop(0,rgba(255,255,255,0)), color-stop(20%, #fff));
- background: -moz-linear-gradient(left, rgba(255,255,255,0) 0, #fff 20%);
- background: -o-linear-gradient(left, rgba(255,255,255,0) 0, #fff 20%);
- background: -ms-linear-gradient(left, rgba(255,255,255,0) 0, #fff 20%);
- background: linear-gradient(to right, rgba(255,255,255,0) 0, #fff 20%);
-}
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/value-align.expected.css b/node_modules/csscomb/test/options/vendor-prefix-align/value-align.expected.css
deleted file mode 100644
index 60aba2e..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align/value-align.expected.css
+++ /dev/null
@@ -1,10 +0,0 @@
-b
-{
- color: #fff;
-
- background: -webkit-linear-gradient(linear, left top, right top, color-stop(0,rgba(255,255,255,0)), color-stop(20%, #fff));
- background: -moz-linear-gradient(left, rgba(255,255,255,0) 0, #fff 20%);
- background: -o-linear-gradient(left, rgba(255,255,255,0) 0, #fff 20%);
- background: -ms-linear-gradient(left, rgba(255,255,255,0) 0, #fff 20%);
- background: linear-gradient(to right, rgba(255,255,255,0) 0, #fff 20%);
-}
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/with-comment-property-2.css b/node_modules/csscomb/test/options/vendor-prefix-align/with-comment-property-2.css
deleted file mode 100644
index 113d334..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align/with-comment-property-2.css
+++ /dev/null
@@ -1,3 +0,0 @@
-a
-{
- top: 0;/* ololo */margin: 0;}
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/with-comment-property-2.expected.css b/node_modules/csscomb/test/options/vendor-prefix-align/with-comment-property-2.expected.css
deleted file mode 100644
index 113d334..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align/with-comment-property-2.expected.css
+++ /dev/null
@@ -1,3 +0,0 @@
-a
-{
- top: 0;/* ololo */margin: 0;}
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/with-comment-property.css b/node_modules/csscomb/test/options/vendor-prefix-align/with-comment-property.css
deleted file mode 100644
index 9e3bea3..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align/with-comment-property.css
+++ /dev/null
@@ -1,5 +0,0 @@
-body
-{
- -webkit-transition: transform 150ms linear;
- /* comment */ transition: transform 150ms linear;
-}
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/with-comment-property.expected.css b/node_modules/csscomb/test/options/vendor-prefix-align/with-comment-property.expected.css
deleted file mode 100644
index b65b210..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align/with-comment-property.expected.css
+++ /dev/null
@@ -1,5 +0,0 @@
-body
-{
- -webkit-transition: transform 150ms linear;
- /* comment */ transition: transform 150ms linear;
-}
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/with-comment.css b/node_modules/csscomb/test/options/vendor-prefix-align/with-comment.css
deleted file mode 100644
index f792a8c..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align/with-comment.css
+++ /dev/null
@@ -1,5 +0,0 @@
-body
-{
- background: -webkit-linear-gradient(nani);
- background: /* comment */ -moz-linear-gradient(nani);
-}
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/with-comment.expected.css b/node_modules/csscomb/test/options/vendor-prefix-align/with-comment.expected.css
deleted file mode 100644
index 9d5d161..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align/with-comment.expected.css
+++ /dev/null
@@ -1,5 +0,0 @@
-body
-{
- background: -webkit-linear-gradient(nani);
- background: /* comment */ -moz-linear-gradient(nani);
-}
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/without-space.css b/node_modules/csscomb/test/options/vendor-prefix-align/without-space.css
deleted file mode 100644
index 09bd955..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align/without-space.css
+++ /dev/null
@@ -1,5 +0,0 @@
-body
-{
- background:-webkit-linear-gradient(nani);
- background:-moz-linear-gradient(nani);
-}
diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/without-space.expected.css b/node_modules/csscomb/test/options/vendor-prefix-align/without-space.expected.css
deleted file mode 100644
index 1be5389..0000000
--- a/node_modules/csscomb/test/options/vendor-prefix-align/without-space.expected.css
+++ /dev/null
@@ -1,5 +0,0 @@
-body
-{
- background:-webkit-linear-gradient(nani);
- background: -moz-linear-gradient(nani);
-}
diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/.npmignore b/node_modules/glob/.npmignore
similarity index 100%
rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/.npmignore
rename to node_modules/glob/.npmignore
diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/.travis.yml b/node_modules/glob/.travis.yml
similarity index 100%
rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/.travis.yml
rename to node_modules/glob/.travis.yml
diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/minimatch/node_modules/sigmund/LICENSE b/node_modules/glob/LICENSE
similarity index 100%
rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/minimatch/node_modules/sigmund/LICENSE
rename to node_modules/glob/LICENSE
diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/README.md b/node_modules/glob/README.md
similarity index 100%
rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/README.md
rename to node_modules/glob/README.md
diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/examples/g.js b/node_modules/glob/examples/g.js
similarity index 100%
rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/examples/g.js
rename to node_modules/glob/examples/g.js
diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/examples/usr-local.js b/node_modules/glob/examples/usr-local.js
similarity index 100%
rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/examples/usr-local.js
rename to node_modules/glob/examples/usr-local.js
diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/glob.js b/node_modules/glob/glob.js
similarity index 100%
rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/glob.js
rename to node_modules/glob/glob.js
diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/package.json b/node_modules/glob/package.json
similarity index 56%
rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/package.json
rename to node_modules/glob/package.json
index dc84d92..4458c97 100644
--- a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/package.json
+++ b/node_modules/glob/package.json
@@ -1,55 +1,81 @@
{
+ "_args": [
+ [
+ "glob@3.2.8",
+ "/Users/jsuh/Dropbox/Apps/Sublime Text 3/Packages/sublime-csscomb/node_modules/vow-fs"
+ ]
+ ],
+ "_from": "glob@3.2.8",
+ "_id": "glob@3.2.8",
+ "_inCache": true,
+ "_installable": true,
+ "_location": "/glob",
+ "_npmUser": {
+ "email": "i@izs.me",
+ "name": "isaacs"
+ },
+ "_npmVersion": "1.3.23",
+ "_phantomChildren": {},
+ "_requested": {
+ "name": "glob",
+ "raw": "glob@3.2.8",
+ "rawSpec": "3.2.8",
+ "scope": null,
+ "spec": "3.2.8",
+ "type": "version"
+ },
+ "_requiredBy": [
+ "/vow-fs"
+ ],
+ "_resolved": "https://registry.npmjs.org/glob/-/glob-3.2.8.tgz",
+ "_shasum": "5506f4311721bcc618c7d8dba144188750307073",
+ "_shrinkwrap": null,
+ "_spec": "glob@3.2.8",
+ "_where": "/Users/jsuh/Dropbox/Apps/Sublime Text 3/Packages/sublime-csscomb/node_modules/vow-fs",
"author": {
- "name": "Isaac Z. Schlueter",
"email": "i@izs.me",
+ "name": "Isaac Z. Schlueter",
"url": "http://blog.izs.me/"
},
- "name": "glob",
- "description": "a little globber",
- "version": "3.2.8",
- "repository": {
- "type": "git",
- "url": "git://github.com/isaacs/node-glob.git"
- },
- "main": "glob.js",
- "engines": {
- "node": "*"
+ "bugs": {
+ "url": "https://github.com/isaacs/node-glob/issues"
},
"dependencies": {
- "minimatch": "~0.2.11",
- "inherits": "2"
+ "inherits": "2",
+ "minimatch": "~0.2.11"
},
+ "description": "a little globber",
"devDependencies": {
- "tap": "~0.4.0",
"mkdirp": "0",
- "rimraf": "1"
- },
- "scripts": {
- "test": "tap test/*.js"
+ "rimraf": "1",
+ "tap": "~0.4.0"
},
- "license": "BSD",
- "bugs": {
- "url": "https://github.com/isaacs/node-glob/issues"
- },
- "homepage": "https://github.com/isaacs/node-glob",
- "_id": "glob@3.2.8",
+ "directories": {},
"dist": {
"shasum": "5506f4311721bcc618c7d8dba144188750307073",
"tarball": "http://registry.npmjs.org/glob/-/glob-3.2.8.tgz"
},
- "_from": "glob@3.2.8",
- "_npmVersion": "1.3.23",
- "_npmUser": {
- "name": "isaacs",
- "email": "i@izs.me"
+ "engines": {
+ "node": "*"
},
+ "homepage": "https://github.com/isaacs/node-glob",
+ "license": "BSD",
+ "main": "glob.js",
"maintainers": [
{
"name": "isaacs",
"email": "i@izs.me"
}
],
- "directories": {},
- "_shasum": "5506f4311721bcc618c7d8dba144188750307073",
- "_resolved": "https://registry.npmjs.org/glob/-/glob-3.2.8.tgz"
+ "name": "glob",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/isaacs/node-glob.git"
+ },
+ "scripts": {
+ "test": "tap test/*.js"
+ },
+ "version": "3.2.8"
}
diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/00-setup.js b/node_modules/glob/test/00-setup.js
similarity index 100%
rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/00-setup.js
rename to node_modules/glob/test/00-setup.js
diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/bash-comparison.js b/node_modules/glob/test/bash-comparison.js
similarity index 100%
rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/bash-comparison.js
rename to node_modules/glob/test/bash-comparison.js
diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/bash-results.json b/node_modules/glob/test/bash-results.json
similarity index 100%
rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/bash-results.json
rename to node_modules/glob/test/bash-results.json
diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/cwd-test.js b/node_modules/glob/test/cwd-test.js
similarity index 100%
rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/cwd-test.js
rename to node_modules/glob/test/cwd-test.js
diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/globstar-match.js b/node_modules/glob/test/globstar-match.js
similarity index 100%
rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/globstar-match.js
rename to node_modules/glob/test/globstar-match.js
diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/mark.js b/node_modules/glob/test/mark.js
similarity index 100%
rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/mark.js
rename to node_modules/glob/test/mark.js
diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/new-glob-optional-options.js b/node_modules/glob/test/new-glob-optional-options.js
similarity index 100%
rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/new-glob-optional-options.js
rename to node_modules/glob/test/new-glob-optional-options.js
diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/nocase-nomagic.js b/node_modules/glob/test/nocase-nomagic.js
similarity index 100%
rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/nocase-nomagic.js
rename to node_modules/glob/test/nocase-nomagic.js
diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/pause-resume.js b/node_modules/glob/test/pause-resume.js
similarity index 100%
rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/pause-resume.js
rename to node_modules/glob/test/pause-resume.js
diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/root-nomount.js b/node_modules/glob/test/root-nomount.js
similarity index 100%
rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/root-nomount.js
rename to node_modules/glob/test/root-nomount.js
diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/root.js b/node_modules/glob/test/root.js
similarity index 100%
rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/root.js
rename to node_modules/glob/test/root.js
diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/stat.js b/node_modules/glob/test/stat.js
similarity index 100%
rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/stat.js
rename to node_modules/glob/test/stat.js
diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/zz-cleanup.js b/node_modules/glob/test/zz-cleanup.js
similarity index 100%
rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/test/zz-cleanup.js
rename to node_modules/glob/test/zz-cleanup.js
diff --git a/node_modules/csscomb/node_modules/gonzales-pe/.npmignore b/node_modules/gonzales-pe/.npmignore
similarity index 100%
rename from node_modules/csscomb/node_modules/gonzales-pe/.npmignore
rename to node_modules/gonzales-pe/.npmignore
diff --git a/node_modules/csscomb/.travis.yml b/node_modules/gonzales-pe/.travis.yml
similarity index 90%
rename from node_modules/csscomb/.travis.yml
rename to node_modules/gonzales-pe/.travis.yml
index 4a5a560..07abc8b 100644
--- a/node_modules/csscomb/.travis.yml
+++ b/node_modules/gonzales-pe/.travis.yml
@@ -1,8 +1,9 @@
language: node_js
node_js:
- - "0.10"
- "0.11"
+ - "0.10"
+ - "0.8"
matrix:
allow_failures:
diff --git a/node_modules/csscomb/node_modules/gonzales-pe/CHANGELOG.md b/node_modules/gonzales-pe/CHANGELOG.md
similarity index 72%
rename from node_modules/csscomb/node_modules/gonzales-pe/CHANGELOG.md
rename to node_modules/gonzales-pe/CHANGELOG.md
index 7945431..c916e4d 100644
--- a/node_modules/csscomb/node_modules/gonzales-pe/CHANGELOG.md
+++ b/node_modules/gonzales-pe/CHANGELOG.md
@@ -1,6 +1,38 @@
Gonzales changelog
==================
+xx.xx.201x, Version 3.0.0
+-------------------------
+
+AST:
+ - Rename `interpolatedVariable` to `interpolation`
+ - Rename `functionBody` to `arguments`
+ - New node type `conditionalStatement`
+ - Remove unused node types
+
+Parsing rules:
+ - Interpolations are ok as arguments, inside nth selector and within identifiers
+ - Functions are ok as arguments
+ - Spaces are optional after declDelim
+ - Check for unary operator in arguments
+ - Parse operators inside arguments (#16)
+ - Remove spaces from the end of includes
+ - Every argument can be escaped string
+ - Braces around arguments are ok
+ - Equality and inequality signs are ok as operators
+
+API:
+ - srcToAST({src: 'string', syntax: 'css', needInfo: true, rule: 'stylesheet'})
+ - astToSrc()
+ - astToString()
+
+Tests:
+ - Add more tests
+ - Place test files inside rule directory
+ - Use 'min' reporter instead of 'spec'
+ - Add Travis config
+ - Divide log and test scripts
+
29.12.2013, Version 2.0.2
-------------------------
diff --git a/node_modules/csscomb/node_modules/gonzales-pe/MIT-LICENSE.txt b/node_modules/gonzales-pe/MIT-LICENSE.txt
similarity index 100%
rename from node_modules/csscomb/node_modules/gonzales-pe/MIT-LICENSE.txt
rename to node_modules/gonzales-pe/MIT-LICENSE.txt
diff --git a/node_modules/gonzales-pe/README.md b/node_modules/gonzales-pe/README.md
new file mode 100644
index 0000000..0c2e959
--- /dev/null
+++ b/node_modules/gonzales-pe/README.md
@@ -0,0 +1,227 @@
+## API
+
+### gonzales.parse(css, options)
+
+Parse CSS.
+
+Parameters:
+
+* `{String} css`
+* `{{syntax: String, rule: String}} options`
+
+Returns:
+
+* `{Object} ast`.
+
+Example:
+```js
+ var css = 'a {color: tomato}';
+ var ast = gonzales.parse(css);
+```
+
+Example:
+```js
+ var less = 'a {$color: tomato}';
+ var ast = gonzales.parse(less, {syntax: 'less'});
+```
+
+Example:
+```js
+ var less = '$color: tomato';
+ var ast = gonzales.parse(less, {syntax: 'less', rule: 'declaration'});
+```
+
+### gonzales.createNode(options)
+
+Creates a new node.
+
+Parameters:
+
+* `{{type: String, content: String|Array}} options`
+
+Returns:
+
+* `{Object} ast`
+
+Example:
+```js
+ var css = 'a {color: tomato}';
+ var ast = gonzales.parse(css);
+ var node = gonzales.createNode({ type: 'animal', content: 'panda' });
+ ast.content.push(node);
+```
+
+### ast.length
+
+### ast.toString()
+
+### ast.toCSS(syntax)
+
+Converts AST to code.
+
+Parameters:
+
+* `{String} syntax`
+
+Returns:
+
+* `{String} css`
+
+Example:
+```js
+ var css = ast.toCSS('css');
+ var less = ast.toCSS('less');
+```
+### ast.contains(type)
+
+Checks whether there is a child node of given type.
+
+Parameters:
+
+* `{String} type`
+
+Returns:
+
+* `{Boolean}`
+
+Example:
+```js
+ if (ast.contains('panda'))
+ doSomething();
+```
+
+### ast.first(type)
+
+Returns the first child node of given type.
+
+Parameters:
+
+* `{String=} type`
+
+Returns:
+
+* `{Node} node`
+
+Example:
+```js
+ var node = ast.first();
+ node.content = 'panda';
+```
+
+Example:
+```js
+ var node = ast.first('commentML');
+ node.content = 'panda';
+```
+
+### ast.forEach(type, function)
+
+Calls the function for every child node of given type.
+
+Parameters:
+
+* `{String=} type`
+* `{Function} function`
+
+Example:
+```js
+ ast.forEach('commentML', function(node) {
+ node.content = 'panda';
+ });
+```
+
+### ast.get(index)
+
+### ast.insert(index, node)
+
+### ast.is(type)
+
+Checks whether the node is of given type.
+
+Parameters:
+
+* `{String} type`
+
+Returns:
+
+* `{Boolean}`
+
+Example:
+```js
+ if (ast.is('s'))
+ ast.content = '';
+```
+
+### ast.last(type)
+
+Returns the last child node of given type.
+
+Parameters:
+
+* `{String=} type`
+
+Returns:
+
+* `{Node} node`
+
+Example:
+```js
+ var node = ast.last()
+ node.content = 'panda';
+```
+
+Example:
+```js
+ var node = ast.last('commentML');
+ node.content = 'panda';
+```
+
+### ast.map(function)
+
+Calls the function for every node in a tree. Modifies the tree!
+
+Parameters:
+
+* `{Function} function`
+
+Example:
+```js
+ ast.map(function(node) {
+ if (node.type === 'commentML') node.content = 'panda';
+ });
+```
+
+
+## Test
+
+To run tests:
+
+ npm test
+
+This command will build library files from sources and run tests on all files
+in syntax directories.
+
+Every test has 3 files: source stylesheet, expected AST and expected string
+compiled back from AST to css.
+
+If some tests fail, you can find information in test logs:
+
+- `log/test.log` contains all information from stdout;
+- `log/expected.txt` contains only expected text;
+- `log/result.txt` contains only result text.
+
+The last two are made for your convenience: you can use any diff app to see
+the defference between them.
+
+If you want to test one specific string or get a general idea of how Gonzales
+works, you can use `test/ast.js` file.
+Simply change the first two strings (`css` and `syntax` vars) and run:
+
+ node test/single-test.js
+
+## Report
+
+If you find a bug or want to add a feature, welcome to [Issues](https://github.com/tonyganch/gonzales-pe/issues).
+
+If you are shy but have a question, feel free to [drop me a
+line](mailto:tonyganch+gonzales@gmail.com).
diff --git a/node_modules/gonzales-pe/TODO.nani b/node_modules/gonzales-pe/TODO.nani
new file mode 100644
index 0000000..a5e1b6a
--- /dev/null
+++ b/node_modules/gonzales-pe/TODO.nani
@@ -0,0 +1,26 @@
+Tests:
+ + Проверить, что все тесты, которые есть в папках, фактически запускаются
+ - Починить pending тесты
+
+Fix:
+ - Fix column/line position
+ - Replace `content: null` with actual content
+ - Replace `unary` with `operator`
+ - Вынести пробелы из начала atrulerq
+ - Проверить functionExpression: type string or array
+ - Убрать: Внутри ident в sass могут быть interpolations, поэтому ident.content является массивом из строк и interpolations
+ - Типы вроде `important` в качестве контента должны содержать не пробелы, а весь идент
+ - Убрать unknown type
+ - Сделать вспомогательные методы вроде blockDecl приватными
+ - В Sass убрать curly braces у atruler
+
+Docs:
+ - Changelog
+ - Readme
+ - AST
+ - API
+
+Плюшки:
+ - Попробовать Closure Compiler и сравнить скорость
+ - Update bin
+ - Вынести тестовые синтаксисы в отд. репозиторий-модуль
diff --git a/node_modules/gonzales-pe/bin/generate-tests.js b/node_modules/gonzales-pe/bin/generate-tests.js
new file mode 100755
index 0000000..f127dc6
--- /dev/null
+++ b/node_modules/gonzales-pe/bin/generate-tests.js
@@ -0,0 +1,45 @@
+#!/usr/bin/env node
+
+/**
+ * Generate `.json` test files.
+ * Usage: `./bin/generate-tests.js function(nodeType, nodeContent) {\n if (nodeType === 'commentML') node[0] = ' (╯°□°)╯︵ ┻━┻ ';\n}