         AOP_block_body(i_level => i_level + 1);
       WHEN l_keyword = 'BEGIN' THEN
         AOP_block_body(i_level => i_level + 1);
+	  WHEN l_keyword LIKE 'CASE%END CASE;' THEN
+	    ms_logger.comment(l_node, 'Found CASE-END-CASE;');
+		go_past('\sCASE\s');  
+	  WHEN l_keyword LIKE 'CASE%END;' THEN
+	    ms_logger.comment(l_node, 'Found CASE-END;');
+		go_past('\sEND;\s'); 
       ELSE
-	    ms_logger.fatal(l_node, 'Expected "DECLARE", "BEGIN", "END;"');
+	    ms_logger.fatal(l_node, 'Expected "DECLARE" "BEGIN" "END;" "CASE%END CASE;" or "CASE%END;"');
         RAISE x_invalid_keyword;
     END CASE;
  

	    if l_mystery_word in ('IF'
	                         ,'LOOP'
	    					 ,'CASE') then
		  go_past(l_end_value);						 
		ELSE						 
	      ms_logger.info(l_node, 'Replacing '||l_end_value);
	      g_code := REGEXP_REPLACE(g_code,'(\s)END\s+\w+\s*;','\1END;',g_current_pos,1,'i');
		  go_past('END;');
	    end if;
 
	  END LOOP;
   
  ms_logger.comment(l_node, 'Finised cleaning ENDs');



FUNCTION get_next_lower(i_search IN VARCHAR2
                       ,i_modifier IN VARCHAR2 DEFAULT 'i'
                       ,i_raise_error IN BOOLEAN  DEFAULT FALSE) return CLOB IS
BEGIN
  RETURN LOWER(get_next(i_search   => i_search
                       ,i_modifier => i_modifier
