| 131 | } |
| 132 | |
| 133 | Value parseNumber() { |
| 134 | Value v; |
| 135 | v.type = Type::Number; |
| 136 | size_t start = pos; |
| 137 | if (s[pos] == '-') ++pos; |
| 138 | while (pos < len && s[pos] >= '0' && s[pos] <= '9') ++pos; |
| 139 | if (pos < len && s[pos] == '.') { |
| 140 | ++pos; |
| 141 | while (pos < len && s[pos] >= '0' && s[pos] <= '9') ++pos; |
| 142 | } |
| 143 | if (pos < len && (s[pos] == 'e' || s[pos] == 'E')) { |
| 144 | ++pos; |
| 145 | if (pos < len && (s[pos] == '+' || s[pos] == '-')) ++pos; |
| 146 | while (pos < len && s[pos] >= '0' && s[pos] <= '9') ++pos; |
| 147 | } |
| 148 | v.numVal = strtod(std::string(s + start, pos - start).c_str(), nullptr); |
| 149 | return v; |
| 150 | } |
| 151 | |
| 152 | Value parseBool() { |
| 153 | Value v; |
nothing calls this directly
no outgoing calls
no test coverage detected