Merge branch 'master' of github.com:developmentseed/mess.js

This commit is contained in:
Konstantin Käfer 2011-01-27 16:00:07 -05:00
commit f889597358
3 changed files with 14 additions and 6 deletions

View File

@ -670,7 +670,7 @@ mess.Parser = function Parser(env) {
if ((input.charAt(i) !== '.' && input.charAt(i) !== '#') ||
peek(/^[^{]*(;|})/)) return;
if (match = $(/^([#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+)\s*\(/)) {
if (match = $(/^([#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+)[\s,]*\(/)) {
name = match[1];
while (param = $(this.entities.variable) || $(this.entities.literal)

View File

@ -684,9 +684,17 @@ tree.Reference.validValue = function(env, selector, value) {
return true;
} else {
if (tree.Reference.selector(selector).validate) {
return tree.Reference.selector(selector).type == value.value[0].is &&
tree.Reference._validateValue[tree.Reference.selector(selector).validate];
(env, value.value[0].value);
var valid = false;
for (var i = 0; i < value.value.length; i++) {
if (tree.Reference.selector(selector).type == value.value[i].is &&
tree.Reference
._validateValue
[tree.Reference.selector(selector).validate]
(env, value.value[i].value)) {
return true;
}
}
return valid;
} else {
return tree.Reference.selector(selector).type == value.value[0].is;
}

View File

@ -25,8 +25,8 @@ tree.Rule.prototype.toXML = function(env) {
return env.error({
message: 'Invalid value for ' +
this.name +
', a ' +
tree.Reference.selector(this.name).type +
', a valid ' +
tree.Reference.selector(this.name).validate +
' is expected. ' + this.value +
' was given.',
index: this.index