File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 483483 (array.new_data $string $float_of_string (i32.const 0 ) (i32.const 15 )))
484484 (f64.const 0 ))
485485
486+ (func $on_whitespace (param $s (ref $string )) (param $i i32 ) (result i32 )
487+ (local $c i32 )
488+ (local.set $c (array.get_u $string (local.get $s ) (local.get $i )))
489+ (i32.or (i32.eq (local.get $c ) (i32.const 32 )) ;; ' '
490+ (i32.le_u (i32.sub (local.get $c ) (i32.const 9 )) (i32.const 4 ))))
491+
486492 (func (export " caml_float_of_string" ) (param (ref eq)) (result (ref eq))
487493 (local $s (ref $string )) (local $len i32 ) (local $i i32 ) (local $j i32 )
488494 (local $s' (ref $string ))
525531 (loop $skip_spaces
526532 (if (i32.lt_u (local.get $i ) (local.get $len ))
527533 (then
528- (if (i32.eq (i32.const 32 ) ;; ' '
529- (array.get_u $string (local.get $s ) (local.get $i )))
534+ (if (call $on_whitespace (local.get $s ) (local.get $i ))
530535 (then
531536 (local.set $i (i32.add (local.get $i ) (i32.const 1 )))
532537 (br $skip_spaces ))))))
533538 (block $error
534539 (br_if $error (i32.eq (local.get $i ) (local.get $len )))
540+ (br_if $error
541+ (call $on_whitespace
542+ (local.get $s ) (i32.sub (local.get $len ) (i32.const 1 ))))
535543 (local.set $c (array.get_u $string (local.get $s ) (i32.const 0 )))
536544 (if (i32.eq (local.get $c ) (i32.const 45 )) ;; '-'
537545 (then
You can’t perform that action at this time.
0 commit comments