packages/shape-map/lib/ShapeMapJison.js
// Add a shape to the map
Add a shape to the map
Add a shape to the map
function addShape (label, shape) {
    if (ShapeMapJisonParser.productions && label in ShapeMapJisonParser.productions)
      error("Structural error: "+label+" is a shape");
    if (!ShapeMapJisonParser.shapes)
      ShapeMapJisonParser.shapes = {};
    if (label in ShapeMapJisonParser.shapes) {
      if (ShapeMapJisonParser.options.duplicateShape === "replace")
        ShapeMapJisonParser.shapes[label] = shape;
      else if (ShapeMapJisonParser.options.duplicateShape !== "ignore")
        error("Parse error: "+label+" already defined");
    } else
      ShapeMapJisonParser.shapes[label] = shape;
  }
function addShape ( label , shape ) { if ( ShapeMapJisonParser . productions && label in ShapeMapJisonParser . productions ) error ( "Structural error: " + label + " is a shape" ) ; if ( ! ShapeMapJisonParser . shapes ) ShapeMapJisonParser . shapes = { } ; if ( label in ShapeMapJisonParser . shapes ) { if ( ShapeMapJisonParser . options . duplicateShape === "replace" ) ShapeMapJisonParser . shapes [ label ] = shape ; else if ( ShapeMapJisonParser . options . duplicateShape !== "ignore" ) error ( "Parse error: " + label + " already defined" ) ; } else ShapeMapJisonParser . shapes [ label ] = shape ; }
Add a shape to the map
Add a shape to the map