token method
Implementation
Parser token(Object source, [String? message]) {
if (source is String) {
return source
.toParser(message: 'Expected ${message ?? source}')
.token()
.trim(ref0(spacer));
} else if (source is Parser) {
ArgumentError.checkNotNull(message, 'message');
return source.flatten('Expected $message').token().trim(ref0(spacer));
} else {
throw ArgumentError('Unknown token type: $source.');
}
}