Skip to content
This repository

Line Break / Indentation Error in Windows #29

Open
bmarcaur opened this Issue August 22, 2011 · 15 comments

9 participants

Brandon Marc-Aurele Ray Shih Saulo Mendonça thyforhtian arjes Travis Peterson Ferreira ewinds Mike Borg
Brandon Marc-Aurele

Due to some restrictions on my current project I am forced to develop in a windows environment, this being said I have come across a windows specific parsing issue. When I run Eco.compile(File.read ("ANY FILE WITH A CONTROL STRUCTURE") ) I get an unexpected indent error, when I run this same command on my mac it compiles properly. The only control structure that doesn't error out is an if statement without an else statement. I am guessing that this is an issue with the windows line breaks causing the parser to improperly indent, but this is only a guess.

Ray Shih

seem that I have the same problem. I'm currently use spinejs and rails, when it come to windows, then the error message occured.
Error: Parse error on line 2: Unexpected 'INDENT'
(in {Rails_root}/app/assets/javascripts/admin/views/dashboard/contacts.jst.eco)

Ray Shih

And I found that it only occur while using block statement like
<% for a in b: %>
<% end %>

Saulo Mendonça

I have the same problem using block statement
<% for a in b: %>
<% end %>
in Windows seven

thyforhtian

I can confirm the problem exists on Windows. Works fine on Linux.

arjes
arjes commented March 13, 2012

Experiencing the same issue

Travis

Anyone have ideas on a work around / fix? Works fine on my Mac and Linux boxes but not Windows (XP or 7).
Compiler issue? https://github.com/sstephenson/eco/blob/master/lib/compiler.js [line 15?]
Preprocessor? https://github.com/sstephenson/eco/blob/master/lib/preprocessor.js [lines 63-71?]
Util? https://github.com/sstephenson/eco/blob/master/lib/util.js [lines 8-23? maybe due to the way Windows handles end-of-line termination]

Just a few thoughts. Maybe I'm way off but I'd like to help resolve this.

Brandon Marc-Aurele

Hey guys,

This issue is being caused by a poorly implemented windows javascript compiler. To solve it simply install node and add it to your path. This will stop Eco from falling back on to 'wscript' (I think that is the name) and node handles and compiles Eco templates just fine.

Hope this helps

Travis

@bmarcaur Thanks for the suggestion. I'll try that out.

Brandon Marc-Aurele

@TravisBenning No problem, I hope this solves everyones problems.

Peterson Ferreira

@bmarcaur The problem persist. Any solution?

Brandon Marc-Aurele

@petersonfs My suggestion above is what worked for me, so I haven't tried anything else.

Peterson Ferreira

It doesn't work for me. I'm running windows 7 x64.

Brandon Marc-Aurele

@petersonfs My environment was win7 x64 as well, I'm sorry this was part of an old project so I haven't needed to work on any other solutions.

ewinds
ewinds commented June 06, 2013

node.js worked for my win7 x64.

Mike Borg

I have this same problem; however I'm on OSX and I have node installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.