@@ -32,20 +32,30 @@ fun one_construct_per_line(node) =
3232 |" I := J; J := Tmp; -- FLAG
3333 |" end Swap;
3434 # Flag any statement, declaration or representation clause
35- node is (Stmt | BasicDecl | AttributeDefClause |
36- EnumRepClause | RecordRepClause | AtClause)
37- # except for enum literal, param spec, discriminant spec
38- when (not node is (EnumLiteralDecl | ParamSpec | DiscriminantSpec |
39- # or loop param or entry index.
40- ForLoopVarDecl | EntryIndexSpec |
41- # Also ignore anonymous or nested constructs
42- # generating false positives.
43- SingleTaskTypeDecl | AnonymousTypeDecl |
44- LabelDecl | GenericSubpInternal |
45- ConcreteFormalSubpDecl |
46- ExtendedReturnStmtObjectDecl |
47- NamedStmtDecl | AcceptStmtBody))
48- and (node.token_end().end_line ==
49- stdlib.next_non_blank_token_line(node.token_end())
50- or node.token_start().start_line ==
51- stdlib.previous_non_blank_token_line(node.token_start()))
35+ node is (
36+ Stmt
37+ | BasicDecl
38+ | AttributeDefClause
39+ | EnumRepClause
40+ | RecordRepClause
41+ | AtClause
42+ ) when node is not (
43+ # Except for enum literal, param spec, discriminant spec
44+ EnumLiteralDecl | ParamSpec | DiscriminantSpec
45+ # Or loop param or entry index.
46+ | ForLoopVarDecl | EntryIndexSpec
47+ # Also ignore anonymous or nested constructs generating false positives.
48+ | SingleTaskTypeDecl
49+ | AnonymousTypeDecl
50+ | LabelDecl
51+ | GenericSubpInternal
52+ | ConcreteFormalSubpDecl
53+ | ExtendedReturnStmtObjectDecl
54+ | NamedStmtDecl
55+ | AcceptStmtBody
56+ # Ignore generic package instantiations when they are in a generic formal
57+ | GenericPackageInstantiation(parent: GenericFormal)
58+ ) and (
59+ node.token_end().end_line == stdlib.next_non_blank_token_line(node.token_end())
60+ or node.token_start().start_line == stdlib.previous_non_blank_token_line(node.token_start())
61+ )
0 commit comments