Fix parsing of whitespace in calls.

This brings over cloudmade/less.js@333d1def4 to permit whitespace in
front of arguments of function calls, and tweaks the related test to
make sure it stays that way. This fixes #154
This commit is contained in:
Tom MacWright 2012-09-21 14:27:19 -04:00
parent 033a5cd5a5
commit 912988e174
2 changed files with 5 additions and 3 deletions

View File

@ -461,16 +461,18 @@ carto.Parser = function Parser(env) {
call: function() {
var name, args;
if (! (name = /^([\w\-]+|%)\(/.exec(chunks[j]))) return;
if (!(name = /^([\w\-]+|%)\(/.exec(chunks[j]))) return;
name = name[1];
if (name === 'url') {
return null;
} else {
i += name.length + 1;
i += name.length;
}
$('('); // Parse the '(' and consume whitespace.
args = $(this.entities.arguments);
if (!$(')')) return;

View File

@ -1,5 +1,5 @@
@trans: 2;
#world {
point-file: url(foo.png);
point-transform: translate(@trans * 2, @trans);
point-transform: translate( @trans * 2, @trans);
}