You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. I'd like to submit back a small modification to pattern.rb in the json/next gem.
When I was using JSONX.parse I kept getting this warning:
/var/lib/gems/2.3.0/gems/json-next-1.2.1/lib/json/next/parser/jsonx.rb: warning: character class has duplicated range
/var/lib/gems/2.3.0/gems/json-next-1.2.1/lib/json/next/parser/jsonx.rb:77: warning: character class has duplicated range
That warning is pointing out that in regular expressions, \w already covers _, so you don't need to have both in the pattern. Personally, it seems silly to make a whole warning about that - a little regex redundancy is hardly worth taking up anybody's time. But warnings can be annoying. I edited pattern.rb so that the three instances of this:
\\w_
are changed to just this:
\\w
That made the warning go away. Of course, I don't know if it will make other warnings or errors appear. But hopefully this can fix this small problem.
:-)
Miko
The text was updated successfully, but these errors were encountered:
Hi. I'd like to submit back a small modification to pattern.rb in the json/next gem.
When I was using JSONX.parse I kept getting this warning:
That warning is pointing out that in regular expressions, \w already covers _, so you don't need to have both in the pattern. Personally, it seems silly to make a whole warning about that - a little regex redundancy is hardly worth taking up anybody's time. But warnings can be annoying. I edited pattern.rb so that the three instances of this:
\\w_
are changed to just this:
\\w
That made the warning go away. Of course, I don't know if it will make other warnings or errors appear. But hopefully this can fix this small problem.
:-)
Miko
The text was updated successfully, but these errors were encountered: