Skip to content

for() syntax marked as error #249

@warriorstar-orion

Description

@warriorstar-orion

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions