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

parser: for loop #112

Closed
cooper opened this issue Feb 23, 2025 · 2 comments
Closed

parser: for loop #112

cooper opened this issue Feb 23, 2025 · 2 comments
Labels
feature ideas for brand new features parser wikifier block parser and text formatter

Comments

@cooper
Copy link
Owner

cooper commented Feb 23, 2025

for [@variable] {
    Some formatted text and/or block content to repeat.
    If @variable is a list, you can access each item with the special variable [@value].
    If @variable is an object, you can access the [@key] and [@value] of the pair with these two special variables.
    In either case, [.property] is shorthand for [@value.property].
}
@cooper cooper added feature ideas for brand new features parser wikifier block parser and text formatter labels Feb 23, 2025
@cooper
Copy link
Owner Author

cooper commented Feb 23, 2025

It should also support assigning your own var in case you want to nest loops and access an outer value

for [@variable as @item] {
}

@cooper
Copy link
Owner Author

cooper commented Feb 23, 2025

does this need to be implemented in the parser? maybe it could be implemented as a block type.

cooper added a commit that referenced this issue Feb 23, 2025
@cooper cooper closed this as completed Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature ideas for brand new features parser wikifier block parser and text formatter
Projects
None yet
Development

No branches or pull requests

1 participant