Sha256: 631884d0b56e78a784faec0456a2fd99e273319a57330ebe4363cba956a83cdc

Contents?: true

Size: 1.03 KB

Versions: 2

Compression:

Stored size: 1.03 KB

Contents

# encoding: utf-8
# frozen_string_literal: true

module Carbon
  module Tacky
    # A "value."  A value can be a parameter, a reference, or a number.
    #
    # @todo TODO: Figure out if I still need this.
    class Value
      # The name of the value.  This can be set in order to make the resulting
      # LLVM IR pretty.
      #
      # @return [::String]
      attr_accessor :name

      # The type of the value.  This is used in order to determine typing
      # information for LLVM.
      #
      # @return [Concrete::Type] If it is set.
      # @return [nil] If it is not set or determinable.
      attr_accessor :type

      # The actual value.
      #
      # @return [::Object]
      attr_accessor :value

      # Initialize the value.
      #
      # @param name [::String] The name of the value.
      # @param type [Concrete::Type, nil] The type of the value.
      # @param value [::Object] The actual value.
      def initialize(name, type, value)
        @name = name
        @type = type
        @value = value
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
carbon-core-0.1.1 lib/carbon/tacky/value.rb
carbon-core-0.1.0 lib/carbon/tacky/value.rb