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

Updated the RegExp to catch Strings earlier in the tokenization process. #90

Merged
merged 1 commit into from Oct 2, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/psych/scalar_scanner.rb
Expand Up @@ -24,7 +24,9 @@ def tokenize string
return string if @string_cache.key?(string)

case string
when /^[A-Za-z_~]/
# Check for a String type, being careful not to get caught by hash keys, hex values, and
# special floats (e.g., -.inf).
when /^[^\d\.:-]?[A-Za-z_\s!@#\$%\^&\*\(\)\{\}\<\>\|\/\\~;=]+/
if string.length > 5
@string_cache[string] = true
return string
Expand Down