Skip to content

Conversation

@calleluks
Copy link
Contributor

For reasons I don't know, token_stream sometimes contain nil elements.
This is handled in RDoc::TokenStream.to_html but not in
RDoc::TokenStream#tokens_to_s. This adds handling to
RDoc::TokenStream#tokens_to_s.

For reasons I don't know, `token_stream` sometimes contain `nil` elements.
This is handled in `RDoc::TokenStream.to_html` but not in
`RDoc::TokenStream#tokens_to_s`. This adds handling to
`RDoc::TokenStream#tokens_to_s`.
@drbrain drbrain added the bug label Sep 10, 2014
@drbrain drbrain added this to the 4.2 milestone Sep 10, 2014
@drbrain
Copy link
Member

drbrain commented Sep 10, 2014

Do you have any source files this occurs for?

@drbrain
Copy link
Member

drbrain commented Sep 10, 2014

… I'll commit this, but if you have such a file maybe I can find a better fix for it.

drbrain added a commit that referenced this pull request Sep 10, 2014
Skip nil tokens in RDoc::TokenStream#tokens_to_s.
@drbrain drbrain merged commit 3a101ca into ruby:master Sep 10, 2014
drbrain added a commit that referenced this pull request Sep 10, 2014
@calleluks
Copy link
Contributor Author

Currently I do not. I will try to reproduce the errors I was seeing and give you one.

@calleluks
Copy link
Contributor Author

@drbrain I've been able to figure out what is making it fail. It is a migration template inside of thoughtbot/clearance that mixes ruby and erb inside a .rb source file. I've been able to reduce the source to the following minimum failing example:

def a_method
<% whatever -%>
end

One interesting point is that if the dash at the end of the erb tag is removed, it no longer fails:

def a_method
<% whatever %>
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants