diff --git a/packages/mini/krill-parser.js b/packages/mini/krill-parser.js index 1bb4c7e34..7604c53f2 100644 --- a/packages/mini/krill-parser.js +++ b/packages/mini/krill-parser.js @@ -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) { diff --git a/packages/mini/krill.pegjs b/packages/mini/krill.pegjs index bd40a1a42..0da434c52 100644 --- a/packages/mini/krill.pegjs +++ b/packages/mini/krill.pegjs @@ -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