@@ -551,7 +551,7 @@ export function isCaseIgnorable(c: u32): bool {
551
551
552
552
// @ts -ignore: decorator
553
553
@inline
554
- export function isFinalSigma ( buffer : usize , index : i32 , len : i32 ) : bool {
554
+ export function isFinalSigma ( buffer : usize , index : isize , len : isize ) : bool {
555
555
const lookaheadLimit = 30 ; // max lookahead limit
556
556
var found = false ;
557
557
var pos = index ;
@@ -565,34 +565,34 @@ export function isFinalSigma(buffer: usize, index: i32, len: i32): bool {
565
565
return false ;
566
566
}
567
567
}
568
- pos -= i32 ( c >= 0x10000 ) + 1 ;
568
+ pos -= isize ( c >= 0x10000 ) + 1 ;
569
569
}
570
570
if ( ! found ) return false ;
571
571
pos = index + 1 ;
572
572
var maxPos = min ( pos + lookaheadLimit , len ) ;
573
573
while ( pos < maxPos ) {
574
- let c = < u32 > load < u16 > ( buffer + ( < usize > pos << 1 ) ) ;
574
+ let c = < u32 > load < u16 > ( buffer + ( pos << 1 ) ) ;
575
575
if ( u32 ( ( c & 0xFC00 ) == 0xD800 ) & u32 ( pos + 1 != len ) ) {
576
- let c1 = < u32 > load < u16 > ( buffer + ( < usize > pos << 1 ) , 2 ) ;
576
+ let c1 = < u32 > load < u16 > ( buffer + ( pos << 1 ) , 2 ) ;
577
577
if ( ( c1 & 0xFC00 ) == 0xDC00 ) {
578
578
c = ( c - 0xD800 << 10 ) + ( c1 - 0xDC00 ) + 0x10000 ;
579
579
}
580
580
}
581
581
if ( ! isCaseIgnorable ( c ) ) {
582
582
return ! isCased ( c ) ;
583
583
}
584
- pos += i32 ( c >= 0x10000 ) + 1 ;
584
+ pos += isize ( c >= 0x10000 ) + 1 ;
585
585
}
586
586
return true ;
587
587
}
588
588
589
589
// @ts -ignore: decorator
590
590
@inline
591
- function codePointBefore ( buffer : usize , index : i32 ) : i32 {
591
+ function codePointBefore ( buffer : usize , index : isize ) : i32 {
592
592
if ( index <= 0 ) return - 1 ;
593
- var c = < u32 > load < u16 > ( buffer + ( < usize > index - 1 << 1 ) ) ;
593
+ var c = < u32 > load < u16 > ( buffer + ( index - 1 << 1 ) ) ;
594
594
if ( u32 ( ( c & 0xFC00 ) == 0xDC00 ) & u32 ( index - 2 >= 0 ) ) {
595
- let c1 = < u32 > load < u16 > ( buffer + ( < usize > index - 2 << 1 ) ) ;
595
+ let c1 = < u32 > load < u16 > ( buffer + ( index - 2 << 1 ) ) ;
596
596
if ( ( c1 & 0xFC00 ) == 0xD800 ) {
597
597
return ( ( c1 & 0x3FF ) << 10 ) + ( c & 0x3FF ) + 0x10000 ;
598
598
}
0 commit comments