Skip to content

Commit 3011ade

Browse files
committed
Reformat code base with new clang-format settings.
1 parent db57611 commit 3011ade

File tree

8 files changed

+34
-28
lines changed

8 files changed

+34
-28
lines changed

nyan/database.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2017-2024 the nyan authors, LGPLv3+. See copying.md for legal info.
1+
// Copyright 2017-2025 the nyan authors, LGPLv3+. See copying.md for legal info.
22

33
#include "database.h"
44

@@ -532,7 +532,7 @@ void Database::resolve_types(const std::vector<fqon_t> &new_objects) {
532532
// check if the member we're looking for isn't already typed.
533533
if (unlikely(member_info.is_initial_def())) {
534534
// another parent defines this type,
535-
// which is disallowed!
535+
// which is disallowed!
536536

537537
// TODO: show location of infringing type instead of member
538538
throw LangError{
@@ -546,7 +546,7 @@ void Database::resolve_types(const std::vector<fqon_t> &new_objects) {
546546
member_info.set_type(new_type, false);
547547
}
548548
// else that member knows the type,
549-
// but we're looking for the initial definition.
549+
// but we're looking for the initial definition.
550550

551551
// we need to traverse all members and never stop early.
552552
return false;

nyan/error.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2016-2021 the nyan authors, LGPLv3+. See copying.md for legal info.
1+
// Copyright 2016-2025 the nyan authors, LGPLv3+. See copying.md for legal info.
22

33
#include "error.h"
44

@@ -8,7 +8,7 @@
88
#define WIN32_LEAN_AND_MEAN
99
#include <windows.h>
1010
// TODO - CaptureStackBackTrace doesn't report number of frames available
11-
// need to implement increase buffer size
11+
// need to implement increase buffer size
1212
#define backtrace(buffer, buf_size) CaptureStackBackTrace(0, buf_size, buffer, NULL)
1313
#else
1414
#include <execinfo.h>

nyan/lexer/bracket.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2017-2020 the nyan authors, LGPLv3+. See copying.md for legal info.
1+
// Copyright 2017-2025 the nyan authors, LGPLv3+. See copying.md for legal info.
22
#pragma once
33

44

@@ -41,22 +41,22 @@ class Bracket {
4141
token_type expected_match() const;
4242

4343
/**
44-
* Indentation level of the line this bracket was in.
45-
*/
44+
* Indentation level of the line this bracket was in.
45+
*/
4646
int indentation;
4747

4848
/**
49-
* Type of this opening bracket.
50-
*/
49+
* Type of this opening bracket.
50+
*/
5151
bracket_type type;
5252

5353
/**
54-
* true if the indentation mode is "hanging",
55-
* that is, if a continuation must happen at the
56-
* indent level of this opening bracket.
57-
* The expected indentation level of contained content is stored
58-
* in the `indentation` member.
59-
*/
54+
* true if the indentation mode is "hanging",
55+
* that is, if a continuation must happen at the
56+
* indent level of this opening bracket.
57+
* The expected indentation level of contained content is stored
58+
* in the `indentation` member.
59+
*/
6060
bool hanging;
6161
};
6262

nyan/lexer/impl.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2017-2021 the nyan authors, LGPLv3+. See copying.md for legal info.
1+
// Copyright 2017-2025 the nyan authors, LGPLv3+. See copying.md for legal info.
22
#pragma once
33

44
#include <queue>
@@ -27,8 +27,8 @@ class Impl {
2727
Token generate_token();
2828

2929
/** @name FlexInterfaceMethods
30-
* Methods used by the flex generated lexer.
31-
*/
30+
* Methods used by the flex generated lexer.
31+
*/
3232
///@{
3333

3434
/** Advance the line position by match length. */

nyan/namespace_finder.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2017-2023 the nyan authors, LGPLv3+. See copying.md for legal info.
1+
// Copyright 2017-2025 the nyan authors, LGPLv3+. See copying.md for legal info.
22

33
#include "namespace_finder.h"
44

@@ -32,9 +32,11 @@ void NamespaceFinder::add_alias(const Token &alias,
3232

3333

3434
bool NamespaceFinder::check_conflict(const std::string &name) const {
35-
return (this->aliases.find(name) != std::end(this->aliases) // aliases
36-
// importing files from the root directory can be a problem too
37-
or this->imports.find(Namespace{std::vector<std::string>(), name}) != std::end(this->imports));
35+
return (
36+
// aliases must be unique
37+
this->aliases.find(name) != std::end(this->aliases)
38+
// importing files from the root directory can be a problem too
39+
or this->imports.find(Namespace{std::vector<std::string>(), name}) != std::end(this->imports));
3840
}
3941

4042

nyan/token_stream.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2016-2020 the nyan authors, LGPLv3+. See copying.md for legal info.
1+
// Copyright 2016-2025 the nyan authors, LGPLv3+. See copying.md for legal info.
22

33
#include "token_stream.h"
44

@@ -26,7 +26,7 @@ const TokenStream::tok_t *TokenStream::next() {
2626

2727
ret = &(*this->iter);
2828

29-
//std::cout << "tok: " << ret->str() << std::endl;
29+
// std::cout << "tok: " << ret->str() << std::endl;
3030

3131
this->iter = std::next(this->iter);
3232
return ret;

nyan/transaction.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2017-2020 the nyan authors, LGPLv3+. See copying.md for legal info.
1+
// Copyright 2017-2025 the nyan authors, LGPLv3+. See copying.md for legal info.
22

33
#include "transaction.h"
44

@@ -108,7 +108,7 @@ bool Transaction::add(const Object &patch) {
108108
// apply all patch parents in order (last the patch itself)
109109
target_obj->apply(
110110
// TODO: use the same mechanism as above to get only parent
111-
// obj states of base_state
111+
// obj states of base_state
112112
view->get_raw(patch_name, this->at),
113113
view->get_info(patch_name),
114114
patch_tracker);

nyan/util.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2016-2020 the nyan authors, LGPLv3+. See copying.md for legal info.
1+
// Copyright 2016-2025 the nyan authors, LGPLv3+. See copying.md for legal info.
22

33
#include "util.h"
44

@@ -18,8 +18,12 @@
1818
#include <mutex>
1919

2020
#define WIN32_LEAN_AND_MEAN
21+
// clang-format off
22+
// prevent clang-format from reordering these includes
23+
// DbgHelp.h must be included AFTER Windows.h
2124
#include <Windows.h>
2225
#include <DbgHelp.h>
26+
// clang-format on
2327

2428

2529
namespace {

0 commit comments

Comments
 (0)