MCPcopy Create free account
hub / github.com/covscript/covscript / parse_number

Function parse_number

sources/covscript.cpp:224–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222 }
223
224 numeric parse_number(const std::string &str)
225 {
226 try {
227 if (str.find('.') != std::string::npos)
228 return std::stold(str);
229 else
230 return std::stoll(str);
231 }
232 catch (const std::exception &e) {
233 throw lang_error("Wrong literal format.");
234 }
235 }
236
237 garbage_collector<token_base> token_base::gc;
238

Callers 3

process_char_buffMethod · 0.85
parse_valueFunction · 0.85
to_numberFunction · 0.85

Calls 1

lang_errorClass · 0.85

Tested by

no test coverage detected