@@ -30,48 +30,14 @@ create or replace package body ut_annotations as
3030 c_rgexp_identifier constant varchar2(50) := '[a-z][a-z0-9#_$]*';
3131 c_annotation_block_pattern constant varchar2(200) := '(({COMMENT#.+}'||chr(10)||')+)( |'||chr(09)||')*(procedure|function)\s+(' ||
3232 c_rgexp_identifier || ')';
33- c_annotation_pattern constant varchar2(50) := gc_annotation_qualifier || c_rgexp_identifier || '(\(.*?\))?';
33+ c_annotation_pattern constant varchar2(50) := gc_annotation_qualifier || c_rgexp_identifier || '(\(.*?\)$ )?';
3434
3535
3636 function delete_multiline_comments(a_source in clob) return clob is
3737 begin
38-
39- /* l_tmp_clob := regexp_replace(srcstr => a_source
40- ,pattern => c_multiline_comment_pattern
41- ,modifier => 'n');
42- l_tmp_clob := regexp_replace(srcstr => l_tmp_clob
43- ,pattern => c_nonannotat_comment_pattern
44- ,modifier => 'm');
45-
46- -- performance is too low when deleting spaces as it leads to lots of writes
47- -- l_tmp_clob := regexp_replace(srcstr => l_tmp_cl0ob
48- -- ,pattern => '(( |'||chr(09)||')*'|| chr(10)||'){3,}'
49- -- ,replacestr => chr(10)||chr(10));
50- return l_tmp_clob;
51- */
5238 return regexp_replace(srcstr => a_source
5339 ,pattern => c_multiline_comment_pattern
5440 ,modifier => 'n');
55-
56- --this is not fast enough as the regexp parten is more complicated
57- /*
58- return regexp_replace(srcstr => a_source
59- ,pattern => '('||c_multiline_comment_pattern
60- ||'|'||c_nonannotat_comment_pattern||')'
61- ,modifier => 'mn');
62- */
63-
64- /*
65- return regexp_replace(
66- srcstr => regexp_replace(srcstr => regexp_replace(srcstr => a_source
67- ,pattern => c_multiline_comment_pattern
68- ,modifier => 'n')
69- ,pattern => c_nonannotat_comment_pattern, modifier => 'm')
70- ,pattern => '((procedure|function)\s+' || c_rgexp_identifier || ')[^;]*'
71- ,replacestr => '\1'
72- ,modifier => 'mn'
73- );
74- */
7541 end;
7642
7743 function get_annotations(a_source varchar2, a_comments tt_comment_list) return tt_annotations is
@@ -111,7 +77,7 @@ create or replace package body ut_annotations as
11177 ,'%(' || c_rgexp_identifier || ')'
11278 ,modifier => 'i'
11379 ,subexpression => 1));
114- l_annotation_params_str := trim(regexp_substr(l_annotation_str, '\((.*?)\)', subexpression => 1));
80+ l_annotation_params_str := trim(regexp_substr(l_annotation_str, '\((.*?)\)$ ', subexpression => 1));
11581
11682 if l_annotation_params_str is not null then
11783
@@ -343,7 +309,7 @@ create or replace package body ut_annotations as
343309
344310 -- TODO: Add cache of annotations. Cache invalidation should be based on DDL timestamp.
345311 -- Cache garbage collection should be executed once in a while to remove annotations cache for packages that were dropped.
346-
312+
347313 begin
348314 l_source := ut_metadata.get_package_spec_source(a_owner_name, a_name);
349315 exception
0 commit comments