Skip to content

Commit

Permalink
Fixed detection of unexpected Catch following Try/Catch/Else.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lexikos committed Jun 28, 2021
1 parent 6e36879 commit 79ecb98
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/script.cpp
Expand Up @@ -5206,7 +5206,6 @@ ResultType Script::AddLine(ActionTypeType aActionType, LPTSTR aArg[], int aArgc,
{
case ACT_ELSE: expected = parent_act == ACT_IF || parent_act == ACT_CATCH || ACT_IS_LOOP(parent_act); break;
case ACT_UNTIL: expected = ACT_IS_LOOP_EXCLUDING_WHILE(parent_act); break;
case ACT_CATCH: // Same as below.
case ACT_FINALLY:
if (parent_act == ACT_ELSE)
{
Expand All @@ -5218,6 +5217,8 @@ ResultType Script::AddLine(ActionTypeType aActionType, LPTSTR aArg[], int aArgc,
expected = parent->mActionType == ACT_CATCH;
break;
}
// Fall through:
case ACT_CATCH:
expected = parent_act == ACT_TRY || parent_act == ACT_CATCH;
break;
}
Expand Down

0 comments on commit 79ecb98

Please sign in to comment.