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

for() syntax marked as error #249

Closed
warriorstar-orion opened this issue Feb 25, 2021 · 1 comment · Fixed by #259
Closed

for() syntax marked as error #249

warriorstar-orion opened this issue Feb 25, 2021 · 1 comment · Fixed by #259

Comments

@warriorstar-orion
Copy link

warriorstar-orion commented Feb 25, 2021

Hello, thanks for all your work;

I have the following DME: https://gist.github.com/warriorstar-orion/dc6091aa63d43742fe502c9eef8716eb

I maintain a branch of SpacemanDMM which, upon parsing an AST, serializes it to Protobuf (master...warriorstar-orion:pb2 to compare against master). Upon parsing the above DME and ingesting the protobuf in another program, I found that the parser doesn't appear to respect the for syntax with no arguments:

2021/02/25 12:55:21   0.00s parsing
2021/02/25 12:55:21 ===================
Invalid code block found:
invalid: true
invalid_description: "for-in-list must start with variable"


2021/02/25 12:55:21 ===================
Invalid code block found:
invalid: true
invalid_description: "for-in-list must start with variable"

Based on a read of the Designer's Guide and DM Reference, it appears this syntax is valid. The Designer's Guide uses a roughly equivalent example:

Screen Shot 2021-02-25 at 13 06 24

And the DM Reference suggests all three loop arguments may be omitted:

Screen Shot 2021-02-25 at 13 06 45

Am I holding it wrong or is parsing support for this missing here?

Thanks!

EDIT: I'll probably just switch to e.g. while(1) but leave this for posterity

@ZeWaka
Copy link
Contributor

ZeWaka commented Mar 10, 2021

Yeah, this is used nowhere in SS13 and you'd probably be shamed if you did use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants