support ^ inside strings again (for chords)

This commit is contained in:
alex
2023-03-05 10:16:27 +00:00
parent e15eef9a16
commit ebd1c2f564
2 changed files with 13 additions and 4 deletions
+11 -2
View File
@@ -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) {
+2 -2
View File
@@ -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