0

I'm trying to use Opal to convert ruby code to javascript. At first, it looked pretty promising, but it just doesn't work with my class. I get the below error which does not make sense to me:

SyntaxError: An error occurred while compiling: (file)

unexpected '"kEND"'
Source: (file):1:7718

Here is the gist link to the ruby file I'm trying to convert to javascript: query_builder.rb

This compiles in my ruby interpreter just fine. I'm not sure if opal is using an incompatible version of ruby or what the deal is. But my code is pretty standard ruby. Any help would be greatly appreciated. Thank you in advance.

5
  • hmmm. Could you send me the shortlink to that? It still doesn't work for me. Commented Oct 5, 2015 at 19:39
  • I tried this on a friends chrome browser as well. That doesnt work either. Commented Oct 5, 2015 at 19:45
  • Sorry, it seems I was wrong. Going to delete my comment. Commented Oct 5, 2015 at 19:49
  • Aww man I got excited for a sec. Thanks anyway. Commented Oct 5, 2015 at 19:58
  • 1
    Found the issue. This time I'm sure! Commented Oct 5, 2015 at 20:04

1 Answer 1

1

The linked code uses hard tabs instead of the usual two spaces for indententation. According to this GitHub issue tabs seem to be an issue for Opal. So replace them with your favorite text editor and it'll compile.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.