Added repeat item to subdivisions

This commit is contained in:
2023-02-25 02:20:48 +02:00
parent 864b110931
commit 7a2f0b5a0a
3 changed files with 4 additions and 3 deletions

1
.gitignore vendored
View File

@ -166,6 +166,7 @@ cython_debug/
.vscode .vscode
# Debugging files # Debugging files
debug/
debug*.py debug*.py
test.py test.py

View File

@ -230,7 +230,7 @@ class ZiffersTransformer(Transformer):
"""Parse subdivision""" """Parse subdivision"""
values = flatten(items[0]) values = flatten(items[0])
return Subdivision( return Subdivision(
values=values, text="[" + "".join([val.text for val in values]) + "]" values=values, wrap_start="[", wrap_end="]"
) )
def subitems(self, items): def subitems(self, items):

View File

@ -12,7 +12,7 @@
modifier: /[#b]/ modifier: /[#b]/
// Variable assignment // Variable assignment
assignment: variable ass_op (list | pitch_class | random_integer | random_pitch | cycle | list_op) assignment: variable ass_op (list | pitch_class | random_integer | random_pitch | cycle | list_op | repeat_item)
ass_op: /[=~]/ ass_op: /[=~]/
variable: /[A-Z]/ variable: /[A-Z]/
@ -64,7 +64,7 @@
// Subdivision // Subdivision
subdivision: "[" subitems "]" subdivision: "[" subitems "]"
subitems: (pitch_class | random_integer | random_pitch | rest | oct_mod | oct_change | WS | chord | named_roman | cycle | subdivision | list | list_op | range)* subitems: (pitch_class | random_integer | random_pitch | rest | oct_mod | oct_change | WS | chord | named_roman | cycle | subdivision | list | list_op | range | repeat_item)*
// Control characters modifying future events // Control characters modifying future events
oct_mod: octave WS oct_mod: octave WS