first step towards requiring #{ ... } interpolation -- removing naked interps from the compiler.

This commit is contained in:
Jeremy Ashkenas
2010-08-07 08:02:16 -04:00
parent b1f7d5e33b
commit 9df3e6a538
28 changed files with 284 additions and 300 deletions

View File

@@ -32,8 +32,8 @@ unwrap = /function\s*\(\)\s*\{\s*return\s*([\s\S]*);\s*\}/
# previous nonterminal.
o = (patternString, action, options) ->
return [patternString, '$$ = $1;', options] unless action
action = if match = (action + '').match(unwrap) then match[1] else "(#action())"
[patternString, "$$ = #action;", options]
action = if match = (action + '').match(unwrap) then match[1] else "(#{action}())"
[patternString, "$$ = #{action};", options]
# Grammatical Rules
# -----------------