composer.js
function label (composition) {
  const label = path => (composition, name, array) => {
    const p = path + (name !== undefined ? (array === undefined ? `.${name}` : `[${name}]`) : '')
    composition = visit(composition, label(p)) // copy
    composition.path = p
    return composition
  }
  return label('')(composition)
}
function label (composition) {
  const label = path => (composition, name, array) => {
    const p = path + (name !== undefined ? (array === undefined ? `.${name}` : `[${name}]`) : '')
    composition = visit(composition, label(p)) // copy
    composition.path = p
    return composition
  }
  return label('')(composition)
}
function label ( composition ) { const label = path => ( composition , name , array ) => { const p = path + ( name !== undefined ? ( array === undefined ? ` ${ name } ` : ` ${ name } ` ) : '' ) composition = visit ( composition , label ( p ) ) // copy composition . path = p return composition } return label ( '' ) ( composition ) }
recursively label combinators with the json path
recursively label combinators with the json path