Skip to content

Commit

Permalink
Remove warnings regarding duplicate late declaration of packages (#72)
Browse files Browse the repository at this point in the history
ISSUE: #72
  • Loading branch information
mugdhadhole1 committed Apr 17, 2024
1 parent c8a287d commit 149a791
Show file tree
Hide file tree
Showing 12 changed files with 9 additions and 36 deletions.
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
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
LRM.Duplicate_Late_Packages
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
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

0 comments on commit 149a791

Please sign in to comment.