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.
Summary: | Some code chunks destroy formatting for whole file | ||
---|---|---|---|
Product: | ruby | Reporter: | Martin Krauskopf <mkrauskopf> |
Component: | Code | Assignee: | Torbjorn Norbye <tor> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | ||
Priority: | P2 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
Martin Krauskopf
2007-03-11 17:35:33 UTC
I took a quick peek at this testcase with a debugger, and this is not a formatter bug; the problem is in the lexer (bracket matching is also broken for example). Without the comment there, the lexer correctly identifies the "unless" token as kUNLESS, whereas with the comment, it returns kUNLESS_MOD (that is, it thinks the unless is a modifier which means that it does not consume a corresponding end.). The formatter uses the lexer tokens to control identation. I've gotta debug this to see why the comment trips up the lexer. Here's another test case posted to dev@jruby by Uwe Hartl: class Bluff def blub return true if (false) # if (true) p "test" end end end tt = Bluff.new tt.blub This is fixed (in Ruby feature module level 0.40). Reassigning this issue to newly created 'ruby' component. Changing target milestone of all resolved Ruby issues from TBD to 6.0 Beta 1 build. |