47colborne/exel

View on GitHub
lib/exel/sequence_node.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

require_relative './ast_node'

module EXEL
  # A node in the AST that has as its children a sequence of nodes to be run sequentially
  class SequenceNode < ASTNode
    def initialize(*children)
      @instruction = NullInstruction.new
      @children = children
    end

    def run(context)
      @children.each { |child| child.run(context) }
    end
  end
end