Class: Delorean::NodeAsValue

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

Instance Method Summary collapse

Instance Method Details

#check(context) ⇒ Object



178
179
180
181
182
183
184
185
186
187
188
# File 'lib/delorean/nodes.rb', line 178

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



190
191
192
193
194
195
196
197
198
199
200
201
# File 'lib/delorean/nodes.rb', line 190

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