Class: Delorean::BlockFormula

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

Instance Method Summary collapse

Instance Method Details

#check(context) ⇒ Object



489
490
491
492
493
494
495
496
497
498
499
500
# File 'lib/delorean/nodes.rb', line 489

def check(context, *)
  if i.text_value.include?('?')
    raise Delorean::ParseError.new(
      '? in formula names not supported',
      context.module_name,
      context.line_no
    )
  end

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

#force_def(context) ⇒ Object



506
507
508
# File 'lib/delorean/nodes.rb', line 506

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

#force_undef(context) ⇒ Object



510
511
512
# File 'lib/delorean/nodes.rb', line 510

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

#rewrite(context) ⇒ Object



502
503
504
# File 'lib/delorean/nodes.rb', line 502

def rewrite(context)
  "#{i.text_value}#{POST} = #{e.rewrite(context)}"
end