-
Notifications
You must be signed in to change notification settings - Fork 635
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
DYN-982 - Fix issues with nested language blocks #12658
Conversation
var cbn = node.CodeBlockNode as CodeBlockNode; | ||
if (cbn == null) | ||
{ | ||
var assoc_cbn = node.CodeBlockNode as AST.AssociativeAST.CodeBlockNode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so this handles associative blocks inside of imperative blocks, what about the other way around?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good catch! Will make a similar change for the associative class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had made the change but had commented it out for some reason and then cleaned up the commented code 🤷♂️
@aparajit-pratap just had two questions and thanks for the tests! |
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