Sha256: 8830bb082cc90db71dacffca5854e090a0d84e0f03d124360b3dacbe96e1e8fd
Contents?: true
Size: 799 Bytes
Versions: 1
Compression:
Stored size: 799 Bytes
Contents
# frozen_string_literal: true require_relative 'entry' require_relative '../datatype/all_datatypes' module Loxxy module BackEnd # Representation of a Lox variable. # It is a named slot that can be associated with a value at the time. class Variable include Entry # Add expected behaviour for symbol table entries # @return [Datatype::BuiltinDatatype] the value assigned to the variable attr_accessor :value # Create a variable with given name and initial value # @param aName [String] The name of the variable # @param aValue [Datatype::BuiltinDatatype] the initial assigned value def initialize(aName, aValue = Datatype::Nil.instance) init_name(aName) @value = aValue end end # class end # module end # module
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
loxxy-0.0.23 | lib/loxxy/back_end/variable.rb |