@@ -1876,14 +1876,21 @@ function fmtty_of_formatting_gen(formatting_gen) {
1876
1876
function fmtty_of_fmt ( _fmtty ) {
1877
1877
while ( true ) {
1878
1878
var fmtty = _fmtty ;
1879
+ var exit = 0 ;
1879
1880
if ( typeof fmtty === "number" ) {
1880
- return /* End_of_fmtty */ 0 ;
1881
+ if ( fmtty ) {
1882
+ return /* Char_ty */ Block . __ ( 0 , [ fmtty_of_fmt ( fmtty [ 0 ] ) ] ) ;
1883
+ }
1884
+ else {
1885
+ return /* End_of_fmtty */ 0 ;
1886
+ }
1881
1887
}
1882
1888
else {
1883
1889
switch ( fmtty . tag | 0 ) {
1884
1890
case 2 :
1885
1891
case 3 :
1886
- return fmtty_of_padding_fmtty ( fmtty [ 0 ] , /* String_ty */ Block . __ ( 1 , [ fmtty_of_fmt ( fmtty [ 1 ] ) ] ) ) ;
1892
+ exit = 1 ;
1893
+ break ;
1887
1894
case 4 :
1888
1895
var ty_rest = fmtty_of_fmt ( fmtty [ 3 ] ) ;
1889
1896
var prec_ty = fmtty_of_precision_fmtty ( fmtty [ 2 ] , /* Int_ty */ Block . __ ( 2 , [ ty_rest ] ) ) ;
@@ -1938,48 +1945,33 @@ function fmtty_of_fmt(_fmtty) {
1938
1945
return /* String_ty */ Block . __ ( 1 , [ fmtty_of_fmt ( fmtty [ 2 ] ) ] ) ;
1939
1946
case 21 :
1940
1947
return /* Int_ty */ Block . __ ( 2 , [ fmtty_of_fmt ( fmtty [ 1 ] ) ] ) ;
1941
- case 0 :
1942
- case 1 :
1943
- case 22 :
1944
- return /* Char_ty */ Block . __ ( 0 , [ fmtty_of_fmt ( fmtty [ 0 ] ) ] ) ;
1945
1948
case 23 :
1946
1949
var ign = fmtty [ 0 ] ;
1947
1950
var fmt = fmtty [ 1 ] ;
1948
1951
if ( typeof ign === "number" ) {
1949
- switch ( ign ) {
1950
- case 3 :
1951
- return /* Ignored_reader_ty */ Block . __ ( 14 , [ fmtty_of_fmt ( fmt ) ] ) ;
1952
- case 0 :
1953
- case 1 :
1954
- case 2 :
1955
- case 4 :
1956
- return fmtty_of_fmt ( fmt ) ;
1957
-
1952
+ if ( ign === 3 ) {
1953
+ return /* Ignored_reader_ty */ Block . __ ( 14 , [ fmtty_of_fmt ( fmt ) ] ) ;
1958
1954
}
1955
+ else {
1956
+ return fmtty_of_fmt ( fmt ) ;
1957
+ }
1958
+ }
1959
+ else if ( ign . tag === 8 ) {
1960
+ return CamlinternalFormatBasics . concat_fmtty ( ign [ 1 ] , fmtty_of_fmt ( fmt ) ) ;
1959
1961
}
1960
1962
else {
1961
- switch ( ign . tag | 0 ) {
1962
- case 8 :
1963
- return CamlinternalFormatBasics . concat_fmtty ( ign [ 1 ] , fmtty_of_fmt ( fmt ) ) ;
1964
- case 0 :
1965
- case 1 :
1966
- case 2 :
1967
- case 3 :
1968
- case 4 :
1969
- case 5 :
1970
- case 6 :
1971
- case 7 :
1972
- case 9 :
1973
- case 10 :
1974
- return fmtty_of_fmt ( fmt ) ;
1975
-
1976
- }
1963
+ return fmtty_of_fmt ( fmt ) ;
1977
1964
}
1978
1965
case 24 :
1979
1966
return fmtty_of_custom ( fmtty [ 0 ] , fmtty_of_fmt ( fmtty [ 2 ] ) ) ;
1980
-
1967
+ default :
1968
+ return /* Char_ty */ Block . __ ( 0 , [ fmtty_of_fmt ( fmtty [ 0 ] ) ] ) ;
1981
1969
}
1982
1970
}
1971
+ if ( exit === 1 ) {
1972
+ return fmtty_of_padding_fmtty ( fmtty [ 0 ] , /* String_ty */ Block . __ ( 1 , [ fmtty_of_fmt ( fmtty [ 1 ] ) ] ) ) ;
1973
+ }
1974
+
1983
1975
} ;
1984
1976
}
1985
1977
@@ -2495,31 +2487,26 @@ function type_format_gen(fmt, fmtty) {
2495
2487
var fmt$1 = fmt [ 1 ] ;
2496
2488
var fmtty$1 = fmtty ;
2497
2489
if ( typeof ign === "number" ) {
2498
- switch ( ign ) {
2499
- case 3 :
2500
- if ( typeof fmtty$1 === "number" ) {
2501
- throw Type_mismatch ;
2502
- }
2503
- else if ( fmtty$1 . tag === 14 ) {
2504
- var match$41 = type_format_gen ( fmt$1 , fmtty$1 [ 0 ] ) ;
2505
- return /* Fmt_fmtty_EBB */ [
2506
- /* Ignored_param */ Block . __ ( 23 , [
2507
- /* Ignored_reader */ 3 ,
2508
- match$41 [ 0 ]
2509
- ] ) ,
2510
- match$41 [ 1 ]
2511
- ] ;
2512
- }
2513
- else {
2514
- throw Type_mismatch ;
2515
- }
2516
- break ;
2517
- case 0 :
2518
- case 1 :
2519
- case 2 :
2520
- case 4 :
2521
- return type_ignored_param_one ( ign , fmt$1 , fmtty$1 ) ;
2522
-
2490
+ if ( ign === 3 ) {
2491
+ if ( typeof fmtty$1 === "number" ) {
2492
+ throw Type_mismatch ;
2493
+ }
2494
+ else if ( fmtty$1 . tag === 14 ) {
2495
+ var match$41 = type_format_gen ( fmt$1 , fmtty$1 [ 0 ] ) ;
2496
+ return /* Fmt_fmtty_EBB */ [
2497
+ /* Ignored_param */ Block . __ ( 23 , [
2498
+ /* Ignored_reader */ 3 ,
2499
+ match$41 [ 0 ]
2500
+ ] ) ,
2501
+ match$41 [ 1 ]
2502
+ ] ;
2503
+ }
2504
+ else {
2505
+ throw Type_mismatch ;
2506
+ }
2507
+ }
2508
+ else {
2509
+ return type_ignored_param_one ( ign , fmt$1 , fmtty$1 ) ;
2523
2510
}
2524
2511
}
2525
2512
else {
@@ -2542,17 +2529,8 @@ function type_format_gen(fmt, fmtty) {
2542
2529
] ) ,
2543
2530
match$43 [ 1 ]
2544
2531
] ;
2545
- case 0 :
2546
- case 1 :
2547
- case 2 :
2548
- case 3 :
2549
- case 4 :
2550
- case 5 :
2551
- case 6 :
2552
- case 9 :
2553
- case 10 :
2554
- return type_ignored_param_one ( ign , fmt$1 , fmtty$1 ) ;
2555
-
2532
+ default :
2533
+ return type_ignored_param_one ( ign , fmt$1 , fmtty$1 ) ;
2556
2534
}
2557
2535
}
2558
2536
case 22 :
@@ -2830,12 +2808,12 @@ function fix_padding(padty, width, str) {
2830
2808
var len = str . length ;
2831
2809
var match_000 = Pervasives . abs ( width ) ;
2832
2810
var match_001 = width < 0 ? /* Left */ 0 : padty ;
2833
- var padty$1 = match_001 ;
2834
2811
var width$1 = match_000 ;
2835
2812
if ( width$1 <= len ) {
2836
2813
return str ;
2837
2814
}
2838
2815
else {
2816
+ var padty$1 = match_001 ;
2839
2817
var res = Bytes . make ( width$1 , padty$1 === /* Zeros */ 2 ? /* "0" */ 48 : /* " " */ 32 ) ;
2840
2818
switch ( padty$1 ) {
2841
2819
case 0 :
@@ -3569,41 +3547,25 @@ function make_printf(_k, o, _acc, _fmt) {
3569
3547
var ign = fmt [ 0 ] ;
3570
3548
var fmt$2 = fmt [ 1 ] ;
3571
3549
if ( typeof ign === "number" ) {
3572
- switch ( ign ) {
3573
- case 3 :
3574
- throw [
3575
- Caml_builtin_exceptions . assert_failure ,
3576
- [
3577
- "camlinternalFormat.ml" ,
3578
- 1517 ,
3579
- 39
3580
- ]
3581
- ] ;
3582
- case 0 :
3583
- case 1 :
3584
- case 2 :
3585
- case 4 :
3586
- return make_invalid_arg ( k$2 , o$2 , acc$2 , fmt$2 ) ;
3587
-
3550
+ if ( ign === 3 ) {
3551
+ throw [
3552
+ Caml_builtin_exceptions . assert_failure ,
3553
+ [
3554
+ "camlinternalFormat.ml" ,
3555
+ 1517 ,
3556
+ 39
3557
+ ]
3558
+ ] ;
3559
+ }
3560
+ else {
3561
+ return make_invalid_arg ( k$2 , o$2 , acc$2 , fmt$2 ) ;
3588
3562
}
3589
3563
}
3564
+ else if ( ign . tag === 8 ) {
3565
+ return make_from_fmtty ( k$2 , o$2 , acc$2 , ign [ 1 ] , fmt$2 ) ;
3566
+ }
3590
3567
else {
3591
- switch ( ign . tag | 0 ) {
3592
- case 8 :
3593
- return make_from_fmtty ( k$2 , o$2 , acc$2 , ign [ 1 ] , fmt$2 ) ;
3594
- case 0 :
3595
- case 1 :
3596
- case 2 :
3597
- case 3 :
3598
- case 4 :
3599
- case 5 :
3600
- case 6 :
3601
- case 7 :
3602
- case 9 :
3603
- case 10 :
3604
- return make_invalid_arg ( k$2 , o$2 , acc$2 , fmt$2 ) ;
3605
-
3606
- }
3568
+ return make_invalid_arg ( k$2 , o$2 , acc$2 , fmt$2 ) ;
3607
3569
}
3608
3570
case 24 :
3609
3571
return make_custom ( k , o , acc , fmt [ 2 ] , fmt [ 0 ] , Curry . _1 ( fmt [ 1 ] , /* () */ 0 ) ) ;
0 commit comments