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

Merge forloop structure into one #176

Closed
katat opened this issue Sep 2, 2024 · 0 comments
Closed

Merge forloop structure into one #176

katat opened this issue Sep 2, 2024 · 0 comments
Labels

Comments

@katat
Copy link
Collaborator

katat commented Sep 2, 2024

Currently there are two structures for the ForLoop statement:

    // `for var in 0..10 { <body> }`
    ForLoop {
        var: Ident,
        range: Range,
        body: Vec<Stmt>,
    },

    // `for item in vec { <body> }`
    IteratorLoop {
        var: Ident,
        iterator: Box<Expr>,
        body: Vec<Stmt>,
    },

It would be nicer and safer to merge them into one (#169 (comment))

ForLoop {
  var: Ident,
  range: RangeOrIterator,
  body: Vec<Stmt>,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant