Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shaozi/nestloop
lib that parses a simple nested loop template string
https://github.com/shaozi/nestloop
Last synced: 9 days ago
JSON representation
lib that parses a simple nested loop template string
- Host: GitHub
- URL: https://github.com/shaozi/nestloop
- Owner: shaozi
- License: bsd-2-clause
- Created: 2012-09-17T02:43:11.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2018-02-08T18:16:45.000Z (almost 7 years ago)
- Last Synced: 2024-10-11T12:48:50.014Z (about 1 month ago)
- Language: Tcl
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Nested Loop Parser Library
==========================`parse_nest_loop` parses an input string that contains `<>` notation to indicate
nested loops.Syntax
------
- `` means loop from `n` to `m`, `<>` means an inner-loop.
- The number of `<` is the nested level
- Multiple levels of loops, and multiple loops of the same levels
can exist together.
- Same level of loops can have different number of
iteration times.
- The loop ends when the longest loop in the same
level ends. The shorter loop will continue from beginning.Example
-------
`parse_nest_loop "1<0-5>.<<1-5>>" ` returns:10.1, 10.2, ..., 10.5,
11.1, 11.2, ..., 11.5,
...
15.1, 15.2, ..., 15.5`parse_nest_loop "<0-5><0-3>" ` returns:
00 11 22 33 40 51
End
---b1