1#ifndef TATOOINE_GL_SHADERSTAGEPARSER_H
2#define TATOOINE_GL_SHADERSTAGEPARSER_H
23 DLL_API
static auto parse(std::filesystem::path
const& path,
30 -> std::optional<GLSLVar>;
32 -> std::optional<std::string>;
35 template <
typename Stream>
36 static auto parse_stream(Stream& stream, std::vector<GLSLVar>& vars,
42 auto line_number = std::size_t{};
44 while (std::getline(stream,
line)) {
46 vars.push_back(parsed_var.value());
49 it.nested_include_trees().emplace_back(line_number, 0,
50 parsed_include.value(), it);
51 content.
string() +=
parse(folder + parsed_include.value(), vars,
52 it.nested_include_trees().back()).string();
58 it.num_lines() = line_number;
Definition: shaderstageparser.h:17
static DLL_API auto parse(shadersource const &source, std::vector< GLSLVar > &vars, include_tree &it) -> shadersource
static DLL_API auto parse(std::filesystem::path const &path, std::vector< GLSLVar > &vars, include_tree &it) -> shadersource
static std::regex const regex_var
Definition: shaderstageparser.h:19
static DLL_API auto parse_include(std::string const &line) -> std::optional< std::string >
static DLL_API auto parse_varname(std::string const &line) -> std::optional< GLSLVar >
static auto parse_stream(Stream &stream, std::vector< GLSLVar > &vars, include_tree &it, std::string const &folder="") -> shadersource
Definition: shaderstageparser.h:36
static std::regex const regex_include
Definition: shaderstageparser.h:20
Definition: ansiformat.h:6
Definition: includetree.h:11
Definition: shadersource.h:8
auto string() const -> auto const &
Definition: shadersource.h:26