parse_Content_Length method
dynamic
parse_Content_Length()
Implementation
dynamic parse_Content_Length() {
var $$;
switch (_ch >= 0 && _ch <= 57
? 0
: _ch == -1
? 2
: 1) {
case 0:
var startPos0 = _startPos;
_startPos = _cursor;
switch (_ch >= 0 && _ch <= 57
? 0
: _ch == -1
? 2
: 1) {
case 0:
var startPos1 = _startPos;
_startPos = _cursor;
var testing0;
for (var first = true, reps;;) {
$$ = _parse_DIGIT();
if (success) {
if (first) {
first = false;
reps = [$$];
testing0 = _testing;
} else {
reps.add($$);
}
_testing = _cursor;
} else {
success = !first;
if (success) {
_testing = testing0;
$$ = reps;
} else
$$ = null;
break;
}
}
_startPos = startPos1;
break;
case 1:
case 2:
$$ = null;
success = false;
break;
}
if (!success && _cursor > _testing) {
_failure(_expect1);
}
if (success) {
final $1 = $$;
final $start = startPos0;
var pos0 = _startPos;
$$ = ((offset, length) {
///CODE_START
return parseInt(length.join(''));
///CODE_END
})($start, $1);
}
_startPos = startPos0;
break;
case 1:
case 2:
$$ = null;
success = false;
break;
}
if (!success && _cursor > _testing) {
_failure(_expect1);
}
return $$;
}