mirror of
https://codeberg.org/uzu/strudel
synced 2026-09-05 06:57:35 -04:00
support ^ inside strings again (for chords)
This commit is contained in:
@@ -846,6 +846,15 @@ function peg$parse(input, options) {
|
||||
s0 = peg$FAILED;
|
||||
if (peg$silentFails === 0) { peg$fail(peg$e16); }
|
||||
}
|
||||
if (s0 === peg$FAILED) {
|
||||
if (input.charCodeAt(peg$currPos) === 94) {
|
||||
s0 = peg$c10;
|
||||
peg$currPos++;
|
||||
} else {
|
||||
s0 = peg$FAILED;
|
||||
if (peg$silentFails === 0) { peg$fail(peg$e17); }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1110,9 +1119,9 @@ function peg$parse(input, options) {
|
||||
function peg$parseslice() {
|
||||
var s0;
|
||||
|
||||
s0 = peg$parsestep();
|
||||
s0 = peg$parsememory();
|
||||
if (s0 === peg$FAILED) {
|
||||
s0 = peg$parsememory();
|
||||
s0 = peg$parsestep();
|
||||
if (s0 === peg$FAILED) {
|
||||
s0 = peg$parsesub_cycle();
|
||||
if (s0 === peg$FAILED) {
|
||||
|
||||
@@ -103,7 +103,7 @@ quote = '"' / "'"
|
||||
// ------------------ steps and cycles ---------------------------
|
||||
|
||||
// single step definition (e.g bd)
|
||||
step_char = [0-9a-zA-Z~] / "-" / "#" / "." / "_"
|
||||
step_char = [0-9a-zA-Z~] / "-" / "#" / "." / "_" / "^"
|
||||
step = ws chars:step_char+ ws { return new AtomStub(chars.join("")) }
|
||||
|
||||
memory = ws "^" h:[A-Za-z] t:[A-Za-z0-9_]+ { return new MemoryStub(h + t.join("")) }
|
||||
@@ -124,7 +124,7 @@ slow_sequence = ws "<" ws s:sequence ws ">" ws
|
||||
{ s.arguments_.alignment = 'slowcat'; return s; }
|
||||
|
||||
// a slice is either a single step or a sub cycle
|
||||
slice = step / memory / sub_cycle / polymeter / slow_sequence
|
||||
slice = memory / step / sub_cycle / polymeter / slow_sequence
|
||||
|
||||
// slice modifier affects the timing/size of a slice (e.g. [a b c]@3)
|
||||
// at this point, we assume we can represent them as regular sequence operators
|
||||
|
||||
Reference in New Issue
Block a user