-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add check to detect duplicated components of a record when parsing a TRLC file. The Language Reference Manual has been updated accordingly, and its version has been increased to 3.1 Example: ``` Something duplicated { description = "This is fine!" description = "This is the duplicate." } ``` The behavior of the `Record_Object` class is changed such that the `assign` method only assigns components to the record if it has not been assigned already. This is implemented by checking if the field type is different from `Implicit_Null`. The `Parser` class asks the `Record_Object` if the component is `Implicit_Null`. If no, then an error is sent to the message handler.
- Loading branch information
Showing
13 changed files
with
78 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,11 @@ docs | |
*.pyc | ||
*.egg-info | ||
.venv/ | ||
venv/ | ||
build | ||
dist | ||
launch.json | ||
settings.json | ||
|
||
# EMACS ignores | ||
*~ | ||
|
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
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
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package Example | ||
|
||
type Requirement { | ||
description String | ||
critical Boolean | ||
} |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package Example | ||
|
||
Requirement safety { | ||
critical = false | ||
description = "Is it critical, or is it not?" | ||
critical = true | ||
} | ||
|
||
Requirement duplicated { | ||
description = "This is fine" | ||
critical = true | ||
description = "This is not fine anymore" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
critical = true | ||
^^^^^^^^ rbt-single-value-assignment/foo.trlc:6: error: component 'critical' already assigned at line 4 | ||
description = "This is not fine anymore" | ||
^^^^^^^^^^^ rbt-single-value-assignment/foo.trlc:12: error: component 'description' already assigned at line 10 | ||
Processed 1 model and 1 requirement file and found 2 errors |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
rbt-single-value-assignment/foo.trlc:6:3: trlc error: component 'critical' already assigned at line 4 | ||
rbt-single-value-assignment/foo.trlc:12:3: trlc error: component 'description' already assigned at line 10 |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
critical = true | ||
^^^^^^^^ rbt-single-value-assignment/foo.trlc:6: error: component 'critical' already assigned at line 4 | ||
description = "This is not fine anymore" | ||
^^^^^^^^^^^ rbt-single-value-assignment/foo.trlc:12: error: component 'description' already assigned at line 10 | ||
Processed 1 model and 1 requirement file and found 2 errors |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
critical = true | ||
^^^^^^^^ rbt-single-value-assignment/foo.trlc:6: error: component 'critical' already assigned at line 4 | ||
description = "This is not fine anymore" | ||
^^^^^^^^^^^ rbt-single-value-assignment/foo.trlc:12: error: component 'description' already assigned at line 10 | ||
Processed 1 model and 1 requirement file and found 2 errors |
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