Sha256: caf55e7b325bfef1f60c2fd412ad8bdcd6b0af0535980edef6804e56c46cc9db
Contents?: true
Size: 925 Bytes
Versions: 43
Compression:
Stored size: 925 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_reader :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) assign(aValue) end # @param aValue [Datatype::BuiltinDatatype] the assigned value def assign(aValue) @value = aValue end end # class end # module end # module
Version data entries
43 entries across 43 versions & 1 rubygems
Version | Path |
---|---|
loxxy-0.0.26 | lib/loxxy/back_end/variable.rb |
loxxy-0.0.25 | lib/loxxy/back_end/variable.rb |
loxxy-0.0.24 | lib/loxxy/back_end/variable.rb |