Skip to content
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

Support "Single Line" variable declarations #204

Closed
ghaith opened this issue Jul 23, 2021 · 0 comments · Fixed by #226
Closed

Support "Single Line" variable declarations #204

ghaith opened this issue Jul 23, 2021 · 0 comments · Fixed by #226
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Milestone

Comments

@ghaith
Copy link
Collaborator

ghaith commented Jul 23, 2021

Is your feature request related to a problem? Please describe.
The Standard allows the declaration of variables in a single statement
Example:

VAR
  var1,var2,var3 : INT;
END_VAR

Creates 3 variables of type INT
We should support this in the parser.

Describe the solution you'd like
During parsing, add a variable for every entry in the list.

Alternative Idea:
Instead of saving each variable in an entry, we could make the AST support variable lists per declaration. This might be better in regards to inline declared types e.g. ARRAY OF but might be more complex on the AST

@ghaith ghaith added enhancement New feature or request good first issue Good for newcomers labels Jul 23, 2021
@ghaith ghaith added this to To do in Next via automation Jul 23, 2021
@ulmer-a ulmer-a moved this from To do to In progress in Next Aug 6, 2021
@ulmer-a ulmer-a self-assigned this Aug 6, 2021
@ulmer-a ulmer-a moved this from In progress to Review in progress in Next Aug 6, 2021
@ulmer-a ulmer-a added this to the oscat milestone Aug 9, 2021
Next automation moved this from Review in progress to Done Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Status: Done
Next
Done
Development

Successfully merging a pull request may close this issue.

2 participants