Reformat Zeek in Spicy style

This largely copies over Spicy's `.clang-format` configuration file. The
one place where we deviate is header include order since Zeek depends on
headers being included in a certain order.
This commit is contained in:
Benjamin Bannier 2023-10-10 21:13:34 +02:00
parent 7b8e7ed72c
commit f5a76c1aed
786 changed files with 131714 additions and 153609 deletions

View file

@ -6,8 +6,7 @@
#include "zeek/IntrusivePtr.h"
#include "zeek/Type.h"
namespace zeek
{
namespace zeek {
class EventHandlerPtr;
class StringVal;
@ -15,8 +14,7 @@ class TableVal;
class ListVal;
class FuncType;
namespace detail
{
namespace detail {
class Expr;
class Scope;
@ -24,19 +22,18 @@ class Stmt;
using StmtPtr = IntrusivePtr<Stmt>;
using ScopePtr = IntrusivePtr<Scope>;
enum DeclType
{
VAR_REGULAR,
VAR_CONST,
VAR_REDEF,
VAR_OPTION,
};
enum DeclType {
VAR_REGULAR,
VAR_CONST,
VAR_REDEF,
VAR_OPTION,
};
extern void add_global(const IDPtr& id, TypePtr t, InitClass c, ExprPtr init,
std::unique_ptr<std::vector<AttrPtr>> attr, DeclType dt);
extern StmtPtr add_local(IDPtr id, TypePtr t, InitClass c, ExprPtr init,
std::unique_ptr<std::vector<AttrPtr>> attr, DeclType dt);
extern StmtPtr add_local(IDPtr id, TypePtr t, InitClass c, ExprPtr init, std::unique_ptr<std::vector<AttrPtr>> attr,
DeclType dt);
extern ExprPtr add_and_assign_local(IDPtr id, ExprPtr init, ValPtr val);
@ -46,13 +43,13 @@ extern void add_module(const char* module_name);
const std::set<std::string>& module_names();
extern void begin_func(IDPtr id, const char* module_name, FunctionFlavor flavor, bool is_redef,
FuncTypePtr t, std::unique_ptr<std::vector<AttrPtr>> attrs = nullptr);
extern void begin_func(IDPtr id, const char* module_name, FunctionFlavor flavor, bool is_redef, FuncTypePtr t,
std::unique_ptr<std::vector<AttrPtr>> attrs = nullptr);
extern void end_func(StmtPtr body, const char* module_name, bool free_of_conditionals);
// Gather all IDs referenced inside a body that aren't part of a given scope.
extern IDPList gather_outer_ids(ScopePtr scope, StmtPtr body);
} // namespace detail
} // namespace zeek
} // namespace detail
} // namespace zeek