Class: Delorean::BlockParameter

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

Direct Known Subclasses

BlockParameterDefault

Instance Method Summary collapse

Instance Method Details

#check(context) ⇒ Object



422
423
424
425
# File 'lib/delorean/nodes.rb', line 422

def check(context)
  context.parse_define_var(i.text_value)
  context.parse_undef_var(i.text_value)
end

#force_def(context) ⇒ Object



437
438
439
# File 'lib/delorean/nodes.rb', line 437

def force_def(context)
  context.parse_define_var(i.text_value)
end

#force_undef(context) ⇒ Object



441
442
443
# File 'lib/delorean/nodes.rb', line 441

def force_undef(context)
  context.parse_undef_var(i.text_value)
end

#rewrite(context) ⇒ Object



427
428
429
430
431
432
433
434
435
# File 'lib/delorean/nodes.rb', line 427

def rewrite(context)
  a_name = i.text_value
  expr = defined?(e) ? e.rewrite(context) : ''
  expr = expr.strip

  return "#{a_name}#{POST}" if expr.empty?

  "#{a_name}#{POST} = #{expr}"
end