aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/server/lexer/lexer.cpp
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2020-01-13 08:39:02 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2020-01-13 08:42:08 +0300
commit6913c6d965d64481ed09fc06a43154f35e8bd914 (patch)
treefa8d3f360a651a31fba4b91a09a5bba505a904c4 /server/lexer/lexer.cpp
parentTravis: only run clang-format on master (diff)
downloadmath-server-6913c6d965d64481ed09fc06a43154f35e8bd914.tar.gz
math-server-6913c6d965d64481ed09fc06a43154f35e8bd914.zip
clang-format all the code
Diffstat (limited to 'server/lexer/lexer.cpp')
-rw-r--r--server/lexer/lexer.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/server/lexer/lexer.cpp b/server/lexer/lexer.cpp
index cf24189..9b4e500 100644
--- a/server/lexer/lexer.cpp
+++ b/server/lexer/lexer.cpp
@@ -3,9 +3,10 @@
// For details, see https://github.com/egor-tensin/math-server.
// Distributed under the MIT License.
+#include "lexer.hpp"
+
#include "details/parse.hpp"
#include "error.hpp"
-#include "lexer.hpp"
#include "token.hpp"
#include "token_type.hpp"
@@ -17,13 +18,9 @@
namespace math::server {
-Lexer::Lexer(const std::string_view& input)
- : Lexer{lexer::Input{input}} {
-}
-
-Lexer::Lexer(const lexer::Input& input)
- : m_input{input} {
+Lexer::Lexer(const std::string_view& input) : Lexer{lexer::Input{input}} {}
+Lexer::Lexer(const lexer::Input& input) : m_input{input} {
consume_token();
}
@@ -38,7 +35,7 @@ bool Lexer::for_each_token(const TokenProcessor& process) {
std::vector<Lexer::ParsedToken> Lexer::get_tokens() {
std::vector<ParsedToken> tokens;
- for_each_token([&tokens] (const ParsedToken& token) {
+ for_each_token([&tokens](const ParsedToken& token) {
tokens.emplace_back(token);
return true;
});
@@ -122,4 +119,4 @@ Lexer::ParsedToken Lexer::parse_token() const {
throw LexerError{"invalid input at: " + std::string{m_input.get_input()}};
}
-}
+} // namespace math::server