Bugs: Browse | Submit New | Admin

[#8498] Rubydoc comment causes infinite loop!

Date:
2007-02-08 08:28
Priority:
3
Submitted By:
Zoltan Csoma (zoltan)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
Rubydoc comment causes infinite loop!

Detailed description
If a rdoc comment contains any character between the closing =end and the end of that line, Syntax enters in infinite
loop.

Example input file:

=begin rdoc
  Text of rdoc here
=end someextratext
class Any 
...


Suggested patch for this issue:

     def step
       case
         when bol? && check( /=begin/ )
-          start_group( :comment, scan_until( /^=end#{EOL}/ ) )
+          start_group( :comment, scan_until( /^=end.*#{EOL}/ ) )
         when bol? && check( /__END__#{EOL}/ )
           start_group( :comment, scan_until( /\Z/ ) )
       else


Please consider rewriting this "step" procedure or its caller to avoid the infinite loops in such cases.

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item