michaelficarra / CoffeeScriptRedux

:sweat: rewrite of the CoffeeScript compiler with proper compiler design principles and a focus on robustness and extensibility
https://michaelficarra.github.com/CoffeeScriptRedux/
BSD 3-Clause "New" or "Revised" License
1.85k stars 110 forks source link

Fails to compile valid coffee script (Unexpected Dedent) #180

Open thlorenz opened 11 years ago

thlorenz commented 11 years ago

The file compiles fine with the main coffee-script compiler, however fails to compile with coffee-script-redux.

Code

Part of my WegGLCraft fork inside this file

Error:

node_modules/coffee-script-redux/lib/coffee-script/module.js:74
        throw e;
              ^
Error: Unexpected DEDENT
242 :             grass_dirt]  #front
243 :         new THREE.CubeGeometry( @rad, @rad, @rad, 1, 1, 1, materials)
244 :
245 :     texture: (name) -> TextureHelper.loadTexture "./textures/#{name}.png"
^^^ :~~~~^
246 :
247 :     textures: (names...) -> return (@texture name for name in names)
248 :
    at Preprocessor.Preprocessor.err (/Users/thlorenz/dev/js/projects/_forks/WebGLCraft/node_modules/coffeeify/node_modules/coffee-script-redux/lib/coffee-script/preprocessor.js:40:11)
    at Preprocessor.Preprocessor.observe (/Users/thlorenz/dev/js/projects/_forks/WebGLCraft/node_modules/coffeeify/node_modules/coffee-script-redux/lib/coffee-script/preprocessor.js:85:14)
    at Preprocessor.processInput [as processData] (/Users/thlorenz/dev/js/projects/_forks/WebGLCraft/node_modules/coffeeify/node_modules/coffee-script-redux/lib/coffee-script/preprocessor.js:157:22)
    at Function.Preprocessor.Preprocessor.processSync (/Users/thlorenz/dev/js/projects/_forks/WebGLCraft/node_modules/coffeeify/node_modules/coffee-script-redux/lib/coffee-script/preprocessor.js:314:9)
    at Object.module.exports.parse (/Users/thlorenz/dev/js/projects/_forks/WebGLCraft/node_modules/coffeeify/node_modules/coffee-script-redux/lib/coffee-script/module.js:61:35)

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/825317-fails-to-compile-valid-coffee-script-unexpected-dedent?utm_campaign=plugin&utm_content=tracker%2F33145&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F33145&utm_medium=issues&utm_source=github).
wonk commented 11 years ago

ditto