Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions WTReTextField/WTReParser.m
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,16 @@ - (NSString*)displayQuantifier
} else if (_countTo == 1) {
pat = @"?";
} else {
pat = [NSString stringWithFormat:@"{,%u}", _countTo];
pat = [NSString stringWithFormat:@"{,%tu}", _countTo];
}
} else if (_countFrom == 1 && _countTo == NSUIntegerMax) {
pat = @"+";
} else if (_countFrom == _countTo) {
pat = [NSString stringWithFormat:@"{%u}", _countFrom];
pat = [NSString stringWithFormat:@"{%tu}", _countFrom];
} else if (_countTo == NSUIntegerMax) {
pat = [NSString stringWithFormat:@"{%u,}", _countFrom];
pat = [NSString stringWithFormat:@"{%tu,}", _countFrom];
} else {
pat = [NSString stringWithFormat:@"{%u,%u}", _countFrom, _countTo];
pat = [NSString stringWithFormat:@"{%tu,%tu}", _countFrom, _countTo];
}

if (_greedy) return pat;
Expand Down Expand Up @@ -508,7 +508,7 @@ - (BOOL)isValidEscapedChar:(unichar)c inCharset:(BOOL)inCharset
- (void)raiseParserError:(NSString*)error atPos:(NSUInteger)pos
{
NSString *pat = [NSString stringWithFormat:@"%@ \u25B6%@", [_pattern substringToIndex:pos], [_pattern substringFromIndex:pos]];
@throw [NSException exceptionWithName:@"Parse error" reason:[NSString stringWithFormat:@"%@ @ pos %d: %@", error, pos, pat] userInfo:nil];
@throw [NSException exceptionWithName:@"Parse error" reason:[NSString stringWithFormat:@"%@ @ pos %zd: %@", error, pos, pat] userInfo:nil];
}

- (WTReCharacterBase*)parseCharset:(NSString*)pattern inRange:(NSRange)range enclosed:(BOOL)enclosed
Expand Down