File tree Expand file tree Collapse file tree 4 files changed +22
-9
lines changed Expand file tree Collapse file tree 4 files changed +22
-9
lines changed Original file line number Diff line number Diff line change @@ -446,7 +446,7 @@ fun sloc_image(node) =
446
446
447
447
fun find_comment(token, name) =
448
448
|" Return true if a comment token immediately following the previous
449
- |" "begin" keyword is found and containing only the package name.
449
+ |" "begin" keyword is found and contains only the provided name.
450
450
451
451
if token.kind == "comment" and
452
452
token.previous().previous().kind == "begin"
Original file line number Diff line number Diff line change @@ -14,8 +14,8 @@ fun uncommented_begin(unit) = [
14
14
select node@HandledStmts(parent: p@(PackageBody | SubpBody |
15
15
EntryBody | ProtectedBody |
16
16
TaskBody))
17
- when p.f_decls is *(f_decls: l)
17
+ when p.f_decls.f_decls is l
18
18
when l[1]
19
- and not stdlib.find_comment(node.token_start().previous(exclude_trivia=true ),
19
+ and not stdlib.find_comment(node.token_start().previous(),
20
20
p.p_defining_name().text)
21
21
]
Original file line number Diff line number Diff line change 1
1
uncommented.adb:4:4: rule violation: mark BEGIN with -- Proc
2
- 4 | begin -- FLAG
2
+ 4 | begin -- FLAG
3
3
| ^^^^^
4
4
5
- uncommented.adb:8 :1: rule violation: mark BEGIN with -- Uncommented
6
- 8 | begin -- FLAG
7
- | ^^^^^
5
+ uncommented.adb:21 :1: rule violation: mark BEGIN with -- Uncommented
6
+ 21 | begin -- FLAG
7
+ | ^^^^^
8
8
Original file line number Diff line number Diff line change 1
1
package body Uncommented is
2
2
procedure Proc (I : out Integer) is
3
3
J : Integer;
4
- begin -- FLAG
4
+ begin -- FLAG
5
5
I := Var;
6
6
end Proc ;
7
7
8
- begin -- FLAG
8
+ procedure Proc_2 is
9
+ I : Integer;
10
+ S : String := " Hello" ;
11
+ begin -- Proc_2
12
+ -- A comment
13
+ null ;
14
+ end Name ;
15
+
16
+ procedure Proc_3 is
17
+ begin -- NOFLAG
18
+ null ;
19
+ end Proc_3 ;
20
+
21
+ begin -- FLAG
9
22
Var := Inner.Inner_Var + 1 ;
10
23
end ;
You can’t perform that action at this time.
0 commit comments