Sha256: f5c2193a199e5f7dde7196100a4c12933b9bda53379d129e4ed8bd7abbfa535f

Contents?: true

Size: 355 Bytes

Versions: 21

Compression:

Stored size: 355 Bytes

Contents

class Code
  class Node
    class UnaryMinus < Node
      def initialize(parsed)
        @operator = parsed.delete(:operator)
        @right = Node::Statement.new(parsed.delete(:right))
        super(parsed)
      end

      def evaluate(**args)
        @right.evaluate(**args).call(operator: @operator, arguments: [], **args)
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 3 rubygems

Version Path
template-ruby-0.5.6 lib/code/node/unary_minus.rb
language-ruby-0.5.6 lib/code/node/unary_minus.rb
code-ruby-0.5.6 lib/code/node/unary_minus.rb
template-ruby-0.5.5 lib/code/node/unary_minus.rb
language-ruby-0.5.5 lib/code/node/unary_minus.rb
code-ruby-0.5.5 lib/code/node/unary_minus.rb
template-ruby-0.5.4 lib/code/node/unary_minus.rb
language-ruby-0.5.4 lib/code/node/unary_minus.rb
code-ruby-0.5.4 lib/code/node/unary_minus.rb
template-ruby-0.5.3 lib/code/node/unary_minus.rb
language-ruby-0.5.3 lib/code/node/unary_minus.rb
code-ruby-0.5.3 lib/code/node/unary_minus.rb
template-ruby-0.5.2 lib/code/node/unary_minus.rb
language-ruby-0.5.2 lib/code/node/unary_minus.rb
code-ruby-0.5.2 lib/code/node/unary_minus.rb
language-ruby-0.5.1 lib/code/node/unary_minus.rb
template-ruby-0.5.1 lib/code/node/unary_minus.rb
code-ruby-0.5.1 lib/code/node/unary_minus.rb
template-ruby-0.5.0 lib/code/node/unary_minus.rb
language-ruby-0.5.0 lib/code/node/unary_minus.rb