I encountered this on a large, complex piece of code at work that used =begin/=end followed by a regular comment. YARD tried to append one to the other and died with an exception. This pull request seems to fix it, as does adding a newline between =end and the next comment.
Here is the offending excerpt:
if( encodeParams['MuxFormat'].nil? )
raise "Must specify muxing format"
@muxFormats = @muxFormats + encodeParams['MuxFormat'] + ','
Don't crash when comment range is nil, such as at a comment after =be…
Properly handle embedded doc comments (=begin/=end)
FYI a379c8a has some test cases to ensure we get the right comment attached to the node. That part was actually unrelated to this embdoc bug, but this issue brought that problem to light.
Thanks for your patch, @noahgibbs, but it turns out checking range only hides the symptom, it doesn't solve the root of the problem, which was that embedded doc comments didn't have a range. This patch fixes that.
Ah, perfect. Thanks! I was having trouble building a test case that failed before and succeeded after my change, and that's probably why.