37 BOOL leadingSpace = allowSpaces,
47 if (
string ==
nil)
return NO;
49 count = [string length];
50 for (i = 0; i !=
count; ++i)
52 switch ([
string characterAtIndex:i])
66 if (trailingSpace)
FAIL(
"Digit after trailing whitespace");
67 if (!hadE) allowE = YES;
76 if (leadingSpace || trailingSpace)
break;
77 if (hadNumber && allowSpaces)
80 allowSign = allowE = allowDec = NO;
83 FAIL(
"Space in unpermitted position");
94 FAIL(
"Sign (+ or -) in unpermitted position");
104 FAIL(
"Sign (+ or -) in unpermitted position");
118 FAIL(
"E in unpermitted position");
121 FAIL (
"Unpermitted character");
125 if (hadE && !hadExp)
FAIL(
"E with no exponent");
126 if (!hadNumber)
FAIL(
"No digits in string");