class TPPlus::Nodes::LabelDefinitionNode

Attributes

identifier[R]

Public Class Methods

new(identifier) click to toggle source
# File lib/tp_plus/nodes/label_definition_node.rb, line 5
def initialize(identifier)
  @identifier = identifier
end

Public Instance Methods

eval(context) click to toggle source
# File lib/tp_plus/nodes/label_definition_node.rb, line 15
def eval(context)
  #context.add_label(@identifier)
  "LBL[#{context.labels[@identifier.to_sym]}:#{@identifier[0,16]}]#{long_identifier_comment(context)}"
end
long_identifier_comment(context) click to toggle source
# File lib/tp_plus/nodes/label_definition_node.rb, line 9
def long_identifier_comment(context)
  return "" unless @identifier.length > 16

  " ;\n! #{@identifier}"
end