403Webshell
Server IP : 104.21.14.103  /  Your IP : 3.149.239.100
Web Server : LiteSpeed
System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : giankuin ( 1871)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/evaluator/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/evaluator/json_strict_literal_evaluator.rb
# Literal values for
#
#   * String
#   * Numbers
#   * Booleans
#   * Undef (produces nil)
#   * Array
#   * Hash where keys must be Strings
#   * QualifiedName
#
# Not considered literal:
#
#   * QualifiedReference  # i.e. File, FooBar
#   * Default is not accepted as being literal
#   * Regular Expression is not accepted as being literal
#   * Hash with non String keys
#   * String with interpolation
#
class Puppet::Pops::Evaluator::JsonStrictLiteralEvaluator
  #include Puppet::Pops::Utils

  COMMA_SEPARATOR = ', '.freeze

  def initialize
    @@literal_visitor ||= Puppet::Pops::Visitor.new(self, "literal", 0, 0)
  end

  def literal(ast)
    @@literal_visitor.visit_this_0(self, ast)
  end

  def literal_Object(o)
    throw :not_literal
  end

  def literal_Factory(o)
    literal(o.model)
  end

  def literal_Program(o)
    literal(o.body)
  end

  def literal_LiteralString(o)
    o.value
  end

  def literal_QualifiedName(o)
    o.value
  end

  def literal_LiteralNumber(o)
    o.value
  end

  def literal_LiteralBoolean(o)
    o.value
  end

  def literal_LiteralUndef(o)
    nil
  end

  def literal_ConcatenatedString(o)
    # use double quoted string value if there is no interpolation
    throw :not_literal unless o.segments.size == 1 && o.segments[0].is_a?(Puppet::Pops::Model::LiteralString)
    o.segments[0].value
  end

  def literal_LiteralList(o)
    o.values.map {|v| literal(v) }
  end

  def literal_LiteralHash(o)
    o.entries.reduce({}) do |result, entry|
      key = literal(entry.key)
      throw :not_literal unless key.is_a?(String)
      result[key] = literal(entry.value)
      result
    end
  end
end

Youez - 2016 - github.com/yon3zu
LinuXploit