Sha256: bf11fba3aa1ad937c206816d14d0e689e5d2bb776f92134e996c8b5cf4aad44f

Contents?: true

Size: 803 Bytes

Versions: 3

Compression:

Stored size: 803 Bytes

Contents

class Fancy AST {
  class ExpressionList : Node {
    read_slot: 'expressions

    def initialize: @line list: @expressions ([]);

    def unshift_expression: expression {
      @expressions unshift(expression)
    }

    def add_expression: expression {
      @expressions << expression
    }

    def empty? {
      @expressions empty?
    }

    def bytecode: g {
      pos(g)
      size = @expressions size
      @expressions each: @{ bytecode: g } in_between: { g pop() }
    }

    # This method is only used by Rubinius' compiler classes and
    # defined to be able to use their bytecode generation toolchain.
    def strip_arguments {
      []
    }

    def docstring {
      if: (@expressions first kind_of?(Rubinius AST StringLiteral)) then: {
        @expressions first
      }
    }
  }
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fancy-0.10.0 lib/compiler/ast/expression_list.fy
fancy-0.9.0 lib/compiler/ast/expression_list.fy
fancy-0.8.0 lib/compiler/ast/expression_list.fy