Class: Delorean::NodeAsValue

Inherits:
SNode
  • Object
show all
Defined in:
lib/delorean/nodes.rb

Instance Method Summary collapse

Instance Method Details

#check(context) ⇒ Object



170
171
172
173
174
175
176
177
178
179
180
# File 'lib/delorean/nodes.rb', line 170

def check(context, *)
  node_name = c.text_value
  mname = mod.m.text_value if defined?(mod.m)
  begin
    context.parse_check_defined_mod_node(node_name, mname)
  rescue UndefinedError, ParseError
    # Node is a non-Delorean ruby class
    context.parse_class(text_value)
  end
  []
end

#rewrite(context) ⇒ Object



182
183
184
185
186
187
188
189
190
191
192
193
# File 'lib/delorean/nodes.rb', line 182

def rewrite(context)
  node_name = c.text_value
  mname = mod.m.text_value if defined?(mod.m)
  begin
    context.parse_check_defined_mod_node(node_name, mname)
    context.super_name(node_name, mname)
  rescue UndefinedError, ParseError
    # FIXME: wrap the class name so Call will be able to tell it
    # apart from a regular value.
    ClassText.new(text_value)
  end
end