-
Notifications
You must be signed in to change notification settings - Fork 11
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
Detecting duplicated components #121
Open
phiwuu
wants to merge
12
commits into
main
Choose a base branch
from
feature/detect_duplicate_components
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
Add check to detect duplicated components of a record when parsing a TRLC file. 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.
phiwuu
force-pushed
the
feature/detect_duplicate_components
branch
from
December 12, 2024 11:03
ad15258
to
debad86
Compare
(venv) qxz0tge@cmucr000556:~/Repos/trlc$ cd /home/qxz0tge/Repos/trlc ; /usr/bin/env /home/qxz0tge/Repos/trlc/venv/bin/python /home/qxz0tge/.vscode/extensions/ms-python.debugpy-2024.14.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher 43939 -- /home/qxz0tge/Repos/trlc/trlc.py /home/qxz0tge/Repos/trlc_test_duplicate DEBUG: Current value of description: <trlc.ast.Implicit_Null object at 0x7f2b48c61930> DEBUG: Current value of critical: <trlc.ast.Implicit_Null object at 0x7f2b48c61990> DEBUG: Current value of critical: <trlc.ast.Implicit_Null object at 0x7f2b48c62d70> DEBUG: Current value of description: <trlc.ast.Implicit_Null object at 0x7f2b48c625c0> critical = true ^^^^^^^^ /home/qxz0tge/Repos/trlc_test_duplicate/lrm_dummy.trlc:10: error: component 'critical' already assigned at line 8 DEBUG: Current value of description: <trlc.ast.Implicit_Null object at 0x7f2b48c63190> DEBUG: Current value of critical: <trlc.ast.Implicit_Null object at 0x7f2b48c63130> DEBUG: Current value of description: <trlc.ast.Implicit_Null object at 0x7f2b48c635b0> DEBUG: Current value of critical: <trlc.ast.Implicit_Null object at 0x7f2b48c63610> description = "This is not fine anymore" ^^^^^^^^^^^ /home/qxz0tge/Repos/trlc_test_duplicate/lrm_dummy.trlc:19: error: component 'description' already assigned at line 17 Processed 1 model and 1 requirement file and found 2 errors
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add check to detect duplicated components of a record when parsing a TRLC file.
Example:
The behavior of the
Record_Object
class is changed such that theassign
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 fromImplicit_Null
.The
Parser
class asks theRecord_Object
if the component isImplicit_Null
. If no, then an error is sent to the message handler.