factor method
Implementation
double factor() {
if (match('(')) {
double x = parse();
match(')');
return x;
}
int start = i;
while (i < s.length && "0123456789.".contains(s[i])) {
i++;
}
return double.parse(s.substring(start, i));
}