aboutsummaryrefslogblamecommitdiffstatshomepage
path: root/server/lexer/details/parse.hpp
blob: 32215f7df405f43eb4f6c054be0aa4c117f2f9b0 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13












                                                               

                

                            




                                                                                     


                                                                 
                   







                                                                                         
                                           
// Copyright (c) 2020 Egor Tensin <Egor.Tensin@gmail.com>
// This file is part of the "math-server" project.
// For details, see https://github.com/egor-tensin/math-server.
// Distributed under the MIT License.

#pragma once

#include "../token_type.hpp"

#include <optional>
#include <string_view>

namespace math::server::lexer::details {
namespace impl {

// Exposed for benchmarking:

std::optional<double> std_parse_number(const std::string_view&, std::string_view&);
std::optional<double> std_parse_number(const std::string_view&);
std::optional<double> boost_parse_number(const std::string_view&, std::string_view&);
std::optional<double> boost_parse_number(const std::string_view&);

std::string_view std_parse_whitespace(const std::string_view&);
std::string_view boost_parse_whitespace(const std::string_view&);

} // namespace impl

// Exposed for testing:
std::string_view parse_whitespace(const std::string_view&);
std::optional<double> parse_number(const std::string_view&, std::string_view&);
std::optional<double> parse_number(const std::string_view&);
std::optional<token::Type> parse_const_token(const std::string_view&, std::string_view&);
std::optional<token::Type> parse_const_token(const std::string_view&);

} // namespace math::server::lexer::details