2

I've installed DLTK 2.0 on Eclipse Indigo running on Max OS X 10.7

I've added ruby 1.8.7 interpreter in eclipse preferences page for Ruby.

But when I create a ruby project using source of existing rails project, a lot of syntax errors are reported in problems view.

Here's a sample:

syntax error, unexpected tAMPER

Above error is reported at '&' character on second line below:

    keys.each do |key|
      define_method(key) do |&block|
        @configuration[key] = block
      end
    end

Searching for a solution to above problem I landed on a page that seems to suggest that DLTK uses JRuby internally. Could this problem be due to an older JRuby version bundled in DLTK?

Tahir Akhtar
  • 11,385
  • 7
  • 42
  • 69
  • Do you just get that error message in the Eclipse editor, but the program runs fine anyway? That's the case for me. – echristopherson May 19 '12 at 18:24
  • I've been searching for the answer but haven't found anything conclusive so far. The DLTK source is confusing me because it looks like there are both JRuby and custom parser classes. My guess is that whatever parser is used, it's really outdated. I can't find a way to drop in a more current parser, either. – echristopherson May 20 '12 at 19:59
  • The use of `|&block|` is unusual; in fact, I've never seen anyone use that in Ruby before. You might consider setting aside the DLTK parsing problem in favor of finding a clearer way to code what you're trying to code. – L2G Jul 31 '12 at 18:30
  • 2
    Any solutions for this - I'm getting a `syntax error, unexpected ':'` DLTK error for my Ruby project though it runs fine. Suspect the issue is the DLTK does not support Rails 1.9+ ?? I'm new to Rails so unsure - and really need the syntax highlighting to learn! – benedict_w Sep 21 '12 at 08:10
  • I can confirm eclipse is not handling ruby syntax 1.9 correctly:\ foo = { print: "something" } Should work fine but gives syntax errors in eclipse – HMR Nov 19 '12 at 01:56

0 Answers0