2018-07-23 11:44:34 +00:00
|
|
|
import attributes from "./attributes";
|
2018-07-23 11:12:06 +00:00
|
|
|
|
2018-07-23 11:44:34 +00:00
|
|
|
function snippet(def, anchor, description = "") {
|
2018-07-23 11:12:06 +00:00
|
|
|
this.def = def;
|
|
|
|
this.anchor = anchor;
|
|
|
|
this.description = description;
|
|
|
|
this.attributes = new attributes();
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2018-08-03 14:20:28 +02:00
|
|
|
/** Returns a deep copy of this */
|
|
|
|
snippet.prototype.clone = function() {
|
|
|
|
let clone = new snippet(this.def, this.anchor.clone(), this.description);
|
|
|
|
clone.attributes = this.attributes.clone();
|
|
|
|
|
|
|
|
return clone;
|
|
|
|
};
|
|
|
|
|
2018-07-23 11:12:06 +00:00
|
|
|
export default snippet;
|