malgorithms / toffee

a NodeJS and browser templating language based on coffeescript, with the slickest syntax ever
MIT License
174 stars 10 forks source link

Unexpected 'INDENT' #18

Closed ellisonch closed 11 years ago

ellisonch commented 11 years ago

Hey Chris!

I'm trying to build and play with toffee, but I'm getting the following problem when trying to run what I cloned from git:

chucky@chucky-pc:~/work/toffee$ cake test path.existsSync is now called fs.existsSync. toffee err: ERROR toffee err: ===== toffee err: /home/chucky/work/toffee/test/cases/include_recursion/input.toffee: Parse error between lines 1 and 2: Unexpected 'INDENT' toffee err:

ERROR

/home/chucky/work/toffee/test/cases/include_recursion/input.toffee: Parse error between lines 1 and 2: Unexpected 'INDENT'

cake build seems to work correctly, and I installed all the modules it was complaining about. However, I get the above error even after wiping and recloning. I also ran npm update, but that doesn't help. Any ideas?

chucky@chucky-pc:~/work/toffee$ npm --version 1.1.65 chucky@chucky-pc:~/work/toffee$ node --version v0.8.14

malgorithms commented 11 years ago

Hey @ellisonch hmm, that is very weird. I have a newer version of node (v0.8.21) but that test has worked since way before 0.8.14.

Can you just do a git status is your checkout to make sure you haven't actually touched any of toffee's code or the test file itself?

And also check that your coffeescript isn't like a zillion years old. It's likely using your globally installed coffee-script.

ellisonch commented 11 years ago

I had some generated files that had been modified, so I did a reset. Then, with a clean git status, running cake build cake test still fails in the same way.

Running cake build changes the following files:

#   modified:   index.js
#   modified:   lib/command_line.js
#   modified:   lib/consts.js
#   modified:   lib/engine.js
#   modified:   lib/errorHandler.js
#   modified:   lib/pool.js
#   modified:   lib/toffee_lang.js
#   modified:   lib/utils.js
#   modified:   lib/view.js
#   modified:   test/express3/public/javascripts/test_cases.js
#   modified:   test/express3/views/index.toffee

Mostly with things like this, though there are some more serious differences: -// Generated by CoffeeScript 1.4.0 +// Generated by CoffeeScript 1.6.2

I have coffee-script@1.6.2. Should I downgrade?

malgorithms commented 11 years ago

Thanks, I think this is a legit bug on my end - something not working with the latest version of Coffee. On it right now...if it's an emergency, you can use coffee 1.4.0. Otherwise hang in there. Will have an update here shortly.

malgorithms commented 11 years ago

Hey @ellisonch , holy crap, I think I have it fixed. Can you check and let me know? I also bumped to version 0.1.0, which someone requested I do recently.

-cc

ellisonch commented 11 years ago

It's still broken for me. I recloned directly from your repo and everything.

chucky@chucky-pc:~/work/toffee$ cake test
path.existsSync is now called `fs.existsSync`.
2
toffee err: ERROR
toffee err: =====
toffee err: /home/chucky/work/toffee/test/cases/include_recursion/input.toffee: Parse error between lines 1 and 2: Unexpected 'INDENT'
toffee err: 
ERROR
=====
/home/chucky/work/toffee/test/cases/include_recursion/input.toffee: Parse error between lines 1 and 2: Unexpected 'INDENT'
malgorithms commented 11 years ago

hmm, ok, that's weird. I've now checked on 2 machines.

Let's do a comparison, just to see if we have any other differences.

First, do this to clean out old crap and make sure you're up to date.

cd <toffee_dir>
rm -rf node_modules/    # just cleans out locally installed node modules
npm install -d               # install dev dependencies for toffee
npm install -g toffee      # install the latest  toffee globally

Then try these and let's see what we see:

~ >toffee --version
0.1.0

~ >coffee --version
CoffeeScript version 1.6.2

Finally:

> cake build
> cake test

Let me know if our versions of toffee/coffee match and if cleaning things helped at all.

ellisonch commented 11 years ago

I followed your instructions. Our toffee and coffee match, but I get the same error as before. I even tried it on a fresh clone again. Could it be the node version? I'm on 0.8.14.

malgorithms commented 11 years ago

ok, @ellisonch one more try? I think I have fixed it, finally, despite a whiskey sour, 2 beers, and a bloody mary.

You should also have toffee version 0.1.1 as a result.

ellisonch commented 11 years ago

I think the alcohol helped---it appears to be working now! All tests pass. Thanks!

malgorithms commented 11 years ago

Great! Closing.