Skip to content

Commit 50a2709

Browse files
committed
formatting changes
1 parent 9f44a84 commit 50a2709

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/xinspect.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,15 @@ namespace xcpp
5656
static unsigned long long var_count = 0;
5757

5858
if (auto *type = Cpp::GetType(expression))
59+
{
5960
return Cpp::GetQualifiedName(type);
61+
}
6062

6163
std::string id = "__Xeus_GetType_" + std::to_string(var_count++);
6264
std::string using_clause = "using " + id + " = __typeof__(" + expression + ");\n";
6365

64-
if (!Cpp::Declare(using_clause.c_str(), false)) {
66+
if (!Cpp::Declare(using_clause.c_str(), false))
67+
{
6568
Cpp::TCppScope_t lookup = Cpp::GetNamed(id, nullptr);
6669
Cpp::TCppType_t lookup_ty = Cpp::GetTypeFromScope(lookup);
6770
return Cpp::GetQualifiedCompleteName(Cpp::GetCanonicalType(lookup_ty));
@@ -72,7 +75,8 @@ namespace xcpp
7275
static nl::json read_tagconfs(const char* path)
7376
{
7477
nl::json result = nl::json::array();
75-
for (const auto &entry: std::filesystem::directory_iterator(path)) {
78+
for (const auto &entry: std::filesystem::directory_iterator(path))
79+
{
7680
if (entry.path().extension() != ".json")
7781
continue;
7882
std::ifstream i(entry.path());
@@ -83,12 +87,13 @@ namespace xcpp
8387
return result;
8488
}
8589

86-
std::pair<bool, std::smatch> is_inspect_request(const std::string& code,
87-
const std::regex& re)
90+
std::pair<bool, std::smatch> is_inspect_request(const std::string& code, const std::regex& re)
8891
{
8992
std::smatch inspect;
9093
if (std::regex_search(code, inspect, re))
94+
{
9195
return std::make_pair(true, inspect);
96+
}
9297
return std::make_pair(false, inspect);
9398
}
9499

@@ -248,4 +253,3 @@ namespace xcpp
248253
return std::make_unique<xintrospection>(*this);
249254
}
250255
}
251-

src/xinspect.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ namespace xcpp
4444

4545
static nl::json read_tagconfs(const char* path);
4646

47-
std::pair<bool, std::smatch> is_inspect_request(const std::string& code,
48-
const std::regex& re);
47+
std::pair<bool, std::smatch> is_inspect_request(const std::string& code, const std::regex& re);
4948

5049
void inspect(const std::string& code, nl::json& kernel_res);
5150

5251
class xintrospection : public xpreamble
5352
{
5453
public:
54+
5555
using xpreamble::pattern;
5656
const std::string spattern = R"(^\?)";
5757

0 commit comments

Comments
 (0)