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) =
446446
447447fun find_comment(token, name) =
448448 |" 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.
450450
451451 if token.kind == "comment" and
452452 token.previous().previous().kind == "begin"
Original file line number Diff line number Diff line change @@ -14,8 +14,8 @@ fun uncommented_begin(unit) = [
1414 select node@HandledStmts(parent: p@(PackageBody | SubpBody |
1515 EntryBody | ProtectedBody |
1616 TaskBody))
17- when p.f_decls is *(f_decls: l)
17+ when p.f_decls.f_decls is l
1818 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(),
2020 p.p_defining_name().text)
2121]
Original file line number Diff line number Diff line change 11uncommented.adb:4:4: rule violation: mark BEGIN with -- Proc
2- 4 | begin -- FLAG
2+ 4 | begin -- FLAG
33 | ^^^^^
44
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+ | ^^^^^
88
Original file line number Diff line number Diff line change 11package body Uncommented is
22 procedure Proc (I : out Integer) is
33 J : Integer;
4- begin -- FLAG
4+ begin -- FLAG
55 I := Var;
66 end Proc ;
77
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
922 Var := Inner.Inner_Var + 1 ;
1023end ;
You can’t perform that action at this time.
0 commit comments