Sha256: faa67b3cfb98e81065dd4e6639cfd52f06cbcf3aa5469e8dcac0113f2c200b2b

Contents?: true

Size: 906 Bytes

Versions: 18

Compression:

Stored size: 906 Bytes

Contents

# @Opulent
module Opulent
  # @Compiler
  class Compiler
    # Generate the code for a while control structure
    #
    # @param node [Array] Node code generation data
    # @param indent [Fixnum] Size of the indentation to be added
    # @param context [Context] Processing environment data
    #
    def yield_node(node, indent, context)
      if @block_stack[-1].has_key? node[@value]
        @block_stack[-1][node[@value]].each do |child|
          root child, indent, context.parent
        end
      end
    end

    # Generate the code for a while control structure
    #
    # @param node [Array] Node code generation data
    # @param indent [Fixnum] Size of the indentation to be added
    # @param context [Context] Processing environment data
    #
    def block_node(node, indent, context)
      node[@children].each do |child|
        root child, indent, context
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
opulent-1.4.0 lib/opulent/compiler/block.rb
opulent-1.3.3 lib/opulent/compiler/block.rb
opulent-1.3.2 lib/opulent/compiler/block.rb
opulent-1.3.1 lib/opulent/compiler/block.rb
opulent-1.3.0 lib/opulent/compiler/block.rb
opulent-1.2.1 lib/opulent/compiler/block.rb
opulent-1.2.0 lib/opulent/compiler/block.rb
opulent-1.1.9 lib/opulent/compiler/block.rb
opulent-1.1.7 lib/opulent/compiler/block.rb
opulent-1.1.6 lib/opulent/compiler/block.rb
opulent-1.1.5 lib/opulent/compiler/block.rb
opulent-1.1.0 lib/opulent/compiler/block.rb
opulent-1.0.9 lib/opulent/compiler/block.rb
opulent-1.0.8 lib/opulent/compiler/block.rb
opulent-1.0.7 lib/opulent/compiler/block.rb
opulent-1.0.4 lib/opulent/compiler/block.rb
opulent-1.0.3 lib/opulent/compiler/block.rb
opulent-1.0.2 lib/opulent/compiler/block.rb