import produce from "immer" ; import { findIntroducedSymbols } from "literate-elm" ; import { AttributeDerivatives } from "../types" ; param derivatives param code export const resolveExpressions = ( derivatives , code ) => { const introducedSymbols = findIntroducedSymbols ( code ) ; const introducedNames = introducedSymbols . map ( ( s ) => s . name ) ; return produce ( derivatives , ( draft ) => { draft . outputFormats . forEach ( ( referenceFormat ) => { if ( referenceFormat !== "l" && ! draft . outputExpressionsByFormat [ referenceFormat ] ) { draft . outputExpressionsByFormat [ referenceFormat ] = introducedNames ; } } ) ; } ) ; } ;