# File lib/puppet/parser/scope.rb, line 295
295:     def setvar(name,value, options = {})
296:         table = options[:ephemeral] ? @ephemeral : @symtable
297:         #Puppet.debug "Setting %s to '%s' at level %s mode append %s" %
298:         #    [name.inspect,value,self.level, append]
299:         if table.include?(name)
300:             unless options[:append]
301:                 error = Puppet::ParseError.new("Cannot reassign variable %s" % name)
302:             else
303:                 error = Puppet::ParseError.new("Cannot append, variable %s is defined in this scope" % name)
304:             end
305:             if options[:file]
306:                 error.file = options[:file]
307:             end
308:             if options[:line]
309:                 error.line = options[:line]
310:             end
311:             raise error
312:         end
313: 
314:         unless options[:append]
315:             table[name] = value
316:         else # append case
317:             # lookup the value in the scope if it exists and insert the var
318:             table[name] = lookupvar(name)
319:             # concatenate if string, append if array, nothing for other types
320:             if value.is_a?(Array)
321:                 table[name] += value
322:             else
323:                 table[name] << value
324:             end
325:         end
326:     end