From 1ceb6a45dd867882caa8ade626492aeac9e4591c Mon Sep 17 00:00:00 2001 From: Nic30 Date: Thu, 7 Jul 2016 12:43:03 +0200 Subject: [PATCH] indent fix --- .../Cpp/runtime/src/atn/ATNDeserializer.cpp | 6 ++---- .../runtime/src/atn/LexerPopModeAction.cpp | 6 +++--- .../Cpp/runtime/src/atn/LexerSkipAction.cpp | 20 +++++++++---------- runtime/Cpp/runtime/src/atn/LexerSkipAction.h | 1 - 4 files changed, 15 insertions(+), 18 deletions(-) diff --git a/runtime/Cpp/runtime/src/atn/ATNDeserializer.cpp b/runtime/Cpp/runtime/src/atn/ATNDeserializer.cpp index db460340d..deab0e8cb 100755 --- a/runtime/Cpp/runtime/src/atn/ATNDeserializer.cpp +++ b/runtime/Cpp/runtime/src/atn/ATNDeserializer.cpp @@ -392,9 +392,7 @@ ATN ATNDeserializer::deserialize(const std::vector& input) { data2 = -1; } - auto la = lexerActionFactory(actionType, data1, data2); - assert(la != nullptr); - atn.lexerActions[i] = la; + atn.lexerActions[i] = lexerActionFactory(actionType, data1, data2); } } else { // for compatibility with older serialized ATNs, convert the old @@ -723,7 +721,7 @@ Ref ATNDeserializer::lexerActionFactory(LexerActionType type, int d return LexerMoreAction::getInstance(); case LexerActionType::POP_MODE: - return LexerPopModeAction::getInstance(); + return LexerPopModeAction::getInstance(); case LexerActionType::PUSH_MODE: return std::make_shared(data1); diff --git a/runtime/Cpp/runtime/src/atn/LexerPopModeAction.cpp b/runtime/Cpp/runtime/src/atn/LexerPopModeAction.cpp index aa7d80793..c9d99adf9 100755 --- a/runtime/Cpp/runtime/src/atn/LexerPopModeAction.cpp +++ b/runtime/Cpp/runtime/src/atn/LexerPopModeAction.cpp @@ -39,16 +39,16 @@ using namespace antlr4::atn; using namespace antlr4::misc; const Ref LexerPopModeAction::getInstance() { - static Ref instance = std::shared_ptr( + static Ref instance = std::shared_ptr( new LexerPopModeAction()); - return instance; + return instance; } LexerPopModeAction::LexerPopModeAction() { } LexerActionType LexerPopModeAction::getActionType() const { - return LexerActionType::POP_MODE; + return LexerActionType::POP_MODE; } bool LexerPopModeAction::isPositionDependent() const { diff --git a/runtime/Cpp/runtime/src/atn/LexerSkipAction.cpp b/runtime/Cpp/runtime/src/atn/LexerSkipAction.cpp index 1b4103ff8..e0a30c9e1 100755 --- a/runtime/Cpp/runtime/src/atn/LexerSkipAction.cpp +++ b/runtime/Cpp/runtime/src/atn/LexerSkipAction.cpp @@ -39,36 +39,36 @@ using namespace antlr4::atn; using namespace antlr4::misc; const Ref LexerSkipAction::getInstance() { - static Ref instance = std::shared_ptr( + static Ref instance = std::shared_ptr( new LexerSkipAction()); - return instance; + return instance; } LexerSkipAction::LexerSkipAction() { } LexerActionType LexerSkipAction::getActionType() const { - return LexerActionType::SKIP; + return LexerActionType::SKIP; } bool LexerSkipAction::isPositionDependent() const { - return false; + return false; } void LexerSkipAction::execute(Lexer *lexer) { - lexer->skip(); + lexer->skip(); } size_t LexerSkipAction::hashCode() const { - size_t hash = MurmurHash::initialize(); - hash = MurmurHash::update(hash, (size_t) getActionType()); - return MurmurHash::finish(hash, 1); + size_t hash = MurmurHash::initialize(); + hash = MurmurHash::update(hash, (size_t) getActionType()); + return MurmurHash::finish(hash, 1); } bool LexerSkipAction::operator ==(const LexerAction &obj) const { - return &obj == this; + return &obj == this; } std::string LexerSkipAction::toString() const { - return "skip"; + return "skip"; } diff --git a/runtime/Cpp/runtime/src/atn/LexerSkipAction.h b/runtime/Cpp/runtime/src/atn/LexerSkipAction.h index e179ea47b..8480101fd 100755 --- a/runtime/Cpp/runtime/src/atn/LexerSkipAction.h +++ b/runtime/Cpp/runtime/src/atn/LexerSkipAction.h @@ -33,7 +33,6 @@ #include "atn/LexerAction.h" #include "atn/LexerActionType.h" -#include namespace antlr4 { namespace atn {