From 48b50cb4febc37120a6026dc95a4a868360048eb Mon Sep 17 00:00:00 2001 From: Alexandr Opak Date: Fri, 29 Jan 2021 13:04:37 +0100 Subject: [ruby/psych] fix parsing integer values with '_' at the end https://github.com/ruby/psych/commit/e0bb853014 --- ext/psych/lib/psych/scalar_scanner.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ext/psych/lib') diff --git a/ext/psych/lib/psych/scalar_scanner.rb b/ext/psych/lib/psych/scalar_scanner.rb index 01f7a2ef1c..eecd46ebe8 100644 --- a/ext/psych/lib/psych/scalar_scanner.rb +++ b/ext/psych/lib/psych/scalar_scanner.rb @@ -13,10 +13,10 @@ module Psych FLOAT = /^(?:[-+]?([0-9][0-9_,]*)?\.[0-9]*([eE][-+][0-9]+)?(?# base 10))$/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) + |[-+]?(?:\d|[1-9][0-9_,]*[^_]) (?# base 10) + |[-+]?0x[0-9a-fA-F_,]+ (?# base 16))$/x attr_reader :class_loader -- cgit v1.2.3