diff options
author | Aaron Patterson <tenderlove@ruby-lang.org> | 2021-08-04 09:43:06 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-04 09:43:06 -0700 |
commit | 50fd106a657c4437f946cdd5044da39596f028ef (patch) | |
tree | cbbcfe257c37f6f592af29be998e5b2357ad0c2d /lib | |
parent | 0be49786edf40b9956da0693d112f770588424e4 (diff) | |
parent | 64cc239557d83058cde9af686900270fc173e105 (diff) | |
download | psych-50fd106a657c4437f946cdd5044da39596f028ef.tar.gz |
Merge pull request #473 from OpakAlex/fix-integer-parsing-for-yaml
fix parsing integer values with '_' at the end
Diffstat (limited to 'lib')
-rw-r--r-- | lib/psych/scalar_scanner.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/psych/scalar_scanner.rb b/lib/psych/scalar_scanner.rb index d565a33..37e9313 100644 --- a/lib/psych/scalar_scanner.rb +++ b/lib/psych/scalar_scanner.rb @@ -14,10 +14,10 @@ module Psych |\.(nan|NaN|NAN)(?# not a number))$/x # Taken from http://yaml.org/type/int.html - INTEGER = /^(?:[-+]?0b[0-1_,]+ (?# base 2) - |[-+]?0[0-7_,]+ (?# base 8) - |[-+]?(?:0|[1-9][0-9_,]*) (?# base 10) - |[-+]?0x[0-9a-fA-F_,]+ (?# base 16))$/x + INTEGER = /^(?:[-+]?0b[0-1_,]+ (?# base 2) + |[-+]?0[0-7_,]+ (?# base 8) + |[-+]?(?:0|[1-9](?:[0-9]|,[0-9]|_[0-9])*) (?# base 10) + |[-+]?0x[0-9a-fA-F_,]+ (?# base 16))$/x attr_reader :class_loader |