Class: Chelsy::Operator::Unary

Inherits:
Base show all
Defined in:
lib/chelsy/ast.rb

Direct Known Subclasses

Defined, Postfix, Prefix, SizeOf

Instance Attribute Summary collapse

Attributes inherited from Element

#fragments, #post_fragments

Instance Method Summary collapse

Methods inherited from Base

operator, precedence

Constructor Details

#initialize(operand, **rest) ⇒ Unary

Returns a new instance of Unary.



544
545
546
547
548
# File 'lib/chelsy/ast.rb', line 544

def initialize(operand, **rest)
  # `sizeof` operator accepts expr or type as its operand.
  @operand = operand
  super **rest
end

Instance Attribute Details

#operandObject (readonly)

Returns the value of attribute operand.



542
543
544
# File 'lib/chelsy/ast.rb', line 542

def operand
  @operand
end