Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Line Break / Indentation Error in Windows #29

Open
bmarcaur opened this Issue · 15 comments

9 participants

@bmarcaur

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.

@rayshih

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)

@rayshih

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

@saulomendonca

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

Experiencing the same issue

@TravisBenning

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.

@bmarcaur

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

@TravisBenning

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

@bmarcaur

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

@petersonfs

@bmarcaur The problem persist. Any solution?

@bmarcaur

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

@petersonfs

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

@bmarcaur

@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

node.js worked for my win7 x64.

@saturday

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.