Skip to content

Commit

Permalink
Merge branch 'topic/fix_nested_paths' into 'master'
Browse files Browse the repository at this point in the history
Fix the "Nested_Paths" rule

Closes #405

See merge request eng/libadalang/langkit-query-language!346
  • Loading branch information
HugoGGuerrier committed Dec 16, 2024
2 parents 44f8b40 + 350ad5d commit f29d587
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lkql_checker/share/lkql/nested_paths.lkql
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ fun nested_paths(node) =
if_stmt.f_alternatives[1] == null

# Has an "else" part
and if_stmt.f_else_part.f_stmts[1] != null
and if_stmt.f_else_part != null

and not has_last_breaking_stmt(node)
and has_last_breaking_stmt(if if_stmt.f_then_stmts == node
Expand Down
4 changes: 4 additions & 0 deletions testsuite/tests/checks/nested_paths/paths.adb
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,8 @@ begin
else
I := I + 1; -- NOFLAG
end if;

if Cond then
null; -- NOFLAG
end if;
end Paths;

0 comments on commit f29d587

Please sign in to comment.