changed: a function can have a postfix now e.g. [my_function:my_postfix]
this will be mainly used in conjuction with [for ...] statements
[for my_function:xxx]
[for my_function]
[my_function_value]
[my_function_valu:xxx] (references the first loop)
[end]
[end]
added: to FunInfo<>: a reference to current item from a pattern (const Item & item)
similary on the stack is added a pointer to an item
by having this reference you can compare a function's name and its postfix
added methods:
Stack * FindLastFor(const std::wstring & name);
Stack * FindLastFor(const std::wstring & name, const std::wstring & postfix);
template<class FunUserObject> FunUserObject * FindUserObject(const std::wstring & function_name, Stack ** ezc_stack = 0);
git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@1038 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
+5
-4
@@ -963,12 +963,12 @@ void Generator<StreamType>::CallFunction(typename Functions<StreamType>::UserFun
|
||||
{
|
||||
if( parameters.empty() )
|
||||
{
|
||||
FunInfo<StreamType> info(out_stream, parameters, empty, in_stream, stack_tab[stack_index-1]);
|
||||
FunInfo<StreamType> info(out_stream, parameters, empty, in_stream, stack_tab[stack_index-1], *stack_tab[stack_index-1].item);
|
||||
CallFunction(function, info);
|
||||
}
|
||||
else
|
||||
{
|
||||
FunInfo<StreamType> info(out_stream, parameters, parameters[0].str, in_stream, stack_tab[stack_index-1]);
|
||||
FunInfo<StreamType> info(out_stream, parameters, parameters[0].str, in_stream, stack_tab[stack_index-1], *stack_tab[stack_index-1].item);
|
||||
CallFunction(function, info);
|
||||
}
|
||||
}
|
||||
@@ -1008,12 +1008,12 @@ void Generator<StreamType>::CallObject(BaseObj<StreamType> * base_obj,
|
||||
{
|
||||
if( parameters.empty() )
|
||||
{
|
||||
FunInfo<StreamType> info(out_stream, parameters, empty, in_stream, stack_tab[stack_index-1]);
|
||||
FunInfo<StreamType> info(out_stream, parameters, empty, in_stream, stack_tab[stack_index-1], *stack_tab[stack_index-1].item);
|
||||
CallObject(base_obj, method_index, info);
|
||||
}
|
||||
else
|
||||
{
|
||||
FunInfo<StreamType> info(out_stream, parameters, parameters[0].str, in_stream, stack_tab[stack_index-1]);
|
||||
FunInfo<StreamType> info(out_stream, parameters, parameters[0].str, in_stream, stack_tab[stack_index-1], *stack_tab[stack_index-1].item);
|
||||
CallObject(base_obj, method_index, info);
|
||||
}
|
||||
}
|
||||
@@ -1734,6 +1734,7 @@ void Generator<StreamType>::MakeText(Item & item)
|
||||
is_generating_filter = false;
|
||||
|
||||
stack_tab[stack_index-1].Clear();
|
||||
stack_tab[stack_index-1].item = &item;
|
||||
|
||||
if ( item.type == Item::item_text ) MakeItemText(item);
|
||||
else if( item.type == Item::item_container )MakeTextContainer(item);
|
||||
|
||||
Reference in New Issue
Block a user