Skip to content

Commit 2e6931b

Browse files
committed
Reformat the 'one_construct_per_line.lkql' file
1 parent bb674d7 commit 2e6931b

File tree

1 file changed

+25
-17
lines changed

1 file changed

+25
-17
lines changed

lkql_checker/share/lkql/one_construct_per_line.lkql

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,28 @@ 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+
) and (
57+
node.token_end().end_line == stdlib.next_non_blank_token_line(node.token_end())
58+
or node.token_start().start_line == stdlib.previous_non_blank_token_line(node.token_start())
59+
)

0 commit comments

Comments
 (0)