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

Everywhere: Add sv suffix to strings relying on StringView(char const*)

Each of these strings would previously rely on StringView's char const*
constructor overload, which would call __builtin_strlen on the string.
Since we now have operator ""sv, we can replace these with much simpler
versions. This opens the door to being able to remove
StringView(char const*).

No functional changes.
This commit is contained in:
sin-ack 2022-07-11 17:32:29 +00:00 committed by Andreas Kling
parent e5f09ea170
commit 3f3f45580a
762 changed files with 8315 additions and 8316 deletions

View file

@ -52,155 +52,155 @@ constexpr bool is_valid_nonfirst_character_of_identifier(char ch)
}
constexpr StringView s_known_keywords[] = {
"alignas",
"alignof",
"and",
"and_eq",
"asm",
"bitand",
"bitor",
"break",
"case",
"catch",
"class",
"compl",
"const",
"const_cast",
"constexpr",
"continue",
"decltype",
"default",
"delete",
"do",
"dynamic_cast",
"else",
"enum",
"explicit",
"export",
"extern",
"false",
"final",
"for",
"friend",
"goto",
"if",
"inline",
"mutable",
"namespace",
"new",
"noexcept",
"not",
"not_eq",
"nullptr",
"operator",
"or",
"or_eq",
"override",
"private",
"protected",
"public",
"register",
"reinterpret_cast",
"return",
"signed",
"sizeof",
"static",
"static_assert",
"static_cast",
"struct",
"switch",
"template",
"this",
"thread_local",
"throw",
"true",
"try",
"typedef",
"typeid",
"typename",
"union",
"using",
"virtual",
"volatile",
"while",
"xor",
"xor_eq"
"alignas"sv,
"alignof"sv,
"and"sv,
"and_eq"sv,
"asm"sv,
"bitand"sv,
"bitor"sv,
"break"sv,
"case"sv,
"catch"sv,
"class"sv,
"compl"sv,
"const"sv,
"const_cast"sv,
"constexpr"sv,
"continue"sv,
"decltype"sv,
"default"sv,
"delete"sv,
"do"sv,
"dynamic_cast"sv,
"else"sv,
"enum"sv,
"explicit"sv,
"export"sv,
"extern"sv,
"false"sv,
"final"sv,
"for"sv,
"friend"sv,
"goto"sv,
"if"sv,
"inline"sv,
"mutable"sv,
"namespace"sv,
"new"sv,
"noexcept"sv,
"not"sv,
"not_eq"sv,
"nullptr"sv,
"operator"sv,
"or"sv,
"or_eq"sv,
"override"sv,
"private"sv,
"protected"sv,
"public"sv,
"register"sv,
"reinterpret_cast"sv,
"return"sv,
"signed"sv,
"sizeof"sv,
"static"sv,
"static_assert"sv,
"static_cast"sv,
"struct"sv,
"switch"sv,
"template"sv,
"this"sv,
"thread_local"sv,
"throw"sv,
"true"sv,
"try"sv,
"typedef"sv,
"typeid"sv,
"typename"sv,
"union"sv,
"using"sv,
"virtual"sv,
"volatile"sv,
"while"sv,
"xor"sv,
"xor_eq"sv
};
constexpr StringView s_known_types[] = {
"Array",
"Array",
"Badge",
"Bitmap",
"ByteBuffer",
"Bytes",
"Checked",
"CircularDeque",
"CircularQueue",
"Deque",
"DoublyLinkedList",
"Error",
"ErrorOr",
"FlyString",
"Function",
"HashMap",
"HashTable",
"IPv4Address",
"IntrusiveList",
"IntrusiveList",
"JsonArray",
"JsonObject",
"JsonValue",
"LexicalPath",
"MappedFile",
"NetworkOrdered",
"NeverDestroyed",
"NonnullOwnPtr",
"NonnullOwnPtrVector",
"NonnullRefPtr",
"NonnullRefPtrVector",
"Optional",
"OwnPtr",
"ReadonlyBytes",
"RedBlackTree",
"RefPtr",
"Result",
"ScopeGuard",
"Singleton",
"SinglyLinkedList",
"Span",
"String",
"StringBuilder",
"StringImpl",
"StringView",
"Utf8View",
"Variant",
"Vector",
"WeakPtr",
"auto",
"bool",
"char",
"char16_t",
"char32_t",
"char8_t",
"double",
"float",
"i16",
"i32",
"i64",
"i8",
"int",
"int",
"long",
"short",
"signed",
"u16",
"u32",
"u64",
"u8",
"unsigned",
"void",
"wchar_t",
"Array"sv,
"Array"sv,
"Badge"sv,
"Bitmap"sv,
"ByteBuffer"sv,
"Bytes"sv,
"Checked"sv,
"CircularDeque"sv,
"CircularQueue"sv,
"Deque"sv,
"DoublyLinkedList"sv,
"Error"sv,
"ErrorOr"sv,
"FlyString"sv,
"Function"sv,
"HashMap"sv,
"HashTable"sv,
"IPv4Address"sv,
"IntrusiveList"sv,
"IntrusiveList"sv,
"JsonArray"sv,
"JsonObject"sv,
"JsonValue"sv,
"LexicalPath"sv,
"MappedFile"sv,
"NetworkOrdered"sv,
"NeverDestroyed"sv,
"NonnullOwnPtr"sv,
"NonnullOwnPtrVector"sv,
"NonnullRefPtr"sv,
"NonnullRefPtrVector"sv,
"Optional"sv,
"OwnPtr"sv,
"ReadonlyBytes"sv,
"RedBlackTree"sv,
"RefPtr"sv,
"Result"sv,
"ScopeGuard"sv,
"Singleton"sv,
"SinglyLinkedList"sv,
"Span"sv,
"String"sv,
"StringBuilder"sv,
"StringImpl"sv,
"StringView"sv,
"Utf8View"sv,
"Variant"sv,
"Vector"sv,
"WeakPtr"sv,
"auto"sv,
"bool"sv,
"char"sv,
"char16_t"sv,
"char32_t"sv,
"char8_t"sv,
"double"sv,
"float"sv,
"i16"sv,
"i32"sv,
"i64"sv,
"i8"sv,
"int"sv,
"int"sv,
"long"sv,
"short"sv,
"signed"sv,
"u16"sv,
"u32"sv,
"u64"sv,
"u8"sv,
"unsigned"sv,
"void"sv,
"wchar_t"sv,
};
static bool is_keyword(StringView string)