Class: Delorean::BlockFormula

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

Instance Method Summary collapse

Instance Method Details

#check(context) ⇒ Object



458
459
460
461
462
463
464
465
466
467
468
469
# File 'lib/delorean/nodes.rb', line 458

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



475
476
477
# File 'lib/delorean/nodes.rb', line 475

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

#force_undef(context) ⇒ Object



479
480
481
# File 'lib/delorean/nodes.rb', line 479

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

#rewrite(context) ⇒ Object



471
472
473
# File 'lib/delorean/nodes.rb', line 471

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