-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attempt to process cell without semicolon #152
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
src/xinterpreter.cpp
Outdated
@@ -153,7 +154,9 @@ __get_cxx_version () | |||
auto errorlevel = 0; | |||
std::string ename; | |||
std::string evalue; | |||
bool compilation_result = false; | |||
//bool compilation_result = false; | |||
intptr_t output_value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'output_value' is not initialized [cppcoreguidelines-init-variables]
intptr_t output_value; | |
intptr_t output_value = 0; |
************************************************************************************/ | ||
|
||
#ifndef XCPP_MIME_INTERNAL_HPP | ||
#define XCPP_MIME_INTERNAL_HPP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: header guard does not follow preferred style [llvm-header-guard]
#define XCPP_MIME_INTERNAL_HPP | |
#ifndef GITHUB_WORKSPACE_SRC_XMIME_INTERNAL_HPP | |
#define GITHUB_WORKSPACE_SRC_XMIME_INTERNAL_HPP |
xmime_included = true; | ||
} | ||
|
||
intptr_t mimeReprV; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'mimeReprV' is not initialized [cppcoreguidelines-init-variables]
intptr_t mimeReprV; | |
intptr_t mimeReprV = 0; |
src/xmime_internal.hpp
Outdated
bool hadError = false; | ||
{ | ||
std::ostringstream oss; | ||
oss << reinterpret_cast<void*>(V); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast]
oss << reinterpret_cast<void*>(V);
^
src/xmime_internal.hpp
Outdated
bool hadError = false; | ||
{ | ||
std::ostringstream oss; | ||
oss << reinterpret_cast<void*>(V); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: integer to pointer cast pessimizes optimization opportunities [performance-no-int-to-ptr]
oss << reinterpret_cast<void*>(V);
^
src/xmime_internal.hpp
Outdated
} | ||
|
||
if (!hadError && mimeReprV != 0) { | ||
return *(nl::json*)mimeReprV; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: do not use C-style cast to convert between unrelated types [cppcoreguidelines-pro-type-cstyle-cast]
return *(nl::json*)mimeReprV;
^
src/xmime_internal.hpp
Outdated
} | ||
|
||
if (!hadError && mimeReprV != 0) { | ||
return *(nl::json*)mimeReprV; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: integer to pointer cast pessimizes optimization opportunities [performance-no-int-to-ptr]
return *(nl::json*)mimeReprV;
^
return *(nl::json*)mimeReprV; | ||
} else { | ||
return nl::json::object(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: do not use 'else' after 'return' [llvm-else-after-return]
} | |
} return nl::json::object(); | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
if (current != 0) | ||
{ | ||
current = 0; | ||
result.push_back(""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use emplace_back instead of push_back [modernize-use-emplace]
result.push_back(""); | |
result.emplace_back(""); |
if (current != 1) | ||
{ | ||
current = 1; | ||
result.push_back(""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use emplace_back instead of push_back [modernize-use-emplace]
result.push_back(""); | |
result.emplace_back(""); |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #152 +/- ##
=======================================
Coverage ? 79.82%
=======================================
Files ? 18
Lines ? 684
Branches ? 70
=======================================
Hits ? 546
Misses ? 138
Partials ? 0
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
inline nl::json mime_repr(intptr_t V) | ||
{ | ||
// Return a JSON mime bundle representing the specified value. | ||
void* value_ptr = reinterpret_cast<void*>(V); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast]
void* value_ptr = reinterpret_cast<void*>(V);
^
inline nl::json mime_repr(intptr_t V) | ||
{ | ||
// Return a JSON mime bundle representing the specified value. | ||
void* value_ptr = reinterpret_cast<void*>(V); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: integer to pointer cast pessimizes optimization opportunities [performance-no-int-to-ptr]
void* value_ptr = reinterpret_cast<void*>(V);
^
|
||
std::string codeString = code.str(); | ||
|
||
mimeReprV = Cpp::Evaluate(codeString.c_str(), &hadError); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: Value stored to 'mimeReprV' is never read [clang-analyzer-deadcode.DeadStores]
mimeReprV = Cpp::Evaluate(codeString.c_str(), &hadError);
^
Additional context
src/xmime_internal.hpp:50: Value stored to 'mimeReprV' is never read
mimeReprV = Cpp::Evaluate(codeString.c_str(), &hadError);
^
mimeReprV = Cpp::Evaluate(codeString.c_str(), &hadError); | ||
} | ||
|
||
void* mimeReprV_ptr = reinterpret_cast<void*>(V); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast]
void* mimeReprV_ptr = reinterpret_cast<void*>(V);
^
mimeReprV = Cpp::Evaluate(codeString.c_str(), &hadError); | ||
} | ||
|
||
void* mimeReprV_ptr = reinterpret_cast<void*>(V); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: integer to pointer cast pessimizes optimization opportunities [performance-no-int-to-ptr]
void* mimeReprV_ptr = reinterpret_cast<void*>(V);
^
|
||
if (!hadError && mimeReprV_ptr) | ||
{ | ||
return *(nl::json*) mimeReprV_ptr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: do not use C-style cast to convert between unrelated types [cppcoreguidelines-pro-type-cstyle-cast]
return *(nl::json*) mimeReprV_ptr;
^
else | ||
{ | ||
return nl::json::object(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: do not use 'else' after 'return' [llvm-else-after-return]
} | |
return nl::json::object(); | |
std::ostringstream code; | ||
code << "using xcpp::mime_bundle_repr;"; | ||
code << "mime_bundle_repr("; | ||
// code << "*(" << getTypeAsString(V); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented out.
Description
Through this PR I am trying to facilitate returning output while the semicolon is being omitted.
Type of change
Please tick all options which are relevant.