added filters:

a new statement [filter]
 syntax:
 [filter funcion_name]....[end]
 everything which is between [filter] and [end] is processed normally and
 at the end it is passed to the function (function_name)
 FunInfo struct has 'in' input stream now



git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@333 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2011-01-26 12:42:49 +00:00
parent 3c85fa1a75
commit 542e50d757
6 changed files with 269 additions and 99 deletions
+14 -1
View File
@@ -827,6 +827,17 @@ void Pattern::ReadDirectiveDef(Item & item)
}
void Pattern::ReadDirectiveFilter(Item & item)
{
item.type = Item::item_filter;
ReadFunctions(item);
if( item.functions.size() != 1 )
item.type = Item::item_err;
}
// user defined directive
void Pattern::ReadDirectiveNormal(const std::wstring & name, Item & item)
{
@@ -860,6 +871,7 @@ std::wstring name;
else if( name == L"for" ) ReadDirectiveFor(item);
else if( name == L"include" ) ReadDirectiveInclude(item);
else if( name == L"def" ) ReadDirectiveDef(item);
else if( name == L"filter" ) ReadDirectiveFilter(item);
else if( name == L"#" ) ReadDirectiveComment(item);
else
ReadDirectiveNormal(name, item);
@@ -1009,7 +1021,8 @@ void Pattern::CreateTree(Item & item)
pitem->type == Item::item_isno )
CreateTreeReadIf(*pitem);
if( pitem->type == Item::item_for )
if( pitem->type == Item::item_for ||
pitem->type == Item::item_filter )
CreateTreeReadFor(*pitem);
if( pitem->type == Item::item_include )