Class: Luoma::PosExpression

Inherits:
PrefixExpression show all
Defined in:
lib/luoma/expression.rb,
sig/luoma/expression.rbs

Instance Attribute Summary

Attributes inherited from Expression

#span, #token

Instance Method Summary collapse

Methods inherited from PrefixExpression

#children, #initialize

Methods inherited from Expression

#children, #initialize, #scope

Constructor Details

This class inherits a constructor from Luoma::PrefixExpression

Instance Method Details

#evaluate(context) ⇒ Object



375
376
377
# File 'lib/luoma/expression.rb', line 375

def evaluate(context)
  context.env.to_numeric(@right.evaluate(context), context, default: :nothing)
end

#to_sObject

Signature:

  • () -> String



380
381
382
# File 'lib/luoma/expression.rb', line 380

def to_s
  "+#{@right}"
end