diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2020-01-03 00:58:56 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2020-01-03 00:58:56 +0300 |
commit | ad748449fb2d6154f0d7677f2a933aa29919075b (patch) | |
tree | 11278ebbf3890823fb6bf85014ade1b62921ff6e /server/lexer/details/parse.hpp | |
parent | update cmake-common (diff) | |
download | math-server-ad748449fb2d6154f0d7677f2a933aa29919075b.tar.gz math-server-ad748449fb2d6154f0d7677f2a933aa29919075b.zip |
lexer: split out testing-exposed functions
Diffstat (limited to 'server/lexer/details/parse.hpp')
-rw-r--r-- | server/lexer/details/parse.hpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/server/lexer/details/parse.hpp b/server/lexer/details/parse.hpp new file mode 100644 index 0000000..72da234 --- /dev/null +++ b/server/lexer/details/parse.hpp @@ -0,0 +1,22 @@ +// 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 { + +// 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&); + +} |