Merge pull request #48 from Jazzmax/comments
Allow #comment lines in macros. Updated the Macros documentation.
This commit is contained in:
commit
ce99f59cb0
2 changed files with 25 additions and 0 deletions
|
|
@ -43,6 +43,30 @@ L_STICK@+000+000 0.75s
|
|||
1.0s
|
||||
```
|
||||
|
||||
### Loops
|
||||
|
||||
A simple for-loop can be used to repeat a macro block a specified number of times. The below example loops through an indented macro block 100 times.
|
||||
|
||||
```
|
||||
LOOP 100
|
||||
B 0.1s
|
||||
0.1s
|
||||
```
|
||||
|
||||
Nested loops are also supported.
|
||||
|
||||
```
|
||||
LOOP 100
|
||||
B 0.1s
|
||||
0.1s
|
||||
# Nested loop
|
||||
LOOP 5
|
||||
A 0.1s
|
||||
0.1s
|
||||
```
|
||||
|
||||
Note, a macro line starting with `#` is ignored.
|
||||
|
||||
## Macro Control Values
|
||||
|
||||
| Macro Value | Control Name |
|
||||
|
|
|
|||
|
|
@ -307,6 +307,7 @@ class InputParser():
|
|||
|
||||
parsed = macro.split("\n")
|
||||
parsed = list(filter(lambda s: not s.strip() == "", parsed))
|
||||
parsed = list(filter(lambda s: not s.strip().startswith("#"), parsed))
|
||||
parsed = self.parse_loops(parsed)
|
||||
|
||||
return parsed
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue