Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle JSON-style hash key as symbol #467

Merged
merged 5 commits into from
Aug 1, 2017

Conversation

aycabta
Copy link
Member

@aycabta aycabta commented Jul 23, 2017

RDoc handles the JSON-style hash key as identifier and operator :, like below:

separated identifer and :

<pre class="ruby">
{ <span class="ruby-identifier">hiee</span><span class="ruby-operator">:</span> <span class="ruby-value">:aaaa</span> }
{ <span class="ruby-identifier">class</span><span class="ruby-operator">:</span> <span class="ruby-value">:aaaa</span> }
</pre>

I think the hash key is a symbol. This Pull Request fixes it like below:

JSON-style hash key is a symbol

<pre class="ruby">
{ <span class="ruby-value">hiee:</span> <span class="ruby-value">:aaaa</span> }
{ <span class="ruby-value">class:</span> <span class="ruby-value">:aaaa</span> }
</pre>

@hsbt
Copy link
Member

hsbt commented Aug 1, 2017

I understand this pull request and expected the behavior.

Original test of { class:"foo" } tokenize was strange expectation for me. Your fixed expectation is reasonable.

@hsbt hsbt merged commit 53f146a into ruby:master Aug 1, 2017
@aycabta aycabta deleted the handle-json-style-hask-key-as-symbol branch August 1, 2017 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants