- transpiler now always returns an object
- emit transpiler metadata from evaluate / afterEval - currently logging miniLocations from Repl.jsx
This commit is contained in:
parent
5f271ed127
commit
8e717d2ea1
7 changed files with 25 additions and 19 deletions
|
|
@ -5,7 +5,7 @@ import { isNoteWithOctave } from '@strudel.cycles/core';
|
|||
import { getLeafLocations } from '@strudel.cycles/mini';
|
||||
|
||||
export function transpiler(input, options = {}) {
|
||||
const { wrapAsync = false, addReturn = true, simpleLocs = false, emitMiniLocations = false } = options;
|
||||
const { wrapAsync = false, addReturn = true, simpleLocs = false, emitMiniLocations = true } = options;
|
||||
|
||||
let ast = parse(input, {
|
||||
ecmaVersion: 2022,
|
||||
|
|
@ -62,7 +62,7 @@ export function transpiler(input, options = {}) {
|
|||
output = `(async ()=>{${output}})()`;
|
||||
}
|
||||
if (!emitMiniLocations) {
|
||||
return output;
|
||||
return { output };
|
||||
}
|
||||
return { output, miniLocations };
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue