Skip to content

Commit 44ef5ff

Browse files
committed
Reformat code base with new clang-format settings.
1 parent a7146e5 commit 44ef5ff

File tree

13 files changed

+46
-40
lines changed

13 files changed

+46
-40
lines changed

nyan/ast.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,8 @@ void ASTObject::ast_members(TokenStream &tokens) {
300300
bool object_next = false;
301301
auto lookahead = tokens.next();
302302

303-
if (lookahead->type == token_type::OPERATOR // value assignment
304-
or lookahead->type == token_type::COLON // type declaration
303+
if (lookahead->type == token_type::OPERATOR // value assignment
304+
or lookahead->type == token_type::COLON // type declaration
305305
or lookahead->type == token_type::DOT) { // inherited member access (e.g. Parent.some_member)
306306
object_next = false;
307307
}

nyan/compiler.h

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
#pragma once
44

@@ -34,7 +34,7 @@
3434
#define NYANAPI __declspec(dllexport) // library is built
3535
#else
3636
#define NYANAPI __declspec(dllimport) // library is used
37-
#endif /* nyan_EXPORTS */
37+
#endif /* nyan_EXPORTS */
3838
#else
3939
#define NYANAPI __attribute__((visibility("default")))
4040
#endif

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/error.h

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
#pragma once
33

44

@@ -20,7 +20,7 @@ namespace nyan {
2020
*/
2121
struct backtrace_symbol {
2222
std::string functionname; // empty if unknown
23-
void *pc; // nullptr if unknown
23+
void *pc; // nullptr if unknown
2424
};
2525

2626

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);

0 commit comments

Comments
 (0)