src/index.js
function extend(from, to, path, overrideLoc) {
  for (var prop in from) {
    if (!(prop in to) || (prop == "loc" && overrideLoc)) {
      to[prop] = from[prop]
    } else if (prop == "properties" || prop == "staticProperties") {
      extend(from[prop], to[prop], path.concat(prop))
    } else {
      var msg = "Conflicting information for " + path.join(".") + "." + prop
      if (to.loc) msg += " at " + to.loc.file + ":" + to.loc.line
      if (from.loc) msg += (to.loc ? " and " : " at ") + from.loc.file + ":" + from.loc.line
      throw new SyntaxError(msg)
    }
  }
  return to
}
function extend(from, to, path, overrideLoc) {
  for (var prop in from) {
    if (!(prop in to) || (prop == "loc" && overrideLoc)) {
      to[prop] = from[prop]
    } else if (prop == "properties" || prop == "staticProperties") {
      extend(from[prop], to[prop], path.concat(prop))
    } else {
      var msg = "Conflicting information for " + path.join(".") + "." + prop
      if (to.loc) msg += " at " + to.loc.file + ":" + to.loc.line
      if (from.loc) msg += (to.loc ? " and " : " at ") + from.loc.file + ":" + from.loc.line
      throw new SyntaxError(msg)
    }
  }
  return to
}
function extend ( from , to , path , overrideLoc ) { for ( var prop in from ) { if ( ! ( prop in to ) || ( prop == "loc" && overrideLoc ) ) { to [ prop ] = from [ prop ] } else if ( prop == "properties" || prop == "staticProperties" ) { extend ( from [ prop ] , to [ prop ] , path . concat ( prop ) ) } else { var msg = "Conflicting information for " + path . join ( "." ) + "." + prop if ( to . loc ) msg += " at " + to . loc . file + ":" + to . loc . line if ( from . loc ) msg += ( to . loc ? " and " : " at " ) + from . loc . file + ":" + from . loc . line throw new SyntaxError ( msg ) } } return to }
Deriving context from ancestor nodes
Deriving context from ancestor nodes