let filters make use of Var<> objects
This commit is contained in:
parent
e2a8729a2f
commit
2f140686d7
|
@ -267,7 +267,7 @@ private:
|
||||||
// as std::wostringstream are not copyable
|
// as std::wostringstream are not copyable
|
||||||
std::vector<StreamType*> filter_tab;
|
std::vector<StreamType*> filter_tab;
|
||||||
std::vector<StreamType*> ezc_frame_stack_tab;
|
std::vector<StreamType*> ezc_frame_stack_tab;
|
||||||
const StreamType empty_stream;
|
StreamType empty_stream;
|
||||||
|
|
||||||
// temporary streams used in [if..] [for...] or [def ...]
|
// temporary streams used in [if..] [for...] or [def ...]
|
||||||
// or if output_stream is null and an ezc function should be called
|
// or if output_stream is null and an ezc function should be called
|
||||||
|
@ -391,7 +391,7 @@ private:
|
||||||
bool Call(Item::Function & item_fun,
|
bool Call(Item::Function & item_fun,
|
||||||
const std::wstring * fun_name,
|
const std::wstring * fun_name,
|
||||||
Var<StreamType> & result,
|
Var<StreamType> & result,
|
||||||
const StreamType & in_stream);
|
StreamType & in_stream);
|
||||||
|
|
||||||
bool Call(Item::Function & item_fun, Var<StreamType> & result);
|
bool Call(Item::Function & item_fun, Var<StreamType> & result);
|
||||||
|
|
||||||
|
@ -2083,7 +2083,7 @@ bool Generator<StreamType, is_pikotools_stream, is_autoescape_stream>::Call(
|
||||||
Item::Function & item_fun,
|
Item::Function & item_fun,
|
||||||
const std::wstring * fun_name,
|
const std::wstring * fun_name,
|
||||||
Var<StreamType> & result,
|
Var<StreamType> & result,
|
||||||
const StreamType & in_stream)
|
StreamType & in_stream)
|
||||||
{
|
{
|
||||||
//FindHelperOld find_helper;
|
//FindHelperOld find_helper;
|
||||||
std::vector<Var<StreamType>> parameters;
|
std::vector<Var<StreamType>> parameters;
|
||||||
|
@ -2124,6 +2124,7 @@ std::vector<Var<StreamType>> parameters;
|
||||||
|
|
||||||
if( fun_child.is_function )
|
if( fun_child.is_function )
|
||||||
{
|
{
|
||||||
|
empty_stream.clear();
|
||||||
Call(fun_child, nullptr, parameters[i], empty_stream);
|
Call(fun_child, nullptr, parameters[i], empty_stream);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -2134,6 +2135,8 @@ std::vector<Var<StreamType>> parameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
Var<StreamType> empty_input; // fix me for filters
|
Var<StreamType> empty_input; // fix me for filters
|
||||||
|
empty_input.type = Var<StreamType>::TYPE_STREAM;
|
||||||
|
empty_input.stream = in_stream; // IMPROVEME don't copy here streams, let Var::stream be a pointer?
|
||||||
|
|
||||||
FindHelper find_helper(*name, item_fun.fields, parameters);
|
FindHelper find_helper(*name, item_fun.fields, parameters);
|
||||||
find_helper.result = &result;
|
find_helper.result = &result;
|
||||||
|
@ -2150,6 +2153,7 @@ template<class StreamType, bool is_pikotools_stream, bool is_autoescape_stream>
|
||||||
bool Generator<StreamType, is_pikotools_stream, is_autoescape_stream>::Call(Item::Function & item_fun, Var<StreamType> & result)
|
bool Generator<StreamType, is_pikotools_stream, is_autoescape_stream>::Call(Item::Function & item_fun, Var<StreamType> & result)
|
||||||
{
|
{
|
||||||
//return Call(item_fun, nullptr, stream_temp1, true, result, empty_stream);
|
//return Call(item_fun, nullptr, stream_temp1, true, result, empty_stream);
|
||||||
|
empty_stream.clear();
|
||||||
return Call(item_fun, nullptr, result, empty_stream);
|
return Call(item_fun, nullptr, result, empty_stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2533,6 +2537,7 @@ void Generator<StreamType, is_pikotools_stream, is_autoescape_stream>::MakeTextF
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Var<StreamType> result;
|
Var<StreamType> result;
|
||||||
|
empty_stream.clear();
|
||||||
|
|
||||||
if( Call(item.function, nullptr, result, empty_stream) )
|
if( Call(item.function, nullptr, result, empty_stream) )
|
||||||
{
|
{
|
||||||
|
@ -2666,6 +2671,7 @@ void Generator<StreamType, is_pikotools_stream, is_autoescape_stream>::MakeTextF
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//Call(item.function, nullptr, stream_temp1, true, result, empty_stream);
|
//Call(item.function, nullptr, stream_temp1, true, result, empty_stream);
|
||||||
|
empty_stream.clear();
|
||||||
Call(item.function, nullptr, result, empty_stream);
|
Call(item.function, nullptr, result, empty_stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2703,6 +2709,7 @@ void Generator<StreamType, is_pikotools_stream, is_autoescape_stream>::MakeTextD
|
||||||
{
|
{
|
||||||
// call function
|
// call function
|
||||||
//if( Call(fun, nullptr, stream_temp_define, true, var, empty_stream) )
|
//if( Call(fun, nullptr, stream_temp_define, true, var, empty_stream) )
|
||||||
|
empty_stream.clear();
|
||||||
if( Call(fun, nullptr, var, empty_stream) )
|
if( Call(fun, nullptr, var, empty_stream) )
|
||||||
{
|
{
|
||||||
//CopyStreamToString(stream_temp_define, var.str);
|
//CopyStreamToString(stream_temp_define, var.str);
|
||||||
|
@ -2975,6 +2982,7 @@ void Generator<StreamType, is_pikotools_stream, is_autoescape_stream>::MakeTextR
|
||||||
// this Call() sets last_res which is used later when we return to CallBlock()
|
// this Call() sets last_res which is used later when we return to CallBlock()
|
||||||
//Call(item.function, nullptr, stream_temp1, false, result, empty_stream);
|
//Call(item.function, nullptr, stream_temp1, false, result, empty_stream);
|
||||||
//ClearStream(stream_temp1);
|
//ClearStream(stream_temp1);
|
||||||
|
empty_stream.clear();
|
||||||
Call(item.function, nullptr, result, empty_stream);
|
Call(item.function, nullptr, result, empty_stream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue