@@ -61,8 +61,8 @@ int Stream::peekNextDigit(LookaheadMode lookahead, bool detectDecimal)
61
61
62
62
if ( c < 0 ||
63
63
c == ' -' ||
64
- c >= ' 0' && c <= ' 9' ||
65
- detectDecimal && c == ' .' ) return c;
64
+ ( c >= ' 0' && c <= ' 9' ) ||
65
+ ( detectDecimal && c == ' .' ) ) return c;
66
66
67
67
switch ( lookahead ){
68
68
case SKIP_NONE: return -1 ; // Fail code.
@@ -74,6 +74,8 @@ int Stream::peekNextDigit(LookaheadMode lookahead, bool detectDecimal)
74
74
case ' \n ' : break ;
75
75
default : return -1 ; // Fail code.
76
76
}
77
+ case SKIP_ALL:
78
+ break ;
77
79
}
78
80
read (); // discard non-numeric
79
81
}
@@ -138,7 +140,7 @@ long Stream::parseInt(LookaheadMode lookahead, char ignore)
138
140
139
141
do {
140
142
if (c == ignore)
141
- ; // ignore this charactor
143
+ ; // ignore this character
142
144
else if (c == ' -' )
143
145
isNegative = true ;
144
146
else if (c >= ' 0' && c <= ' 9' ) // is c a digit?
@@ -159,7 +161,7 @@ float Stream::parseFloat(LookaheadMode lookahead, char ignore)
159
161
bool isNegative = false ;
160
162
bool isFraction = false ;
161
163
long value = 0 ;
162
- char c;
164
+ int c;
163
165
float fraction = 1.0 ;
164
166
165
167
c = peekNextDigit (lookahead, true );
@@ -182,7 +184,7 @@ float Stream::parseFloat(LookaheadMode lookahead, char ignore)
182
184
read (); // consume the character we got with peek
183
185
c = timedPeek ();
184
186
}
185
- while ( (c >= ' 0' && c <= ' 9' ) || c == ' .' && !isFraction || c == ignore );
187
+ while ( (c >= ' 0' && c <= ' 9' ) || ( c == ' .' && !isFraction) || c == ignore );
186
188
187
189
if (isNegative)
188
190
value = -value;
0 commit comments