-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'topic/209' into 'master'
Fix SPARK_Procedures_Without_Globals Closes #209 See merge request eng/libadalang/langkit-query-language!163
- Loading branch information
Showing
5 changed files
with
50 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
lkql_checker/share/lkql/spark_procedures_without_globals.lkql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import stdlib | ||
|
||
@check(message="SPARK subprogram doesn't have a Global aspect", | ||
@check(message="SPARK procedure doesn't have a Global aspect", | ||
category="Style", subcategory="Programming Practice") | ||
fun spark_procedures_without_globals(node) = | ||
|" Check that every SPARK subprogram has a Global aspect | ||
(node is BasicSubpDecl(p_has_spark_mode_on() is true)) | ||
(node is BasicSubpDecl(p_has_spark_mode_on() is true, | ||
p_subp_decl_spec() is BaseSubpSpec(p_return_type() is null))) | ||
and not node.p_has_aspect("Global") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
testsuite/tests/checks/spark_procedures_without_globals/test.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
test.ads:3:14: rule violation: SPARK subprogram doesn't have a Global aspect | ||
test.ads:3:14: rule violation: SPARK procedure doesn't have a Global aspect | ||
3 | procedure P with SPARK_Mode => On; -- FLAG | ||
| ^ | ||
|