Skip to content

Commit 437764f

Browse files
committed
Merge branch 'topic/fix_no_closing_names' into 'master'
Fix the "No_Closing_Names" rule Closes #411 See merge request eng/libadalang/langkit-query-language!351
2 parents d5e2ff0 + bf35160 commit 437764f

File tree

6 files changed

+21
-2
lines changed

6 files changed

+21
-2
lines changed

lkql_checker/share/lkql/no_closing_names.lkql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,5 @@ fun no_closing_names(node, n : int = 0) =
5656
and node.token_end().end_line - node.token_start().start_line >= n
5757
and match node
5858
| (TaskTypeDecl | ProtectedTypeDecl | SingleProtectedDecl) =>
59-
node.f_definition.f_end_name == null
59+
node.f_definition is (ProtectedDef | TaskDef)(f_end_name: null)
6060
| * => node.f_end_name == null
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
project Prj is
2-
end Prj;
2+
end Prj;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
procedure Names is -- FLAG
2+
task T3; -- NOFLAG
3+
4+
task body T3 is -- NOFLAG
5+
begin
6+
null;
7+
end T3;
8+
end;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
project Prj is
2+
end Prj;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
names.adb:1:11: rule violation: no closing name
2+
1 | procedure Names is -- FLAG
3+
| ^^^^^
4+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
driver: checker
2+
rule_name: no_closing_names
3+
project: prj.gpr
4+
rule_arguments:
5+
no_closing_names.n: 0

0 commit comments

Comments
 (0)