Skip to content

Add range loop support. #37

@AdvancedAntiSkid

Description

@AdvancedAntiSkid

Is your feature request related to a problem? Please describe.
Modern programming languages often offer users a more simple way to iterate from A to B. As far as I know, users find HTSL's "loop" syntax quite useful. It essentially loops from 0 to N (exclusive) and offers users to capture the index on-the-go. I would consider implementing golang's approach on this.

Describe the solution you'd like
Either extend the "for" keyword to support "range"s or introduce a new keyword to get the job done.

Describe alternatives you've considered

Additional context
Make sure to support both cases: simply looping N times and capturing the current index. Also I'd prefer supporting inclusive and exclusive ranges similar to how rust does it.

Metadata

Metadata

Labels

compilerSomething regarding the compilerenhancementNew feature or requestsyntaxSyntax support for a feature

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions