Sha256: 68ba9fef9252af1442d344aa25d3276f242d9ad6d576eef1e62ae22c3121c2f0

Contents?: true

Size: 700 Bytes

Versions: 8

Compression:

Stored size: 700 Bytes

Contents

# frozen_string_literal: true

require_relative 'lox_compound_expr'

module Loxxy
  module Ast
    class LoxBlockStmt < LoxCompoundExpr
      # @param aPosition [Rley::Lexical::Position] Position of the entry in the input stream.
      # @param decls [Loxxy::Ast::LoxSeqDecl]
      def initialize(aPosition, decls)
        super(aPosition, [decls])
      end

      def empty?
        subnodes.size == 1 && subnodes[0].nil?
      end

      # Part of the 'visitee' role in Visitor design pattern.
      # @param visitor [Ast::ASTVisitor] the visitor
      def accept(visitor)
        visitor.visit_block_stmt(self)
      end

      alias operands subnodes
    end # class
  end # module
end # module

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
loxxy-0.1.07 lib/loxxy/ast/lox_block_stmt.rb
loxxy-0.1.06 lib/loxxy/ast/lox_block_stmt.rb
loxxy-0.1.05 lib/loxxy/ast/lox_block_stmt.rb
loxxy-0.1.04 lib/loxxy/ast/lox_block_stmt.rb
loxxy-0.1.03 lib/loxxy/ast/lox_block_stmt.rb
loxxy-0.1.02 lib/loxxy/ast/lox_block_stmt.rb
loxxy-0.1.01 lib/loxxy/ast/lox_block_stmt.rb
loxxy-0.1.0 lib/loxxy/ast/lox_block_stmt.rb