// Clone will clone this Variable. The new clone will have an identical structure
Clone will clone this Variable. The new clone will have an identical structure
// Clone will clone this Variable . The new clone will have an identical structure
func (e *Variable) Clone(cloneTable *pkg.CloneTable) *Variable {
	clone := &Variable{
		AstID:   unique.NewID(),
		GrlText: e.GrlText,
		Name:    e.Name,
	}
	if e.Variable != nil {
		if cloneTable.IsCloned(e.Variable.AstID) {
			clone.Variable = cloneTable.Records[e.Variable.AstID].CloneInstance.(*Variable)
		} else {
			cloned := e.Variable.Clone(cloneTable)
			clone.Variable = cloned
			cloneTable.MarkCloned(e.Variable.AstID, cloned.AstID, e.Variable, cloned)
		}
	}
	if e.ArrayMapSelector != nil {
		if cloneTable.IsCloned(e.ArrayMapSelector.AstID) {
			clone.ArrayMapSelector = cloneTable.Records[e.ArrayMapSelector.AstID].CloneInstance.(*ArrayMapSelector)
		} else {
			cloned := e.ArrayMapSelector.Clone(cloneTable)
			clone.ArrayMapSelector = cloned
			cloneTable.MarkCloned(e.ArrayMapSelector.AstID, cloned.AstID, e.ArrayMapSelector, cloned)
		}
	}
	return clone
}
func ( e * Variable ) Clone ( cloneTable * pkg . CloneTable ) * Variable { clone := & Variable { AstID : unique . NewID ( ) , GrlText : e . GrlText , Name : e . Name , } if e . Variable != nil { if cloneTable . IsCloned ( e . Variable . AstID ) { clone . Variable = cloneTable . Records [ e . Variable . AstID ] . CloneInstance . ( * Variable ) } else { cloned := e . Variable . Clone ( cloneTable ) clone . Variable = cloned cloneTable . MarkCloned ( e . Variable . AstID , cloned . AstID , e . Variable , cloned ) } } if e . ArrayMapSelector != nil { if cloneTable . IsCloned ( e . ArrayMapSelector . AstID ) { clone . ArrayMapSelector = cloneTable . Records [ e . ArrayMapSelector . AstID ] . CloneInstance . ( * ArrayMapSelector ) } else { cloned := e . ArrayMapSelector . Clone ( cloneTable ) clone . ArrayMapSelector = cloned cloneTable . MarkCloned ( e . ArrayMapSelector . AstID , cloned . AstID , e . ArrayMapSelector , cloned ) } } return clone }
Clone will clone this Variable.
Clone will clone this Variable .