aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexers/LexCPP.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2018-04-14 09:58:22 +1000
committerNeil <nyamatongwe@gmail.com>2018-04-14 09:58:22 +1000
commit57d9c3bd2667d09ad2e75763a7a83a44684d5db5 (patch)
tree61012e4ba256faac51847d1343ce92ee6774fe17 /lexers/LexCPP.cxx
parentcc0af579fe23e74cce1fdc41ab53895cb18e396a (diff)
downloadscintilla-mirror-57d9c3bd2667d09ad2e75763a7a83a44684d5db5.tar.gz
Undo some changes that snuck in the last change set.
Diffstat (limited to 'lexers/LexCPP.cxx')
-rw-r--r--lexers/LexCPP.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx
index 510e66bbc..af9463a7e 100644
--- a/lexers/LexCPP.cxx
+++ b/lexers/LexCPP.cxx
@@ -13,8 +13,8 @@
#include <assert.h>
#include <ctype.h>
-#include <string>
#include <utility>
+#include <string>
#include <vector>
#include <map>
#include <algorithm>
@@ -229,8 +229,8 @@ struct PPDefinition {
std::string value;
bool isUndef;
std::string arguments;
- PPDefinition(Sci_Position line_, std::string key_, std::string value_, bool isUndef_ = false, std::string arguments_="") :
- line(line_), key(std::move(key_)), value(std::move(value_)), isUndef(isUndef_), arguments(std::move(arguments_)) {
+ PPDefinition(Sci_Position line_, const std::string &key_, const std::string &value_, bool isUndef_ = false, const std::string &arguments_="") :
+ line(line_), key(key_), value(value_), isUndef(isUndef_), arguments(arguments_) {
}
};
@@ -485,7 +485,7 @@ class LexerCPP : public ILexer4 {
struct SymbolValue {
std::string value;
std::string arguments;
- SymbolValue(std::string value_="", std::string arguments_="") : value(std::move(value_)), arguments(std::move(arguments_)) {
+ SymbolValue(const std::string &value_="", const std::string &arguments_="") : value(value_), arguments(arguments_) {
}
SymbolValue &operator = (const std::string &value_) {
value = value_;
@@ -1324,7 +1324,7 @@ void SCI_METHOD LexerCPP::Lex(Sci_PositionU startPos, Sci_Position length, int i
if (startValue < restOfLine.length())
value = restOfLine.substr(startValue);
preprocessorDefinitions[key] = SymbolValue(value, args);
- ppDefineHistory.emplace_back(lineCurrent, key, value, false, args);
+ ppDefineHistory.push_back(PPDefinition(lineCurrent, key, value, false, args));
definitionsChanged = true;
} else {
// Value
@@ -1335,7 +1335,7 @@ void SCI_METHOD LexerCPP::Lex(Sci_PositionU startPos, Sci_Position length, int i
if (OnlySpaceOrTab(value))
value = "1"; // No value defaults to 1
preprocessorDefinitions[key] = value;
- ppDefineHistory.emplace_back(lineCurrent, key, value);
+ ppDefineHistory.push_back(PPDefinition(lineCurrent, key, value));
definitionsChanged = true;
}
}
@@ -1346,7 +1346,7 @@ void SCI_METHOD LexerCPP::Lex(Sci_PositionU startPos, Sci_Position length, int i
if (tokens.size() >= 1) {
const std::string key = tokens[0];
preprocessorDefinitions.erase(key);
- ppDefineHistory.emplace_back(lineCurrent, key, "", true);
+ ppDefineHistory.push_back(PPDefinition(lineCurrent, key, "", true));
definitionsChanged = true;
}
}