add cmp ezc function
This commit is contained in:
parent
944560dd2b
commit
b615dc7e6e
|
@ -115,8 +115,6 @@ void esc_tex(wchar_t c, pt::WTextStream & str)
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void fil_tex(Ezc::FunInfo<MyStream> & env)
|
||||
{
|
||||
auto i = env.in.begin();
|
||||
|
@ -127,6 +125,22 @@ void fil_tex(Ezc::FunInfo<MyStream> & env)
|
|||
}
|
||||
}
|
||||
|
||||
void cmp(Ezc::FunInfo<MyStream> & env)
|
||||
{
|
||||
if( env.params.size() >= 2 )
|
||||
{
|
||||
env.res = true;
|
||||
|
||||
for(size_t a=0 ; a < env.params.size() - 1 ; ++a)
|
||||
{
|
||||
if( env.params[a].str != env.params[a+1].str )
|
||||
{
|
||||
env.res = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool generate(const pt::Space & input_options, pt::Space & schema)
|
||||
|
@ -161,6 +175,7 @@ bool generate(const pt::Space & input_options, pt::Space & schema)
|
|||
}
|
||||
|
||||
functions.Insert("fil_tex", fil_tex);
|
||||
functions.Insert("cmp", cmp);
|
||||
|
||||
parser.Directory(dir);
|
||||
parser.SetBlocks(blocks);
|
||||
|
|
Loading…
Reference in New Issue