Expand description
Hand-rolled S-expression parser for the Refrain DSL.
Grammar (informal):
refrain := "(" "refrain" IDENT stage* ")"
stage := "(" stage-kind pattern+ ")"
stage-kind := "territorialize" | "deterritorialize" | "reterritorialize"
pattern := ATOM | "(" op-head pattern* ")"
op-head := "note" | "loop" | "dy/dx" | "quotient" | IDENTSequences of patterns inside a stage become Pattern::Seq. Unknown
function-like forms become Op::Call { head, args } so the parser does
not have to be updated for every future operator.