59using std::regex_replace;
150#warning "Lumiera was _not_ built with a GCC compatible compiler."
151#warning "There are good chances this works without problems, but up to now, \
152the Lumiera developers lacked the resources to investigate that option; \
194 #define TYP_EXP "[\\w<>\\(\\):,\\s]+"
197 "|(\\w+::)+\\(anonymous namespace\\)::"
204 "|steam::(asset::|mobject::(session::)?|play::)?"
208 , regex::ECMAScript | regex::optimize};
210 static regex
lolong {
"long long"
211 , regex::ECMAScript | regex::optimize};
212 static regex
unSigned {
"unsigned (\\w+)"
213 , regex::ECMAScript | regex::optimize};
215 static regex
stdString {
"(__cxx11::)?basic_string<char, char_traits<char>, allocator<char>\\s*>(\\s+\\B)?"
216 , regex::ECMAScript | regex::optimize};
219 , regex::ECMAScript | regex::optimize};
222 , regex::ECMAScript | regex::optimize};
224 static regex
uniquePtr {
"unique_ptr<(\\w+), default_delete<\\1>\\s*"
225 , regex::ECMAScript | regex::optimize};
227 static regex
lumieraP {
"P<(\\w+), shared_ptr<\\1>\\s*"
228 , regex::ECMAScript | regex::optimize};
235 end = regex_replace(pos, pos, end,
lolong,
"llong");
236 end = regex_replace(pos, pos, end,
unSigned,
"u$1");
237 end = regex_replace(pos, pos, end,
stdString,
"string");
240 end = regex_replace(pos, pos, end,
uniquePtr,
"unique_ptr<$1");
241 end = regex_replace(pos, pos, end,
lumieraP,
"P<$1");
272 removeSuffix (
typeStr,
" const");
273 removeSuffix (
typeStr,
" const *");
287 else if (
'<' == *end
and level>0)
315 static regex
identifierChars {
"[A-Za-z]\\w*", regex::ECMAScript | regex::optimize};
336 using std::uppercase;
337 using std::noshowbase;
338 using std::ostringstream;
345 ostringstream buffer;
346 buffer.precision (precision);
351 {
return FAILURE_INDICATOR; }
375 ostringstream buffer;
380 {
return FAILURE_INDICATOR; }
388 size_t suffix_modulus = size_t(1) << DIAGNOSTICS_ADDRESS_SUFFIX_LEN * 8;
392 << setw (DIAGNOSTICS_ADDRESS_SUFFIX_LEN * 2)
395 << size_t(addr) % suffix_modulus;
402 ostringstream buffer;
407 {
return FAILURE_INDICATOR; }
414 size_t suffix_modulus = size_t(1) << showBytes * 8;
415 ostringstream buffer;
419 << setw (showBytes * 2)
422 << (showBytes==8?
hash :
hash % suffix_modulus);
426 {
return FAILURE_INDICATOR; }
RAII helper to capture and restore output stream format settings.
Lumiera error handling (C++ interface).
Capture previous settings of an std::ostream and restore them when leaving scope.
Implementation namespace for support and library code.
basic_ostream< char, char_traits< char > > ostream
string showComplete(double val) noexcept
show enough decimal digits to represent every distinct value
string showDouble(double val) noexcept
pretty-print a double in (rounded) fixed-point format
string showFloatingPoint(F val, size_t precision) noexcept
std::string sanitise(std::string const &)
produce an identifier based on the given string.
string showHash(size_t hash, uint showBytes) noexcept
renders the size_t in hex, optionally only trailing bytes
ostream & showAdr(ostream &stream, void const *addr)
preconfigured format for pretty-printing of addresses
string showSize(size_t val) noexcept
string showDecimal(double val) noexcept
show maximum reproducible decimal representation
void removeSuffix(string &str, string const &suffix)
constexpr NUM limited(NB lowerBound, NUM val, NB upperBound)
force a numeric to be within bounds, inclusively
string showFloat(float val) noexcept
void removePrefix(string &str, string const &prefix)
bool isnil(lib::time::Duration const &dur)
Marker types to indicate a literal string and a Symbol.
Helper to deal with C-MALLOCed memory automatically.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...