1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-07 21:17:07 +09:00

Meta: Enforce newlines around namespaces

This has come up several times during code review, so let's just enforce
it using a new clang-format 20 option.
This commit is contained in:
Timothy Flynn 2025-05-13 07:06:33 -04:00 committed by Andrew Kaster
parent ca9f3673c5
commit 7280ed6312
Notes: github-actions[bot] 2025-05-14 08:06:48 +00:00
206 changed files with 448 additions and 0 deletions

View file

@ -19,6 +19,7 @@ RemoveSemicolon: true
RequiresClausePosition: WithFollowing
RequiresExpressionIndentation: OuterScope
SpaceAfterTemplateKeyword: false
WrapNamespaceBodyWithEmptyLines: Always
---
Language: ObjC

View file

@ -15,6 +15,7 @@
namespace AK {
namespace Detail {
// This type serves as the storage of 0-sized `AK::Array`s. While zero-length `T[0]`
// is accepted as a GNU extension, it causes problems with UBSan in Clang 16.
template<typename T>
@ -22,6 +23,7 @@ struct EmptyArrayStorage {
T& operator[](size_t) const { VERIFY_NOT_REACHED(); }
constexpr operator T*() const { return nullptr; }
};
}
template<typename T, size_t Size>
@ -148,11 +150,13 @@ template<typename T, typename... Types>
Array(T, Types...) -> Array<T, sizeof...(Types) + 1>;
namespace Detail {
template<typename T, size_t... Is>
constexpr auto integer_sequence_generate_array([[maybe_unused]] T const offset, IntegerSequence<T, Is...>) -> Array<T, sizeof...(Is)>
{
return { { (offset + Is)... } };
}
}
template<typename T, T N>
@ -163,11 +167,13 @@ constexpr auto iota_array(T const offset = {})
}
namespace Detail {
template<typename T, size_t N, size_t... Is>
constexpr auto to_array_impl(T (&&a)[N], IndexSequence<Is...>) -> Array<T, sizeof...(Is)>
{
return { { a[Is]... } };
}
}
template<typename T, size_t N>

View file

@ -455,6 +455,7 @@ public:
return __atomic_is_lock_free(sizeof(m_value), &m_value);
}
};
}
#if USING_AK_GLOBALLY

View file

@ -126,11 +126,13 @@ consteval auto count_fmt_params(char const (&fmt)[N])
}
return result;
}
}
#endif
namespace AK::Format::Detail {
template<typename... Args>
struct CheckedFormatString {
template<size_t N>
@ -206,6 +208,7 @@ private:
StringView m_string;
};
}
namespace AK {

View file

@ -170,6 +170,7 @@ concept CallableAs = Detail::IsCallableWithArguments<Func, R, Args...>;
#if !USING_AK_GLOBALLY
namespace AK {
#endif
using AK::Concepts::Arithmetic;
using AK::Concepts::ArrayLike;
@ -195,5 +196,6 @@ using AK::Concepts::SpecializationOf;
using AK::Concepts::Unsigned;
using AK::Concepts::VoidFunction;
#if !USING_AK_GLOBALLY
}
#endif

View file

@ -46,6 +46,7 @@ namespace AK {
*/
namespace DistinctNumericFeature {
enum Arithmetic { };
enum CastToBool { };
enum CastToUnderlying { };
@ -53,6 +54,7 @@ enum Comparison { };
enum Flags { };
enum Increment { };
enum Shift { };
};
template<typename T, typename X, typename... Opts>
@ -304,6 +306,7 @@ struct Formatter<DistinctNumeric<T, X, Opts...>> : Formatter<T> {
return Formatter<T>::format(builder, value.value());
}
};
}
#define AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(T, NAME, ...) \

View file

@ -11,6 +11,7 @@
namespace AK {
namespace Detail {
template<typename Iterable>
class Enumerator {
using IteratorType = decltype(declval<Iterable>().begin());
@ -50,6 +51,7 @@ private:
IteratorType m_iterator;
IteratorType const m_end;
};
}
template<typename T>

View file

@ -14,10 +14,12 @@
namespace AK {
namespace Detail {
template<size_t inline_capacity>
class ByteBuffer;
class StringData;
}
enum class TrailingCodePointTransformation : u8;

View file

@ -57,6 +57,7 @@ namespace AK {
#endif
namespace Detail {
#ifdef AK_HAS_OBJC_ARC
inline constexpr bool HaveObjcArc = true;
#else
@ -65,6 +66,7 @@ inline constexpr bool HaveObjcArc = false;
// validated in TestFunction.mm
inline constexpr size_t block_layout_size = 32;
}
template<typename>

View file

@ -13,6 +13,7 @@
#include <AK/Utf16View.h>
namespace AK {
// Consume a number of characters
StringView GenericLexer::consume(size_t count)
{

View file

@ -70,6 +70,7 @@ template<typename T, typename... Ts>
{
return (... && (forward<T>(to_compare) >= forward<Ts>(valid_values)));
}
}
#if USING_AK_GLOBALLY

View file

@ -793,6 +793,7 @@ private:
size_t m_size { 0 };
size_t m_capacity { 0 };
};
}
#if USING_AK_GLOBALLY

View file

@ -48,6 +48,7 @@ private:
HashTable<int> m_allocated_ids;
int m_minimum_value { 1 };
};
}
#if USING_AK_GLOBALLY

View file

@ -35,6 +35,7 @@ template<FloatingPoint T>
constexpr T L2_E = 1.442695040888963407359924681001892137L;
namespace Details {
template<size_t>
constexpr size_t product_even();
template<>
@ -48,6 +49,7 @@ template<>
constexpr size_t product_odd<1>() { return 1; }
template<size_t value>
constexpr size_t product_odd() { return value * product_odd<value - 2>(); }
}
template<FloatingPoint T>
@ -103,6 +105,7 @@ constexpr T fabs(T x)
}
namespace Rounding {
template<FloatingPoint T>
constexpr T ceil(T num)
{
@ -385,6 +388,7 @@ using Rounding::round_to;
using Rounding::trunc;
namespace Division {
template<FloatingPoint T>
constexpr T fmod(T x, T y)
{
@ -462,6 +466,7 @@ constexpr T remainder(T x, T y)
return __builtin_remainderf(x, y);
#endif
}
}
using Division::fmod;
@ -1036,6 +1041,7 @@ constexpr I clamp_to(T value)
#undef CONSTEXPR_STATE
#undef AARCH64_INSTRUCTION
}
#if USING_AK_GLOBALLY

View file

@ -15,6 +15,7 @@
namespace AK {
namespace Detail {
constexpr void const* bitap_bitwise(void const* haystack, size_t haystack_length, void const* needle, size_t needle_length)
{
VERIFY(needle_length < 32);
@ -40,6 +41,7 @@ constexpr void const* bitap_bitwise(void const* haystack, size_t haystack_length
return nullptr;
}
}
template<typename HaystackIterT>

View file

@ -53,6 +53,7 @@ struct Traits<NonnullRawPtr<T>> : public DefaultTraits<NonnullRawPtr<T>> {
};
namespace Detail {
template<typename T>
inline constexpr bool IsHashCompatible<NonnullRawPtr<T>, T> = true;

View file

@ -17,6 +17,7 @@
namespace AK {
namespace Detail {
template<auto condition, typename T>
struct ConditionallyResultType;
@ -29,6 +30,7 @@ template<typename T>
struct ConditionallyResultType<false, T> {
using Type = T;
};
}
template<auto condition, typename T>

View file

@ -207,6 +207,7 @@ struct Formatter<OwnPtr<T>> : Formatter<T*> {
return Formatter<T*>::format(builder, value.ptr());
}
};
}
#if USING_AK_GLOBALLY

View file

@ -81,6 +81,7 @@ static_assert(vector_length<i8x4> == 4);
static_assert(vector_length<f32x4> == 4);
namespace Detail {
template<typename T>
struct IndexVectorFor;
@ -113,4 +114,5 @@ static_assert(IsSame<IndexVectorFor<u64x4>, u64x4>);
static_assert(IsSame<IndexVectorFor<f32x4>, u32x4>);
static_assert(IsSame<IndexVectorFor<f64x4>, u64x4>);
#endif
}

View file

@ -185,6 +185,7 @@ ALWAYS_INLINE static void store4_masked(VectorType v, UnderlyingType* a, Underly
// Shuffle
namespace Detail {
template<SIMDVector T, SIMDVector Control, size_t... Idx>
ALWAYS_INLINE static T shuffle_impl(T a, Control control, IndexSequence<Idx...>)
{

View file

@ -12,6 +12,7 @@
#include <AK/StringBuilder.h>
namespace AK {
template<bool = true>
class ScopeLogger {
public:

View file

@ -300,6 +300,7 @@ private:
Node* m_tail { nullptr };
TSizeCalculationPolicy m_size_policy {};
};
}
#if USING_AK_GLOBALLY

View file

@ -660,6 +660,7 @@ using EquivalentFunctionType = typename EquivalentFunctionTypeImpl<Callable>::Ty
#if !USING_AK_GLOBALLY
namespace AK {
#endif
using AK::Detail::AddConst;
using AK::Detail::AddConstToReferencedType;
@ -738,5 +739,6 @@ using AK::Detail::TrueType;
using AK::Detail::UnderlyingType;
using AK::Detail::Void;
#if !USING_AK_GLOBALLY
}
#endif

View file

@ -35,13 +35,16 @@ void compiletime_fail(Args...);
using std::construct_at;
using std::forward;
using std::move;
}
namespace AK::Detail {
template<typename T>
struct _RawPtr {
using Type = T*;
};
}
namespace AK {

View file

@ -48,4 +48,5 @@ ErrorOr<StringBase> StringBase::substring_from_byte_offset_with_shared_superstri
}
return StringBase { TRY(Detail::StringData::create_substring(*m_impl.data, start, length)) };
}
}

View file

@ -264,4 +264,5 @@ inline bool StringBase::operator==(StringBase const& other) const
return m_impl.data == other.m_impl.data;
return bytes() == other.bytes();
}
}

View file

@ -14,8 +14,10 @@
namespace AK {
namespace Detail {
template<Concepts::AnyString T, Concepts::AnyString U>
inline constexpr bool IsHashCompatible<T, U> = true;
}
enum class CaseSensitivity {

View file

@ -204,6 +204,7 @@ Duration Duration::from_half_sanitized(i64 seconds, i32 extra_seconds, u32 nanos
}
namespace {
#if defined(AK_OS_WINDOWS)
# define CLOCK_REALTIME 0
# define CLOCK_MONOTONIC 1

View file

@ -83,6 +83,7 @@ constexpr int weeks_in_year(int year)
}
namespace Detail {
// Integer division rounding towards negative infinity.
// TODO: This feels like there should be an easier way to do this.
template<int divisor>
@ -100,6 +101,7 @@ constexpr i64 mod_zeros_in_range(i64 begin, i64 end)
{
return floor_div_by<positive_mod>(end - 1) - floor_div_by<positive_mod>(begin - 1);
}
}
constexpr i64 years_to_days_since_epoch(int year)

View file

@ -161,7 +161,9 @@ constexpr u64 PiB = KiB * KiB * KiB * KiB * KiB;
constexpr u64 EiB = KiB * KiB * KiB * KiB * KiB * KiB;
namespace AK_REPLACED_STD_NAMESPACE { // NOLINT(cert-dcl58-cpp) nullptr_t must be in ::std:: for some analysis tools
using nullptr_t = decltype(nullptr);
}
namespace AK {

View file

@ -21,6 +21,7 @@
namespace AK {
namespace Detail {
// As noted near the declaration of StaticStorage, bit_size is more like a hint for a storage size.
// The effective bit size is `sizeof(StaticStorage<...>) * 8`. It is a programmer's responsibility
// to ensure that the hinted bit_size is always greater than the actual integer size.
@ -497,6 +498,7 @@ bool operator==(BuiltInUFixedInt auto const& a, NotBuiltInUFixedInt auto const&
int operator<=>(BuiltInUFixedInt auto const& a, NotBuiltInUFixedInt auto const& b) { return -b.operator<=>(a); }
bool operator==(IntegerWrapper const& a, NotBuiltInUFixedInt auto const& b) { return b.operator==(a); }
int operator<=>(IntegerWrapper const& a, NotBuiltInUFixedInt auto const& b) { return -b.operator<=>(a); }
}
using Detail::UFixedBigInt;
@ -645,6 +647,7 @@ struct Formatter<T> : StandardFormatter {
return {};
}
};
}
// these sizes should suffice for most usecases

View file

@ -500,6 +500,7 @@ template<typename... Ts>
struct TypeList<Variant<Ts...>> : TypeList<Ts...> { };
namespace Detail {
template<typename T1, typename T2>
struct FlattenVariant;

View file

@ -39,6 +39,7 @@ struct CanBePlacedInsideVectorHelper<StorageType, false> {
template<typename U>
static constexpr bool value = requires(U&& u) { StorageType(forward<U>(u)); };
};
}
template<typename T, size_t inline_capacity>

View file

@ -63,7 +63,9 @@ void operator delete[](void* ptr, size_t) noexcept
// This is usually provided by libstdc++ in most cases, and the kernel has its own definition in
// Kernel/Heap/kmalloc.cpp. If neither of those apply, the following should suffice to not fail during linking.
namespace AK_REPLACED_STD_NAMESPACE {
nothrow_t const nothrow;
}
#endif

View file

@ -94,6 +94,7 @@ private:
}
namespace AK {
template<>
struct Formatter<Core::DateTime> : StandardFormatter {
ErrorOr<void> format(FormatBuilder& builder, Core::DateTime const& value)
@ -104,6 +105,7 @@ struct Formatter<Core::DateTime> : StandardFormatter {
value.hour(), value.minute(), value.second());
}
};
}
namespace IPC {

View file

@ -65,6 +65,7 @@ private:
}
namespace AK {
template<>
struct Formatter<Core::Directory> : Formatter<StringView> {
ErrorOr<void> format(FormatBuilder& builder, Core::Directory const& directory)

View file

@ -17,6 +17,7 @@
namespace Core {
namespace {
OwnPtr<Vector<EventLoop&>>& event_loop_stack_uninitialized()
{
thread_local OwnPtr<Vector<EventLoop&>> s_event_loop_stack = nullptr;
@ -29,6 +30,7 @@ Vector<EventLoop&>& event_loop_stack()
the_stack = make<Vector<EventLoop&>>();
return *the_stack;
}
}
EventLoop::EventLoop()

View file

@ -23,6 +23,7 @@
namespace Core {
namespace {
struct ThreadData;
class TimeoutSet;
@ -299,6 +300,7 @@ struct ThreadData {
pid_t pid { 0 };
};
}
EventLoopImplementationUnix::EventLoopImplementationUnix()

View file

@ -188,6 +188,7 @@ struct AK::Formatter<Core::EventReceiver> : AK::Formatter<FormatString> {
};
namespace Core {
template<typename T, typename Callback>
inline void EventReceiver::for_each_child_of_type(Callback callback)
requires IsBaseOf<EventReceiver, T>

View file

@ -8,6 +8,7 @@
#include <LibCore/EventSwift.h>
namespace Core {
void deferred_invoke_block(EventLoop& event_loop, void (^invokee)(void))
{
event_loop.deferred_invoke(invokee);

View file

@ -13,6 +13,7 @@
#include <LibURL/URL.h>
namespace Core {
// FIXME: Username/password support.
struct ProxyData {
enum Type {
@ -45,6 +46,7 @@ struct ProxyData {
return proxy_data;
}
};
}
namespace IPC {

View file

@ -236,4 +236,5 @@ done_parsing:;
return UnixDateTime::from_unix_time_parts(year.value(), month.value(), day.value(), hour.value(), minute.value_or(0), seconds.value_or(0), milliseconds.value_or(0));
}
}

View file

@ -14,8 +14,10 @@
#include <LibCrypto/OpenSSL.h>
namespace {
// Used by ASN1 macros
static String s_error_string;
}
namespace Crypto::Curves {

View file

@ -59,6 +59,7 @@ public:
protected:
virtual ~HashFunction() = default;
};
}
template<size_t DigestS>

View file

@ -22,6 +22,7 @@
#include <LibThreading/RWLockProtected.h>
namespace DNS {
class Resolver;
class LookupResult : public AtomicRefCounted<LookupResult>

View file

@ -179,6 +179,7 @@ struct Formatter<GC::Root<T>> : Formatter<T const*> {
};
namespace Detail {
template<typename T>
inline constexpr bool IsHashCompatible<GC::Root<T>, T> = true;

View file

@ -115,6 +115,7 @@ sk_sp<SkColorSpace>& ColorSpace::color_space()
}
namespace IPC {
template<>
ErrorOr<void> encode(Encoder& encoder, Gfx::ColorSpace const& color_space)
{
@ -141,4 +142,5 @@ ErrorOr<Gfx::ColorSpace> decode(Decoder& decoder)
auto color_space = SkColorSpace::Deserialize(buffer.data(), buffer.size());
return Gfx::ColorSpace { make<::Gfx::Details::ColorSpaceImpl>(move(color_space)) };
}
}

View file

@ -40,4 +40,5 @@ struct ColorFilter {
};
using Filter = Variant<BlurFilter, DropShadowFilter, HueRotateFilter, ColorFilter>;
}

View file

@ -270,4 +270,5 @@ ErrorOr<Optional<ReadonlyBytes>> JPEGXLImageDecoderPlugin::icc_data()
{
return OptionalNone {};
}
}

View file

@ -29,7 +29,9 @@ class ExifMetadata;
// And it can be found at https://www.cipa.jp/e/std/std-sec.html
namespace TIFF {
class TIFFLoadingContext;
}
class TIFFImageDecoderPlugin : public ImageDecoderPlugin {

View file

@ -26,6 +26,7 @@ constexpr static Vector3<T> operator*(Matrix3x3<T> const& m, Vector3<T> const& v
typedef Matrix3x3<float> FloatMatrix3x3;
typedef Matrix3x3<double> DoubleMatrix3x3;
}
using Gfx::DoubleMatrix3x3;

View file

@ -86,6 +86,7 @@ Gfx::AffineTransform extract_2d_affine_transform(Matrix4x4<T> const& matrix)
typedef Matrix4x4<float> FloatMatrix4x4;
typedef Matrix4x4<double> DoubleMatrix4x4;
}
using Gfx::DoubleMatrix4x4;

View file

@ -134,4 +134,5 @@ constexpr SkSamplingOptions to_skia_sampling_options(Gfx::ScalingMode scaling_mo
SkPath to_skia_path(Path const& path);
sk_sp<SkImageFilter> to_skia_image_filter(Gfx::Filter const& filter);
sk_sp<SkBlender> to_skia_blender(Gfx::CompositingAndBlendingOperator compositing_and_blending_operator);
}

View file

@ -1390,4 +1390,5 @@ Vector<ByteString> Parser::imported_files() const
{
return const_cast<Parser*>(this)->top_level_resolved_imports().keys();
}
}

View file

@ -12,7 +12,9 @@
#include <LibIPC/Forward.h>
namespace AK {
class BufferStream;
}
namespace IPC {

View file

@ -37,6 +37,7 @@ private:
}
namespace AK {
template<>
class Optional<JS::Bytecode::IdentifierTableIndex> : public OptionalBase<JS::Bytecode::IdentifierTableIndex> {
template<typename U>

View file

@ -51,6 +51,7 @@ struct PropertyKeyAndEnumerableFlag {
}
namespace AK {
template<>
struct Traits<JS::PropertyKeyAndEnumerableFlag> : public DefaultTraits<JS::PropertyKeyAndEnumerableFlag> {
static unsigned hash(JS::PropertyKeyAndEnumerableFlag const& entry)
@ -63,6 +64,7 @@ struct Traits<JS::PropertyKeyAndEnumerableFlag> : public DefaultTraits<JS::Prope
return Traits<JS::PropertyKey>::equals(a.key, b.key);
}
};
}
namespace JS::Bytecode {

View file

@ -27,7 +27,9 @@
#include <LibJS/Runtime/ValueTraits.h>
namespace JS {
class FunctionExpression;
}
namespace JS::Bytecode::Op {

View file

@ -71,6 +71,7 @@ static_assert(sizeof(Operand) == 8);
}
namespace AK {
template<>
class Optional<JS::Bytecode::Operand> : public OptionalBase<JS::Bytecode::Operand> {
template<typename U>

View file

@ -37,6 +37,7 @@ private:
}
namespace AK {
template<>
class Optional<JS::Bytecode::StringTableIndex> : public OptionalBase<JS::Bytecode::StringTableIndex> {
template<typename U>

View file

@ -268,6 +268,7 @@ JS_ENUMERATE_TYPED_ARRAYS
#undef __JS_ENUMERATE
namespace Intl {
#define __JS_ENUMERATE(ClassName, snake_name, ConstructorName, PrototypeName) \
class ClassName; \
class ConstructorName; \
@ -284,9 +285,11 @@ class Segments;
class SegmentsPrototype;
struct ResolutionOptionDescriptor;
};
namespace Temporal {
#define __JS_ENUMERATE(ClassName, snake_name, ConstructorName, PrototypeName) \
class ClassName; \
class ConstructorName; \
@ -309,6 +312,7 @@ struct PartialDuration;
struct Time;
struct TimeZone;
struct TimeZoneOffset;
};
template<typename T>
@ -316,6 +320,7 @@ requires(!IsLvalueReference<T>)
class ThrowCompletionOr;
namespace Bytecode {
class BasicBlock;
enum class Builtin : u8;
class Executable;
@ -325,6 +330,7 @@ class Interpreter;
class Operand;
class RegexTable;
class Register;
}
}

View file

@ -342,4 +342,5 @@ private:
HashMap<size_t, TokenMemoization> m_token_memoizations;
Program::Type m_program_type;
};
}

View file

@ -1052,12 +1052,15 @@ ErrorOr<void> print_value(JS::PrintContext& print_context, JS::Value value, Hash
TRY(js_out(print_context, "\033[0m"));
return {};
}
}
namespace JS {
ErrorOr<void> print(JS::Value value, PrintContext& print_context)
{
HashTable<JS::Object*> seen_objects;
return print_value(print_context, value, seen_objects);
}
}

View file

@ -12,6 +12,7 @@
#include <LibJS/Runtime/Value.h>
namespace JS {
struct PrintContext {
JS::VM& vm;
Stream& stream;
@ -19,4 +20,5 @@ struct PrintContext {
};
ErrorOr<void> print(JS::Value value, PrintContext&);
}

View file

@ -77,4 +77,5 @@ inline bool Object::fast_is<Error>() const { return is_error_object(); }
DECLARE_NATIVE_ERROR(ClassName, snake_name, PrototypeName, ConstructorName)
JS_ENUMERATE_NATIVE_ERRORS
#undef __JS_ENUMERATE
}

View file

@ -34,6 +34,7 @@ void PromiseCapability::visit_edges(Cell::Visitor& visitor)
}
namespace {
struct ResolvingFunctions final : public Cell {
GC_CELL(ResolvingFunctions, Cell);
GC_DECLARE_ALLOCATOR(ResolvingFunctions);
@ -49,6 +50,7 @@ struct ResolvingFunctions final : public Cell {
}
};
GC_DEFINE_ALLOCATOR(ResolvingFunctions);
}
// 27.2.1.5 NewPromiseCapability ( C ), https://tc39.es/ecma262/#sec-newpromisecapability

View file

@ -13,6 +13,7 @@
#include <LibJS/Runtime/Value.h>
namespace JS {
struct ValueTraits : public Traits<Value> {
static unsigned hash(Value value)
{

View file

@ -446,6 +446,7 @@ void Editor::enter_search()
}
namespace {
Optional<u32> read_unicode_char()
{
// FIXME: It would be ideal to somehow communicate that the line editor is
@ -470,6 +471,7 @@ Optional<u32> read_unicode_char()
return {};
}
}
void Editor::search_character_forwards()
@ -768,4 +770,5 @@ void Editor::edit_in_external_editor()
}
}
}
}

View file

@ -194,4 +194,5 @@ private:
bool m_is_empty { true };
};
}

View file

@ -11,6 +11,7 @@
#include <AK/Math.h>
namespace Audio {
using AK::Exponentials::exp;
using AK::Exponentials::log;
// Constants for logarithmic volume. See Sample::linear_to_log

View file

@ -33,6 +33,7 @@ enum class CodecID : u32 {
}
namespace AK {
template<>
struct Formatter<Media::CodecID> : Formatter<StringView> {
ErrorOr<void> format(FormatBuilder& builder, Media::CodecID value)
@ -82,4 +83,5 @@ struct Formatter<Media::CodecID> : Formatter<StringView> {
return builder.put_string(codec);
}
};
}

View file

@ -10,6 +10,7 @@
#include <LibRegex/Export.h>
namespace regex {
struct CompareTypeAndValuePair;
enum class Error : u8;
@ -32,6 +33,7 @@ class OpCode_SaveNamedLeftCaptureGroup;
class OpCode_SaveRightNamedCaptureGroup;
class OpCode_Compare;
class RegexStringView;
}
using regex::ECMA262Parser;

View file

@ -81,6 +81,7 @@ inline StringView get_error_string(Error error)
}
return "Undefined error."sv;
}
}
using regex::get_error_string;

View file

@ -603,6 +603,7 @@ template class Regex<PosixExtendedParser>;
template class Matcher<ECMA262Parser>;
template class Regex<ECMA262Parser>;
}
template<typename Parser>

View file

@ -294,6 +294,7 @@ bool has_match(Vector<RegexStringView> const& views, Regex<Parser>& pattern, Opt
{
return pattern.has_match(views, regex_options);
}
}
using regex::has_match;

View file

@ -1813,4 +1813,5 @@ void Optimizer::append_character_class(ByteCode& target, Vector<CompareTypeAndVa
template void Regex<PosixBasicParser>::run_optimization_passes();
template void Regex<PosixExtendedParser>::run_optimization_passes();
template void Regex<ECMA262Parser>::run_optimization_passes();
}

View file

@ -2812,4 +2812,5 @@ size_t ECMA262Parser::ensure_total_number_of_capturing_parenthesis()
m_total_number_of_capturing_parenthesis = count;
return count;
}
}

View file

@ -82,4 +82,5 @@ void WebSocket::did_request_certificates(Badge<RequestClient>)
dbgln("WebSocket: set_certificate failed");
}
}
}

View file

@ -109,6 +109,7 @@ private:
// Helper to hide implementation of TestSuite from users
void add_test_case_to_suite(NonnullRefPtr<TestCase> const& test_case);
void set_suite_setup_function(Function<void()> setup);
}
#define TEST_SETUP \

View file

@ -19,6 +19,7 @@ namespace TextCodec {
static constexpr u32 replacement_code_point = 0xfffd;
namespace {
Latin1Decoder s_latin1_decoder;
UTF8Decoder s_utf8_decoder;
UTF16BEDecoder s_utf16be_decoder;

View file

@ -14,6 +14,7 @@
namespace TextCodec {
namespace {
UTF8Encoder s_utf8_encoder;
GB18030Encoder s_gb18030_encoder;
GB18030Encoder s_gbk_encoder(GB18030Encoder::IsGBK::Yes);

View file

@ -7,6 +7,7 @@
#pragma once
namespace URL {
class Host;
class Origin;
class Parser;
@ -14,4 +15,5 @@ class Site;
class URL;
struct BlobURLEntry;
}

View file

@ -583,4 +583,5 @@ void AbstractMachine::visit_external_resources(HostVisitOps const& host)
for (auto interpreter_ptr : m_active_interpreters)
interpreter_ptr->visit_external_resources(host);
}
}

View file

@ -1669,4 +1669,5 @@ void DebuggerBytecodeInterpreter::interpret_instruction(Configuration& configura
}
}
}
}

View file

@ -3752,4 +3752,5 @@ ByteString Validator::Errors::find_instruction_name(SourceLocation const& locati
return instruction_name(OpCode { *opcode });
}
}

View file

@ -14,7 +14,9 @@ struct ValidationError;
struct Interpreter;
namespace Wasi {
struct Implementation;
}
}

View file

@ -1378,4 +1378,5 @@ ByteString parse_error_to_byte_string(ParseError error)
}
return "Unknown error";
}
}

View file

@ -700,6 +700,7 @@ void Printer::print(Wasm::Reference const& value)
[](Wasm::Reference::Null const&) { return ByteString("null"); },
[](auto const& ref) { return ByteString::number(ref.address.value()); }));
}
}
HashMap<Wasm::OpCode, ByteString> Wasm::Names::instruction_names {

View file

@ -1051,4 +1051,5 @@ private:
ValidationStatus m_validation_status { ValidationStatus::Unchecked };
Optional<ByteString> m_validation_error;
};
}

View file

@ -1221,9 +1221,11 @@ FDFlags fd_flags_of(struct stat const&)
FDFlags::Bits result {};
return FDFlags { result };
}
}
namespace AK {
template<>
struct Formatter<Wasm::Wasi::Errno> : AK::Formatter<FormatString> {
ErrorOr<void> format(FormatBuilder& builder, Wasm::Wasi::Errno const& value)
@ -1291,4 +1293,5 @@ struct Formatter<Wasm::Wasi::SockRecvResult> : AK::Formatter<FormatString> {
return Formatter<FormatString>::format(builder, "size={}"sv, value.size);
}
};
}

View file

@ -98,10 +98,12 @@ using FileSize = LittleEndian<u64>;
using Timestamp = LittleEndian<u64>;
namespace Detail {
template<typename>
struct __Pointer_tag;
template<typename>
struct __ConstPointer_tag;
}
// NOTE: Might need to be updated if WASI ever supports memory64.

View file

@ -12,7 +12,9 @@
#include <LibWeb/Animations/KeyframeEffect.h>
namespace Web::CSS {
class CSSTransition;
}
namespace Web::Animations {

View file

@ -10,6 +10,7 @@
#include <LibWeb/DOM/Element.h>
namespace Web::CSS {
GC_DEFINE_ALLOCATOR(CascadedProperties);
CascadedProperties::CascadedProperties() = default;

View file

@ -70,4 +70,5 @@ constexpr bool is_greater_than_maximum_allowed_code_point(u32 code_point)
// The greatest code point defined by Unicode: U+10FFFF.
return code_point > 0x10FFFF;
}
}

View file

@ -10,6 +10,7 @@
#include <LibWeb/Forward.h>
namespace Web::CSS {
class Frequency {
public:
enum class Type {

View file

@ -37,4 +37,5 @@ private:
String m_media;
bool m_matches;
};
}

View file

@ -90,6 +90,7 @@ private:
double m_value { 0 };
Type m_type;
};
}
template<>

View file

@ -47,6 +47,7 @@ public:
private:
Variant<Token, Function, SimpleBlock> m_value;
};
}
template<>

View file

@ -41,6 +41,7 @@ namespace Web::CSS::Parser {
class PropertyDependencyNode;
namespace CalcParsing {
struct Operator {
char delim;
};
@ -61,6 +62,7 @@ struct InvertNode {
struct NegateNode {
Node child;
};
}
enum class ParsingMode {

View file

@ -106,4 +106,5 @@ private:
Token::Position m_position;
Token::Position m_prev_position;
};
}

Some files were not shown because too many files have changed in this diff Show more