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

@@ -33,6 +33,7 @@ unwrap = /function\s*\(\)\s*\{\s*return\s*([\s\S]*);\s*\}/
o = (patternString, action, options) ->
return [patternString, '$$ = $1;', options] unless action
action = if match = (action + '').match(unwrap) then match[1] else "(#{action}())"
action = action.replace /\b(?:[A-Z][a-z]+Node|Expressions)\b/g, 'yy.$&'
[patternString, "$$ = #{action};", options]
# Grammatical Rules