@@ -730,6 +730,7 @@ private object ScriptEvaluate(string script, ref bool valueReturned, ref bool br
730
730
IfBlockEvaluatedState ifBlockEvaluatedState = IfBlockEvaluatedState . NoBlockEvaluated ;
731
731
TryBlockEvaluatedState tryBlockEvaluatedState = TryBlockEvaluatedState . NoBlockEvaluated ;
732
732
List < List < string > > ifElseStatementsList = new List < List < string > > ( ) ;
733
+ List < List < string > > tryStatementsList = new List < List < string > > ( ) ;
733
734
734
735
object ManageJumpStatementsOrExpressionEval ( string expression )
735
736
{
@@ -819,6 +820,20 @@ void ExecuteIfList()
819
820
}
820
821
}
821
822
823
+ void ExecuteTryList ( )
824
+ {
825
+ if ( tryStatementsList . Count > 0 )
826
+ {
827
+
828
+ }
829
+ }
830
+
831
+ void ExecuteBlocksStacks ( )
832
+ {
833
+ ExecuteTryList ( ) ;
834
+ ExecuteIfList ( ) ;
835
+ }
836
+
822
837
int i = 0 ;
823
838
824
839
while ( ! isReturn && ! isBreak && ! isContinue && i < script . Length )
@@ -903,16 +918,19 @@ void ExecuteIfList()
903
918
}
904
919
else
905
920
{
906
- ExecuteIfList ( ) ;
921
+ ExecuteBlocksStacks ( ) ;
907
922
908
923
if ( keyword . Equals ( "if" ) )
909
924
{
910
925
ifElseStatementsList . Add ( new List < string > ( ) { keywordAttributes [ 0 ] , subScript } ) ;
911
926
ifBlockEvaluatedState = IfBlockEvaluatedState . If ;
927
+ tryBlockEvaluatedState = TryBlockEvaluatedState . NoBlockEvaluated ;
912
928
}
913
929
else if ( keyword . Equals ( "try" ) )
914
930
{
915
-
931
+ tryStatementsList . Add ( new List < string > ( ) { subScript } ) ;
932
+ ifBlockEvaluatedState = IfBlockEvaluatedState . NoBlockEvaluated ;
933
+ tryBlockEvaluatedState = TryBlockEvaluatedState . Try ;
916
934
}
917
935
else if ( keyword . Equals ( "do" ) )
918
936
{
@@ -1040,7 +1058,7 @@ void forAction(int index)
1040
1058
}
1041
1059
else
1042
1060
{
1043
- ExecuteIfList ( ) ;
1061
+ ExecuteBlocksStacks ( ) ;
1044
1062
1045
1063
if ( TryParseStringAndParenthisAndCurlyBrackets ( ref i ) ) { }
1046
1064
else if ( script . Length - i > 2 && script . Substring ( i , 3 ) . Equals ( "';'" ) )
@@ -1061,7 +1079,7 @@ void forAction(int index)
1061
1079
if ( ! script . Substring ( startOfExpression ) . Trim ( ) . Equals ( string . Empty ) && ! isReturn && ! isBreak && ! isContinue )
1062
1080
throw new ExpressionEvaluatorSyntaxErrorException ( "A [;] character is missing." ) ;
1063
1081
1064
- ExecuteIfList ( ) ;
1082
+ ExecuteBlocksStacks ( ) ;
1065
1083
1066
1084
valueReturned = isReturn ;
1067
1085
breakCalled = isBreak ;
0 commit comments