This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 166956 - Heredocs cause problems if extra newline not given
Summary: Heredocs cause problems if extra newline not given
Status: RESOLVED DUPLICATE of bug 166713
Alias: None
Product: ruby
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: Macintosh Mac OS X
: P3 blocker (vote)
Assignee: Erno Mononen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-12 01:44 UTC by loganbarnett
Modified: 2009-06-12 15:27 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
fixed jruby-parser (1.40 MB, application/octet-stream)
2009-06-12 06:30 UTC, Erno Mononen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description loganbarnett 2009-06-12 01:44:00 UTC
Heredocs cause parsing errors (underlined lines) if anything happens immediately after the heredoc. Adding a redundant newline seems to fix the problem. 
Both versions work fine against the JRuby parser (outside of Netbeans).

This is using 6.7 RC2

Here is a snippet that produces the error. You can view the full version here, on line 45: 
http://kenai.com/projects/gemini/sources/mainline/content/src/behavior.rb?rev=aafa5302793cb0512282bee466722f9e6a5473ae

code = <<-ENDL
            def #{method}(#{args})
              raise Gemini::InvalidWrapWithCallbacksError.new("Cannot wrap #{method} with callbacks without \\"#{method_name}\\"") unless respond_to?
(:#{method_name})
              event = ValueChangedEvent.new(@target.#{method_name}, #{args})
              callback_abort = CallbackStatus.new
              @target.notify :before_#{method_name}_changes, event
              if callback_abort.continue?              
                self.wrapped_#{method}(#{args})
                @target.notify :after_#{method_name}_changes, event
              end
            end
          ENDL
          wrapped_methods << "before_#{method_name}_changes"
Comment 1 Erno Mononen 2009-06-12 06:28:40 UTC
This was fixed just yesterday, unfortunately too late for 6.7. If you don't want to use a daily build, you can just 
copy the attached jruby-parser-0.1.jar to <nb_install_dir>/ruby2/modules/ext (you need to restart the IDE then). It 
should be a pretty safe patch.
Comment 2 Erno Mononen 2009-06-12 06:30:24 UTC
Created attachment 83476 [details]
fixed jruby-parser
Comment 3 Erno Mononen 2009-06-12 06:31:59 UTC

*** This issue has been marked as a duplicate of 166713 ***
Comment 4 loganbarnett 2009-06-12 15:14:22 UTC
Sorry for the duplicate. I tried searching for 'heredoc' in both search fields but didn't come up with anything that was for Ruby. Is there a better means of 
searching I should use?

Here's where I've checked for duplicates before: http://www.netbeans.org/community/issues.html
Comment 5 Erno Mononen 2009-06-12 15:27:42 UTC
No worries, the search functionality in IZ isn't terribly usable. #166713 probably didn't show up since it was already 
closed and http://www.netbeans.org/community/issues.html searches only for open issues. You'd have to use the "advanced 
search" functionality to see also closed issues.