END
v9.CheckDefFailure(lines, 'E488:')
+
+ lines =<< trim END
+ if true
+ else
+ else
+ endif
+ END
+ v9.CheckSourceDefFailure(lines, 'E583:')
+
+ lines =<< trim END
+ var a = 3
+ if a == 2
+ else
+ elseif true
+ else
+ endif
+ END
+ v9.CheckSourceDefFailure(lines, 'E584:')
+
lines =<< trim END
var cond = true
if cond
emsg(_(e_elseif_without_if));
return NULL;
}
+ if (scope->se_u.se_if.is_seen_else)
+ {
+ emsg(_(e_elseif_after_else));
+ return NULL;
+ }
unwind_locals(cctx, scope->se_local_count, TRUE);
if (!cctx->ctx_had_return && !cctx->ctx_had_throw)
// the previous if block didn't end in a "return" or a "throw"
emsg(_(e_else_without_if));
return NULL;
}
+ if (scope->se_u.se_if.is_seen_else)
+ {
+ emsg(_(e_multiple_else));
+ return NULL;
+ }
unwind_locals(cctx, scope->se_local_count, TRUE);
if (!cctx->ctx_had_return && !cctx->ctx_had_throw)
// the previous if block didn't end in a "return" or a "throw"