Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove warnings regarding duplicate late declaration of packages #75

Merged
merged 4 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ generated in the following situations:

### 1.2.3-dev

* [TRLC] A warning is not issued by the tools when encountering
duplicate late package declarations.

* [TRLC] The deprecated builtin function syntax `trlc:foo` has been
removed. You should now use `foo` instead.

Expand Down
5 changes: 0 additions & 5 deletions language-reference-manual/lrm.trlc
Original file line number Diff line number Diff line change
Expand Up @@ -1670,11 +1670,6 @@ section "TRLC Files" {
declares it.'''
}

Recommendation Duplicate_Late_Packages {
text = '''It is recommended to issue a warning if two `.trlc` files
declare the same package.'''
}

Note TRLC_Parse_Issue {
text = '''For TRLC files it is impossible fully parse a file
in isolation, since we must process at least the package
Expand Down
4 changes: 1 addition & 3 deletions tests-system/late-packages-1/output
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
package a
^ late-packages-1/b.trlc:1: warning: duplicate late declaration of package a, previous declaration in a.trlc:1; consider adding an rsl file declaring the package
Processed 1 model, 0 checks and 2 requirement files and found 1 warning
Processed 1 model, 0 checks and 2 requirement files and found no issues
1 change: 0 additions & 1 deletion tests-system/late-packages-1/output.brief
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
late-packages-1/b.trlc:1:9: trlc warning: duplicate late declaration of package a, previous declaration in a.trlc:1; consider adding an rsl file declaring the package
4 changes: 1 addition & 3 deletions tests-system/late-packages-1/output.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
package a
^ late-packages-1/b.trlc:1: warning: duplicate late declaration of package a, previous declaration in a.trlc:1; consider adding an rsl file declaring the package
{}
Processed 1 model, 0 checks and 2 requirement files and found 1 warning
Processed 1 model, 0 checks and 2 requirement files and found no issues
4 changes: 1 addition & 3 deletions tests-system/late-packages-1/output.smtlib
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
package a
^ late-packages-1/b.trlc:1: warning: duplicate late declaration of package a, previous declaration in a.trlc:1; consider adding an rsl file declaring the package
Processed 1 model, 0 checks and 2 requirement files and found 1 warning
Processed 1 model, 0 checks and 2 requirement files and found no issues
4 changes: 1 addition & 3 deletions tests-system/rbt-late-package-declarations/output
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
package Foo
^^^ rbt-late-package-declarations/foo.trlc:1: warning: duplicate late declaration of package Foo, previous declaration in bar.trlc:1; consider adding an rsl file declaring the package
Processed 0 models, 0 checks and 3 requirement files and found 1 warning
Processed 0 models, 0 checks and 3 requirement files and found no issues
1 change: 0 additions & 1 deletion tests-system/rbt-late-package-declarations/output.brief
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
rbt-late-package-declarations/foo.trlc:1:9: trlc warning: duplicate late declaration of package Foo, previous declaration in bar.trlc:1; consider adding an rsl file declaring the package
4 changes: 1 addition & 3 deletions tests-system/rbt-late-package-declarations/output.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
package Foo
^^^ rbt-late-package-declarations/foo.trlc:1: warning: duplicate late declaration of package Foo, previous declaration in bar.trlc:1; consider adding an rsl file declaring the package
{}
Processed 0 models, 0 checks and 3 requirement files and found 1 warning
Processed 0 models, 0 checks and 3 requirement files and found no issues
4 changes: 1 addition & 3 deletions tests-system/rbt-late-package-declarations/output.smtlib
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
package Foo
^^^ rbt-late-package-declarations/foo.trlc:1: warning: duplicate late declaration of package Foo, previous declaration in bar.trlc:1; consider adding an rsl file declaring the package
Processed 0 models, 0 checks and 3 requirement files and found 1 warning
Processed 0 models, 0 checks and 3 requirement files and found no issues
1 change: 0 additions & 1 deletion tests-system/rbt-late-package-declarations/tracing

This file was deleted.

10 changes: 0 additions & 10 deletions trlc/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1835,16 +1835,6 @@ def parse_preamble(self, kind):
self.stab.register(self.mh, pkg)
else:
pkg = self.stab.lookup(self.mh, self.ct, ast.Package)
if pkg.declared_late and kind == "trlc":
# lobster-trace: LRM.Duplicate_Late_Packages
christophkloeffel marked this conversation as resolved.
Show resolved Hide resolved
self.mh.warning(
self.ct.location,
"duplicate late declaration of package %s,"
" previous declaration in %s;"
" consider adding an rsl file declaring the"
" package" %
(pkg.name,
self.mh.cross_file_reference(pkg.location)))

pkg.set_ast_link(t_pkg)
pkg.set_ast_link(self.ct)
Expand Down
Loading