paiq / blackcoffee

CoffeeScript + hygienic macros
MIT License
105 stars 9 forks source link

.subst() doesn't substitute the iterator variable in a for loop #8

Closed ngn closed 10 years ago

ngn commented 10 years ago

Example:

macro ->
  (macro.codeToNode ->
    for a in [0...10]
      console.info a
  ).subst a: macro.csToNode 'b'

compiles to

for (a = _i = 0; _i < 10; a = ++_i) {
  console.info(b);
}