added: two options to the config:

ezc_error_prefix (string)
        ezc_error_postfix (string)
        // prefix and postfix used when there is an error in Ezc patterns
        // default:
        // prefix:  "<!-- "
        // postfix: " -->"
added:  Ezc::Blocks to templates
added:  although patterns have pointers to functions and blocks cached
        the Ezc::Generator should use SetFunctions() and SetBlocks() method
        in order to correctly recognize variables (aliases)




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@978 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2014-10-19 21:20:09 +00:00
parent 5266a7e4e5
commit fb18b2238e
27 changed files with 1105 additions and 949 deletions

View File

@@ -45,6 +45,9 @@ namespace Winix
namespace TemplatesFunctions
{
extern EzcFun ezc_functions;
extern Ezc::Blocks ezc_blocks;
void HtmlEscapeFormTxt(HtmlTextStream & out, const std::wstring & in)
@@ -88,6 +91,28 @@ int was_enter = 0; // how many enteres there were before
void InitGenerator(EzcGen & gen)
{
gen.TrimWhite(gen_trim_white);
gen.SkipNewLine(gen_skip_new_line);
gen.RecognizeSpecialChars(gen_use_special_chars);
gen.SetMax(config->ezc_max_elements, config->ezc_max_loop_elements);
gen.SetCommentary(config->ezc_error_prefix, config->ezc_error_postfix);
/*
* although we have addresses to blocks and functions cached in patters
* we have to provide it here because they will be used for variables
* if a variable is an alias e.g. [def variable function]
*/
gen.SetBlocks(ezc_blocks);
gen.SetFunctions(ezc_functions);
}
void print_hour_min(Info & i, time_t time)
{
char buffer[100];