You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or 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
DYN-982 - Fix issues with nested language blocks
There were 2 issues with nested language blocks. The following script typed in a code block node is an example of this.
a and x are global variables as they are in the outermost scope and are renamed to have globally unique names like a_<guide>, and x_guid, where guid is the same as that assigned to the node model. This is so that the user can use the same names in another code block node without running into name conflicts. The issue was that although the variables were renamed inside the Imperative block as well, the names were not propagating to the nested Associative block, due to which these symbols were undefined in that scope. The variable renaming is done using the IdentifierInPlaceMapper classes, which have been refactored in this PR to take care of the renaming issue.
The second issue was the crash due to associative-update. Each graph node in the dependency graph is connected to other graph nodes that have a dependency on it. When the graph node is marked dirty, all of its connected graph nodes should also be marked dirty for associative-update to work properly and all dependent code to execute. However, only those graph nodes that belonged to the same language block were being marked dirty earlier due to which, if code inside a dependent node was in another language block, it would not re-execute. This is fixed by marking all connected graph nodes dirty even if they belonged to other language blocks.
a = 1;
x = 3;
i = [Imperative]
{
c = 0;
b = 0..4;
while(a < 2)
{
[Associative]
{
c = x*b;
}
a = a+0.2;
}
return [c,a];
};
Moved ImperativeIdentifierInPlaceMapper from CodeBlockNodeModel to ProtoCore project
Added a similar AssociativeIdentifierInPlaceMapper to ProtoCore
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.
Purpose
DYN-982 - Fix issues with nested language blocks
There were 2 issues with nested language blocks. The following script typed in a code block node is an example of this.
a
andx
are global variables as they are in the outermost scope and are renamed to have globally unique names likea_<guide>
, andx_guid
, where guid is the same as that assigned to the node model. This is so that the user can use the same names in another code block node without running into name conflicts. The issue was that although the variables were renamed inside theImperative
block as well, the names were not propagating to the nestedAssociative
block, due to which these symbols were undefined in that scope. The variable renaming is done using theIdentifierInPlaceMapper
classes, which have been refactored in this PR to take care of the renaming issue.ImperativeIdentifierInPlaceMapper
fromCodeBlockNodeModel
toProtoCore
projectAssociativeIdentifierInPlaceMapper
toProtoCore
Declarations
Check these if you believe they are true
*.resx
filesRelease Notes
Fix issues with nested language blocks
FYIs
(FILL ME IN, Optional) Names of anyone else you wish to be notified of