Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
38e02ab
Testing something
lwasylow Mar 9, 2026
461ad5d
Another test
lwasylow Mar 9, 2026
44f5495
Test
lwasylow Mar 9, 2026
b5f2dc7
Thats funny:)
lwasylow Mar 9, 2026
0dd7dba
that is rubbish
lwasylow Mar 9, 2026
4ea0fcb
revert test
lwasylow Mar 9, 2026
17604d8
Small tweaks
lwasylow Mar 9, 2026
5869f32
one at the time
lwasylow Mar 9, 2026
3f8d2cf
Move out outside
lwasylow Mar 9, 2026
37fae24
fix invalid locator
lwasylow Mar 9, 2026
5189955
revert
lwasylow Mar 9, 2026
5a21774
Changing a code to validate by lines instead of clobs for performance.
lwasylow Mar 14, 2026
39f5d64
Fixing loop syntax
lwasylow Mar 14, 2026
93ffb72
Merge branch 'develop' of https://github.com/utPLSQL/utPLSQL into fea…
lwasylow Mar 14, 2026
393cfec
Update code
lwasylow Mar 15, 2026
8d794f0
Update block
lwasylow Mar 15, 2026
a32e09d
Small fixes
lwasylow Mar 15, 2026
b2e914f
Update comment
lwasylow Mar 15, 2026
66de806
Introduce global variable
lwasylow Mar 15, 2026
f82a3b5
Cleanup
lwasylow Mar 15, 2026
934df67
Optimization fiurther
lwasylow Mar 15, 2026
65145c2
Trim spaces
lwasylow Mar 15, 2026
8105179
Added extra tests.
lwasylow Mar 15, 2026
cc491cf
Enhance annotation parser with new tests and source line handling fun…
lwasylow Mar 15, 2026
6717ad3
Add tests for Windows-style newlines and long procedure names in anno…
lwasylow Mar 15, 2026
6c513be
Fix regex extraction for procedure/function names and ensure ordered …
lwasylow Mar 15, 2026
46f3d12
Update tests
lwasylow Mar 15, 2026
81e1752
Refactor annotation parser tests and utility functions
lwasylow Mar 16, 2026
fecbcc1
Remove redundant parse_object_annotations function overloads and upda…
lwasylow Mar 16, 2026
2547b40
Update code to avoid
lwasylow Mar 17, 2026
40eb166
Enhance annotation processing by improving SQL text handling and addi…
lwasylow Mar 17, 2026
1cdeb9c
Refactor annotation processing and enhance line scanning functionalit…
lwasylow Mar 18, 2026
c4d0ab0
Remove redundant exception handling in build_annot_cache_for_sources …
lwasylow Mar 18, 2026
aa3bfe7
Refactor annotation patterns in ut_annotation_parser and remove unuse…
lwasylow Mar 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Testing something
  • Loading branch information
lwasylow committed Mar 9, 2026
commit 38e02ab70b05a8e67510dfe5366b6962766005c5
80 changes: 61 additions & 19 deletions source/core/annotations/ut_annotation_parser.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,17 @@ create or replace package body ut_annotation_parser as
l_comment_pos binary_integer;
l_comment_line binary_integer;
l_comment_replacer varchar2(50);
l_source clob := a_source;
l_comment_text varchar2(32767);
l_comment_match varchar2(32767);
l_result clob;
l_copy_pos binary_integer := 1;
l_next_newline binary_integer := 0;
l_source_length binary_integer;
begin
l_comment_pos := 1;
l_comment_line := 1;
l_source_length := coalesce(dbms_lob.getlength(a_source), 0);
l_next_newline := dbms_lob.instr(a_source, chr(10), 1, 1);
loop

l_comment_pos := regexp_instr(srcstr => a_source
Expand All @@ -151,30 +159,64 @@ create or replace package body ut_annotation_parser as

-- position index is shifted by 1 because gc_annot_comment_pattern contains ^ as first sign
-- but after instr index already points to the char on that line
l_comment_pos := l_comment_pos-1;
l_comment_line := length(substr(a_source,1,l_comment_pos))-length(replace(substr(a_source,1,l_comment_pos),chr(10)))+1;
l_comments(l_comment_line) := trim(regexp_substr(srcstr => a_source
,pattern => gc_annot_comment_pattern
,occurrence => 1
,position => l_comment_pos
,modifier => 'm'
,subexpression => 2));
l_comment_pos := greatest(l_comment_pos - 1, 1);
while l_next_newline > 0 and l_next_newline < l_comment_pos loop
l_comment_line := l_comment_line + 1;
l_next_newline := dbms_lob.instr(a_source, chr(10), l_next_newline + 1, 1);
end loop;

l_comment_text := trim(regexp_substr(srcstr => a_source
,pattern => gc_annot_comment_pattern
,occurrence => 1
,position => l_comment_pos
,modifier => 'm'
,subexpression => 2));
l_comment_match := regexp_substr(srcstr => a_source
,pattern => gc_annot_comment_pattern
,occurrence => 1
,position => l_comment_pos
,modifier => 'm');
l_comments(l_comment_line) := l_comment_text;

l_comment_replacer := replace(gc_comment_replacer_patter, '%N%', l_comment_line);

l_source := regexp_replace(srcstr => a_source
,pattern => gc_annot_comment_pattern
,replacestr => l_comment_replacer
,position => l_comment_pos
,occurrence => 1
,modifier => 'm');
dbms_lob.freetemporary(a_source);
a_source := l_source;
dbms_lob.freetemporary(l_source);
l_comment_pos := l_comment_pos + length(l_comment_replacer);
if l_result is null then
dbms_lob.createtemporary(l_result, true);
end if;

if l_comment_pos > l_copy_pos then
dbms_lob.copy(
dest_lob => l_result,
src_lob => a_source,
amount => l_comment_pos - l_copy_pos,
dest_offset => dbms_lob.getlength(l_result) + 1,
src_offset => l_copy_pos
);
end if;

ut_utils.append_to_clob(l_result, l_comment_replacer);

l_copy_pos := l_comment_pos + length(l_comment_match);
l_comment_pos := l_copy_pos;

end loop;

if l_result is not null then
if l_copy_pos <= l_source_length then
dbms_lob.copy(
dest_lob => l_result,
src_lob => a_source,
amount => l_source_length - l_copy_pos + 1,
dest_offset => dbms_lob.getlength(l_result) + 1,
src_offset => l_copy_pos
);
end if;
if dbms_lob.istemporary(a_source) = 1 then
dbms_lob.freetemporary(a_source);
end if;
a_source := l_result;
end if;

ut_utils.debug_log(a_source);
return l_comments;
end extract_and_replace_comments;
Expand Down
Loading