DynamoDS / Dynamo

Open Source Graphical Programming for Design
https://dynamobim.org
Other
1.74k stars 634 forks source link

Semi Colon as String in Code Block #12152

Open vykrum opened 3 years ago

vykrum commented 3 years ago

Dynamo version

2.13.0.2857

Operating system

Windows 11

What did you do?

Tried to split a string with ";"+"\n" as separator

What did you expect to see?

Similar results as the same separator in a String node

What did you see instead?

Firstly, a single semi colon, even within double quotes, seems to indicate end of line in a Code Block node. On forcing it to accept ";"+"\n" it doesn't seem to behave properly.

stringSplitIssue

This was observed while responding to this post on the forum

github-actions[bot] commented 3 years ago

Thank you for submitting the issue to us. We are sorry to see you get stuck with your workflow. While waiting for our team member to respond, please feel free to browse our forum at https://forum.dynamobim.com/ for more Dynamo related information.

tinrobot2000 commented 1 day ago

Just adding that issue is located here https://github.com/DynamoDS/Dynamo/blob/3e2036956206d9f16126c73cbf3a612ec444da83/src/DynamoCore/Graph/Nodes/CodeBlockUtils.cs#L211

Where the code does not check if the semicolon is inside a string, comment or multiline comment image

Perhaps an additional switch for semicolon here? https://github.com/DynamoDS/Dynamo/blob/3e2036956206d9f16126c73cbf3a612ec444da83/src/DynamoCore/Graph/Nodes/CodeBlockUtils.cs#L536