1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:27:35 +00:00

AK: Add dbgln() format checking

This checks the following things:
- No unclosed braces in format string
    `dbgln("a:{}}", a)` where the '}}' would be interpreted as a
    literal '}'
    `dbgln("a:{", a)` where someone with a faulty keyboard like mine
    could generate
- No extra closed braces in format string
    `dbgln("a:{{}", a)` where the '{{' would interpreted as a literal '{'
    `dbgln("a:}", a)` where someone with a faulty keyboard could
    generate
- No references to nonexistent arguments
    `dbgln("a:{} b:{}", a)` where the value of `b` is not in the
    arguments list
- No unconsumed argument
    `dbgln("a:{1}", not_used, 1)` where `not_used` is extraneous
This commit is contained in:
AnotherTest 2021-01-17 11:52:04 +03:30 committed by Andreas Kling
parent 09a43969ba
commit 20765da2a4
3 changed files with 209 additions and 2 deletions

View file

@ -275,7 +275,10 @@ public:
}
template<typename T>
static String number(T value) requires IsArithmetic<T>::value { return formatted("{}", value); }
static String number(T value) requires IsArithmetic<T>::value
{
return formatted("{}", value);
}
StringView view() const;