Euphoria
|
texttemplate.cc
Go to the documentation of this file.
140 void build_string(Defines* /*defines*/, StringBuilder* out, TemplateErrorList* /*error*/) override
760 while(!errors->has_errors() && reader->has_more() && (!expect_end || reader->peek().type != TokenType::end))
std::string get_first_chars_with_ellipsis(const std::string &str, unsigned int count)
Definition: stringutils.cc:40
Definition: argparse.cc:45
std::shared_ptr< TemplateNodeEval > parse_eval(TokenReader *reader, TemplateErrorList *errors, const io::FilePath &file, io::FileSystem *)
Definition: texttemplate.cc:574
@ end_of_file
@ ident
@ if_def
@ string
@ include
std::vector< Token > tokenize(const std::string &content, TemplateErrorList *error, const io::FilePath &file)
Definition: texttemplate.cc:332
@ end
std::shared_ptr< TemplateNodeIfdef > parse_ifdef(TokenReader *reader, TemplateErrorList *errors, const io::FilePath &file, io::FileSystem *fs)
Definition: texttemplate.cc:647
std::shared_ptr< TemplateNodeList > parse_include(TokenReader *reader, TemplateErrorList *errors, const io::FilePath &file, io::FileSystem *fs)
Definition: texttemplate.cc:678
std::shared_ptr< TemplateNodeSet > parse_set(TokenReader *reader, TemplateErrorList *errors, const io::FilePath &file, io::FileSystem *)
Definition: texttemplate.cc:603
void load_from_filesystem_to_node_list(io::FileSystem *fs, const io::FilePath &path, TemplateErrorList *error, std::shared_ptr< TemplateNodeList > *nodes)
Definition: texttemplate.cc:522
std::shared_ptr< TemplateNodeString > parse_text(TokenReader *reader, TemplateErrorList *, const io::FilePath &, io::FileSystem *)
Definition: texttemplate.cc:556
void parse_template_list(std::shared_ptr< TemplateNodeList > *nodes, TokenReader *reader, TemplateErrorList *errors, const io::FilePath &file, bool expect_end, io::FileSystem *fs)
Definition: texttemplate.cc:747
std::optional< DirPath > resolve_relative(const DirPath &base)
Definition: vfs_path.cc:349
String utility functions.
Definition: stringbuilder.h:9
std::string to_string()
Complete the builder and return the resulting string.
Definition: stringbuilder.cc:67
StringBuilder & add_string(const std::string &str)
Definition: stringbuilder.cc:43
~CompiledTextTemplate()
std::string build_string(const Defines &defines)
Definition: texttemplate.cc:840
std::shared_ptr< TemplateNodeList > nodes
Definition: texttemplate.h:54
CompiledTextTemplate(const std::string &text)
Definition: texttemplate.cc:820
Definition: texttemplate.h:18
std::string get_value(const std::string &name) const
Definition: texttemplate.cc:33
Defines()
bool is_defined(const std::string &name) const
Definition: texttemplate.cc:25
void set(const std::string &name, const std::string &value)
Definition: texttemplate.cc:53
Definition: texttemplate.h:31
void add_error(const std::optional< io::FilePath > &file, int line, int column, const std::string &error)
Definition: texttemplate.cc:74
TemplateErrorList()
std::string get_combined_errors() const
Definition: texttemplate.cc:92
Definition: texttemplate.cc:219
TemplateNodeEval(std::string n)
Definition: texttemplate.cc:222
void build_string(Defines *defines, StringBuilder *out, TemplateErrorList *error) override
Definition: texttemplate.cc:227
Definition: texttemplate.cc:193
void build_string(Defines *defines, StringBuilder *out, TemplateErrorList *error) override
Definition: texttemplate.cc:204
std::shared_ptr< TemplateNode > node
Definition: texttemplate.cc:195
TemplateNodeIfdef(std::string aname, std::shared_ptr< TemplateNode > anode)
Definition: texttemplate.cc:197
Definition: texttemplate.cc:152
void build_string(Defines *defines, StringBuilder *out, TemplateErrorList *error) override
Definition: texttemplate.cc:162
TemplateNodeList()=default
std::vector< std::shared_ptr< TemplateNode > > nodes
Definition: texttemplate.cc:153
void add(const std::shared_ptr< TemplateNode > &node)
Definition: texttemplate.cc:157
void build_string(core::Defines *defines, StringBuilder *out, TemplateErrorList *error) override
Definition: texttemplate.cc:180
TemplateNodeScopedList()=default
Definition: texttemplate.cc:251
TemplateNodeSet(std::string aname, std::string avalue)
Definition: texttemplate.cc:255
void build_string(Defines *defines, StringBuilder *out, TemplateErrorList *) override
Definition: texttemplate.cc:261
Definition: texttemplate.cc:132
void build_string(Defines *, StringBuilder *out, TemplateErrorList *) override
Definition: texttemplate.cc:140
TemplateNodeString(std::string t)
Definition: texttemplate.cc:135
Definition: texttemplate.cc:110
void operator=(const TemplateNode &)=delete
virtual void build_string(Defines *defines, StringBuilder *out, TemplateErrorList *error)=0
void operator=(TemplateNode &&)=delete
TemplateNode(const TemplateNode &)=delete
TemplateNode()=default
TemplateNode(TemplateNode &&)=delete
virtual ~TemplateNode()=default
static TextfileParser from_string(const std::string &str)
Definition: textfileparser.cc:96
Definition: texttemplate.cc:457
TokenReader(const std::vector< Token > &input)
Definition: texttemplate.cc:462
Definition: texttemplate.cc:309
Token(TokenType t, int l, int c, std::string v="")
Definition: texttemplate.cc:315
Definition: vfs_path.h:36
static std::optional< FilePath > from_script(const std::string &path)
apply only minor changes, return null on invalid
Definition: vfs_path.cc:46
Definition: vfs.h:74
std::optional< std::string > read_file_to_string(const FilePath &path)
Definition: vfs.cc:171
#define CASE(V)