Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion bin/blessc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ var options = {
cleanup: true,
compress: false,
force: false,
imports: true
imports: true,
limit: 4095
};

args = args.filter(function (arg) {
Expand Down Expand Up @@ -60,6 +61,9 @@ args = args.filter(function (arg) {
break;
case 'no-cache-buster':
options.cacheBuster = false;
break;
case 'l':
options.limit = match[2];
}
});

Expand Down
5 changes: 3 additions & 2 deletions lib/bless/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ bless.Parser = function Parser(env) {
var output = this.env.output,
options = this.env.options;

options.limit = options.limit || 4095;

//
// The Parser
//
Expand All @@ -21,7 +23,6 @@ bless.Parser = function Parser(env) {
parse: function (str, callback) {
var files = [],
error = null,
limit = 4095,
selectors = str.match(/(,|\{)/g),
rules = str.match(/([^\{]+\{(?:[^\{\}]|\{[^\{\}]*\})*\})/g),
numSelectors = 0;
Expand Down Expand Up @@ -62,7 +63,7 @@ bless.Parser = function Parser(env) {

matchCount = matchArray.length;

if (selectorCount + matchCount > limit) {
if (selectorCount + matchCount > options.limit) {
var slice = rules.slice(offset, i);

if (slice.length > 0) {
Expand Down