Apply changes applied from clang-modernize
Needed 1-2 cleanups by hand. 99% was automatic. * The version that ships with ubuntu 14.04 seems to not work. I had to build from scratch * Use cmake to generate the build commands that clang-modernize wants ```sh cmake -DCMAKE_EXPORT_COMPILE_COMMANDS:bool=true ../ChaiScript/ ``` * Use the clang-modernize tool. Note that you have to be pretty explicit about the include paths if you want it to also update your include files ```sh ../llvm-build/bin/clang-modernize ../ChaiScript/src/*.cpp -for-compilers=gcc-4.8 -include /home/jason/ChaiScript/include,/hjason/ChaiScript/include/chaiscript,/home/jason/ChaiScript/include/chaiscript/dispatchkit,/home/jason/ChaiScript/include/chaiscript/language -p compile_commands.json ``` * In my case, it left some unused `typedef`s behind, which I cleaned up.
This commit is contained in:
@@ -135,8 +135,8 @@ namespace chaiscript
|
||||
m_operator_matches.push_back(multiplication);
|
||||
|
||||
for ( int c = 0 ; c < detail::lengthof_alphabet ; ++c ) {
|
||||
for ( int a = 0 ; a < detail::max_alphabet ; a ++ ) {
|
||||
m_alphabet[a][c]=false;
|
||||
for (auto & elem : m_alphabet) {
|
||||
elem[c]=false;
|
||||
}
|
||||
}
|
||||
m_alphabet[detail::symbol_alphabet][static_cast<int>('?')]=true;
|
||||
@@ -212,9 +212,9 @@ namespace chaiscript
|
||||
* Shows the current stack of matched ast_nodes
|
||||
*/
|
||||
void show_match_stack() {
|
||||
for (unsigned int i = 0; i < m_match_stack.size(); ++i) {
|
||||
for (auto & elem : m_match_stack) {
|
||||
//debug_print(match_stack[i]);
|
||||
std::cout << m_match_stack[i]->to_string();
|
||||
std::cout << elem->to_string();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2062,8 +2062,8 @@ namespace chaiscript
|
||||
}
|
||||
|
||||
bool Operator_Helper(size_t t_precedence) {
|
||||
for (size_t i = 0; i < m_operator_matches[t_precedence].size(); ++i) {
|
||||
if (Symbol(m_operator_matches[t_precedence][i].c_str(), true)) {
|
||||
for (auto & elem : m_operator_matches[t_precedence]) {
|
||||
if (Symbol(elem.c_str(), true)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user