mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-03 00:46:55 +02:00
Fixes, more tests.
This commit is contained in:
@ -37,7 +37,4 @@ VERM
|
|||||||
[* n [factorial [- n 1]]]
|
[* n [factorial [- n 1]]]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
![print [factorial 8]]
|
![print [factorial 8]]
|
||||||
|
|
||||||
; example 7 --- ERM integration
|
|
||||||
![if [> 3 2] !!IF:M^Hello world^]
|
|
14
Data/s/testy.erm
Normal file
14
Data/s/testy.erm
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
ZVSE
|
||||||
|
!?PI;
|
||||||
|
!!VRv2777:S4;
|
||||||
|
!!DO1/0/5/1&v2777<>1:P0;
|
||||||
|
|
||||||
|
!?FU1;
|
||||||
|
!!VRv2778:Sx16%2;
|
||||||
|
!!IF&x16>3:M^Hello world number %X16! To duza liczba^;
|
||||||
|
!!IF&v2778==0&x16<=3:M^Hello world number %X16! To mala parzysta liczba^;
|
||||||
|
!!IF&v2778==1&x16<=3:M^Hello world number %X16! To mala nieparzysta liczba^;
|
||||||
|
|
||||||
|
!?PI;
|
||||||
|
!!VRz10:S^Composed hello ^;
|
||||||
|
!!IF:M^%Z10%%world%%, v2777=%V2777, v2778=%V2778!^;
|
@ -872,6 +872,7 @@ struct StringFormatter
|
|||||||
charsToReplace++;
|
charsToReplace++;
|
||||||
replaceWithWhat << erm->ermGlobalEnv->getQuickVar(msg[percentPos+2]);
|
replaceWithWhat << erm->ermGlobalEnv->getQuickVar(msg[percentPos+2]);
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
case 'X':
|
case 'X':
|
||||||
replaceWithWhat << erm->getVar("x", getNum()).getInt();
|
replaceWithWhat << erm->getVar("x", getNum()).getInt();
|
||||||
break;
|
break;
|
||||||
@ -1295,16 +1296,16 @@ struct ERMExpDispatch : boost::static_visitor<>
|
|||||||
}
|
}
|
||||||
void operator()(Treceiver const& trig) const
|
void operator()(Treceiver const& trig) const
|
||||||
{
|
{
|
||||||
HLP helper;
|
HLP helper;
|
||||||
|
//check condition
|
||||||
|
if(trig.condition.is_initialized())
|
||||||
|
{
|
||||||
|
if( !erm->checkCondition(trig.condition.get()) )
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(trig.name == "VR")
|
if(trig.name == "VR")
|
||||||
{
|
{
|
||||||
//check condition
|
|
||||||
if(trig.condition.is_initialized())
|
|
||||||
{
|
|
||||||
if( !erm->checkCondition(trig.condition.get()) )
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//perform operations
|
//perform operations
|
||||||
if(trig.identifier.is_initialized())
|
if(trig.identifier.is_initialized())
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user