private void mismatchHandling(SPatternIR pattern, PatternBlockData patternData) { if (!patternData.IsRootPattern(pattern)) { return; } if (patternData.getMismatchHandling() == MismatchHandling.RAISE_ERROR) { APatternMatchRuntimeErrorExpIR matchFail = new APatternMatchRuntimeErrorExpIR(); matchFail.setType(new AErrorTypeIR()); matchFail.setMessage(config.getMatchFailedMessage(pattern)); ARaiseErrorStmIR noMatchStm = new ARaiseErrorStmIR(); noMatchStm.setError(matchFail); AIfStmIR consMismatchCheck = consMismatchCheck(patternData.getSuccessVar(), noMatchStm); patternData.getDeclBlock().getStatements().add(consMismatchCheck); } else if (patternData.getMismatchHandling() == MismatchHandling.LOOP_CONTINUE) { AIfStmIR consMismatchCheck = consMismatchCheck(patternData.getSuccessVar(), new AContinueStmIR()); patternData.getDeclBlock().getStatements().add(consMismatchCheck); } }
matchFail.setType(new AErrorTypeIR()); matchFail.setMessage(config.getMatchFailedMessage(firstOriginal)); ARaiseErrorStmIR noMatchStm = new ARaiseErrorStmIR();