From 6913c6d965d64481ed09fc06a43154f35e8bd914 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 13 Jan 2020 08:39:02 +0300 Subject: clang-format all the code --- server/lexer/lexer.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'server/lexer/lexer.cpp') 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::get_tokens() { std::vector 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 -- cgit v1.2.3