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. |