aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/coreSQLiteStudio/parser/token.cpp
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2014-12-14 08:24:32 -0500
committerLibravatarUnit 193 <unit193@ubuntu.com>2014-12-14 08:24:32 -0500
commite571839e140139a6a819077e94cf8cc01c13b29f (patch)
tree8263635257cfb5ed979a584a958103b700bf31e7 /SQLiteStudio3/coreSQLiteStudio/parser/token.cpp
parent407eac41f46936e3f346bb5a964a682e578b4237 (diff)
parent89214766d8e3e7b8dd749a1fa18a5b9727f5010d (diff)
Merge tag 'upstream/3.0.0'
Upstream version 3.0.0 # gpg: Signature made Sun 14 Dec 2014 08:24:31 AM EST using RSA key ID EBE9BD91 # gpg: Good signature from "Unit 193 <unit193@gmail.com>" # gpg: aka "Unit 193 <unit193@ninthfloor.org>" # gpg: aka "Unit 193 <unit193@ubuntu.com>"
Diffstat (limited to 'SQLiteStudio3/coreSQLiteStudio/parser/token.cpp')
-rw-r--r--SQLiteStudio3/coreSQLiteStudio/parser/token.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/SQLiteStudio3/coreSQLiteStudio/parser/token.cpp b/SQLiteStudio3/coreSQLiteStudio/parser/token.cpp
index 5e186dd..d3e05f1 100644
--- a/SQLiteStudio3/coreSQLiteStudio/parser/token.cpp
+++ b/SQLiteStudio3/coreSQLiteStudio/parser/token.cpp
@@ -434,40 +434,50 @@ bool TokenList::remove(Token::Type type)
return true;
}
-void TokenList::trimLeft()
+TokenList& TokenList::trimLeft()
{
while (size() > 0 && first()->isWhitespace())
removeFirst();
+
+ return *this;
}
-void TokenList::trimRight()
+TokenList& TokenList::trimRight()
{
while (size() > 0 && last()->isWhitespace())
removeLast();
+
+ return *this;
}
-void TokenList::trim()
+TokenList& TokenList::trim()
{
trimLeft();
trimRight();
+ return *this;
}
-void TokenList::trimLeft(Token::Type type, const QString& alsoTrim)
+TokenList& TokenList::trimLeft(Token::Type type, const QString& alsoTrim)
{
while (size() > 0 && (first()->isWhitespace() || (first()->type == type && first()->value == alsoTrim)))
removeFirst();
+
+ return *this;
}
-void TokenList::trimRight(Token::Type type, const QString& alsoTrim)
+TokenList& TokenList::trimRight(Token::Type type, const QString& alsoTrim)
{
while (size() > 0 && (last()->isWhitespace() || (last()->type == type && last()->value == alsoTrim)))
removeLast();
+
+ return *this;
}
-void TokenList::trim(Token::Type type, const QString& alsoTrim)
+TokenList& TokenList::trim(Token::Type type, const QString& alsoTrim)
{
trimLeft(type, alsoTrim);
trimRight(type, alsoTrim);
+ return *this;
}
TokenList TokenList::filter(Token::Type type) const