fix: rests at the end

This commit is contained in:
Felix Roos 2025-05-03 11:44:02 +02:00
parent 607a6121bc
commit 2951a60fac
No known key found for this signature in database

View file

@ -155,7 +155,9 @@ export class MondoParser {
if (opIndex === -1) break;
const op = { type: 'plain', value: children[opIndex].value };
if (opIndex === children.length - 1) {
throw new Error(`cannot use operator as last child.`);
//throw new Error(`cannot use operator as last child.`);
children[opIndex] = op; // ignore operator if last child.. e.g. "note [c -]"
continue;
}
if (opIndex === 0) {
// regular function call (assuming each operator exists as function)