Sha256: 50ac88bf5701660e2178973bf8f8fb1e9400821cfda38e5b9e678a2e21ec2ef4

Contents?: true

Size: 881 Bytes

Versions: 3

Compression:

Stored size: 881 Bytes

Contents

class Fancy
  class AST

    class SingletonMethodDef < Rubinius::AST::DefineSingleton
      def initialize(line, obj_ident, method_ident, args, body, access = :public)
        body = AST::ExpressionList.new(line) unless body

        @line = line
        @receiver = obj_ident
        @name = method_ident.method_name(@receiver)
        @arguments = args
        @body = SingletonMethodDefScope.new line, @name, args, body
        @access = access
      end
    end

    class SingletonMethodDefScope < Rubinius::AST::DefineSingletonScope
      def initialize(line, name, args, body)
        @line = line
        @name = name
        @arguments = args
        @body = body
      end

      def bytecode(g, recv)
        #docstring = @body.shift_docstring
        super(g, recv)
        #MethodDef.set_docstring(g, docstring, @line, @arguments.names)
      end

    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fancy-0.10.0 boot/rbx-compiler/compiler/ast/singleton_method_def.rb
fancy-0.9.0 boot/rbx-compiler/compiler/ast/singleton_method_def.rb
fancy-0.8.0 boot/rbx-compiler/compiler/ast/singleton_method_def.rb