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

Introduce better expansion syntax for ranges #28

Open
EmilyGraceSeville7cf opened this issue Feb 12, 2023 · 1 comment
Open

Introduce better expansion syntax for ranges #28

EmilyGraceSeville7cf opened this issue Feb 12, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request v3.0.0

Comments

@EmilyGraceSeville7cf
Copy link
Member

EmilyGraceSeville7cf commented Feb 12, 2023

Use parenthesis instead of .. for ranges: {int priority: (1, 10)}. Also add an ability to refer the first or the last range border inside expansions like {int priority: (10, $from + 20)}. In other words allow +, -, *, /, % operators and $from, $to variables inside ranges. Note that just one range border can have math expression, not both and it's not possible to refer to anything outside of the current range.

Notes

  • parenthesis should not be escaped
  • spacing doesn't matter

Examples

  • {/?file(1, 4) image} - expect from one to four images
  • {int priority: (1, 10)} - expect one priority value which is in [1..10] range
@EmilyGraceSeville7cf
Copy link
Member Author

Probably I should consider incorporating Go templates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v3.0.0
Projects
None yet
Development

No branches or pull requests

1 participant