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

Comma-list declarations issue 2856 #2975

Merged
merged 5 commits into from
Aug 1, 2021

Conversation

DanTGL
Copy link
Contributor

@DanTGL DanTGL commented Jun 22, 2021

Added comma-list declarations.

Fixes #2856

It is not finished yet as I have only added them for SET right now.

@marianoapp
Copy link
Contributor

If you made changes to the grammar you need to commit the kRISC.tpg file too. I assume you did since the PR includes changes to the Parser class.

@thexa4
Copy link
Contributor

thexa4 commented Jun 22, 2021

Does this allow set foo to 1, bar to foo.?

@DanTGL
Copy link
Contributor Author

DanTGL commented Jun 22, 2021

@marianoapp I didn't realize that I was supposed to modify the kRISC.tpg file, but I've done it now and generated the code with TinyPG.

@thexa4 Yes, that works.

@DanTGL
Copy link
Contributor Author

DanTGL commented Jun 23, 2021

This basically works by splitting them up in separate operations, so the only actual changes are how the statement is parsed and compiled. So it basically still functions the same way as having separate statements.

This is basically the only thing I've changed in the code aside from kRISC.tpg:

private void VisitSetStatement(ParseNode node)
{
NodeStartHousekeeping(node);
for (int i = 1; i < node.Nodes.Count; i += 4)
{
ProcessSetOperation(node.Nodes[i], node.Nodes[i + 2]);
}
}

@DanTGL DanTGL changed the title [Not Ready] Comma-list declarations issue 2856 Comma-list declarations issue 2856 Jul 7, 2021
@Dunbaratu Dunbaratu merged commit 874e05f into KSP-KOS:develop Aug 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support comma-list declarations
4 participants