removed global dependency from grammer

This commit is contained in:
satyr
2010-09-21 16:50:32 +09:00
parent 69942c9a81
commit 7bc91bf6c6
5 changed files with 135 additions and 132 deletions

View File

@@ -9,6 +9,7 @@
return [patternString, '$$ = $1;', options];
}
action = (match = (action + '').match(unwrap)) ? match[1] : ("(" + (action) + "())");
action = action.replace(/\b(?:[A-Z][a-z]+Node|Expressions)\b/g, 'yy.$&');
return [patternString, ("$$ = " + (action) + ";"), options];
};
grammar = {