Sha256: d5c81a06e2a7ded1a8907ffb328b56beec7dc7b0107ffefdb768c4b1d1ff9bc1
Contents?: true
Size: 1.18 KB
Versions: 4
Compression:
Stored size: 1.18 KB
Contents
# frozen_string_literal: true module MiniKraken module Core # Mix-in module that implements the expected common behaviour of entries # placed in the symbol table. module Entry # @return [String] User-defined name of the entry. attr_reader :name # @return [String] Suffix for building the internal name of the entry. attr_accessor :suffix alias label name # Initialize the entry with given name # @param aName [String] The name of the entry def init_name(aName) @name = aName.dup @name.freeze end # Return the internal name of the entry # Internal names used to disambiguate entry names. # There might be homonyns between variable because: # - A child Scope may have a entry with same name as one of its # ancestor(s). # - Multiple calls to same defrel or procedure may imply multiple creation # of a entry given name... # @return [String] internal name def i_name if suffix =~ /^_/ label + suffix else (suffix.nil? || suffix.empty?) ? label : suffix end end end # module end # module end # module
Version data entries
4 entries across 4 versions & 1 rubygems