Sha256: 4ea5bb50d3ac63759373bde496865184cc5ace0cdafd993777c9e402c68028d7

Contents?: true

Size: 832 Bytes

Versions: 18

Compression:

Stored size: 832 Bytes

Contents

# frozen_string_literal: true

require_relative 'lox_node'

module Loxxy
  module Ast
    class LoxSuperExpr < LoxNode
      # @return [Ast::LoxNode] the object to which the property belongs to
      attr_accessor :object

      # @return [String] Name of a method name
      attr_reader :property

      # @param aPosition [Rley::Lexical::Position] Position of the entry in the input stream.
      # @param aMethodName [String] Name of a method
      def initialize(aPosition, aMethodName)
        super(aPosition)
        @property = aMethodName
      end

      # Quack like a LoxVariableExpr
      # @return [String] the `super` keyword
      def name
        'super'
      end

      define_accept # Add `accept` method as found in Visitor design pattern
      alias callee= object=
    end # class
  end # module
end # module

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
loxxy-0.4.09 lib/loxxy/ast/lox_super_expr.rb
loxxy-0.4.08 lib/loxxy/ast/lox_super_expr.rb
loxxy-0.4.07 lib/loxxy/ast/lox_super_expr.rb
loxxy-0.4.06 lib/loxxy/ast/lox_super_expr.rb
loxxy-0.4.05 lib/loxxy/ast/lox_super_expr.rb
loxxy-0.4.04 lib/loxxy/ast/lox_super_expr.rb
loxxy-0.4.03 lib/loxxy/ast/lox_super_expr.rb
loxxy-0.4.02 lib/loxxy/ast/lox_super_expr.rb
loxxy-0.4.01 lib/loxxy/ast/lox_super_expr.rb
loxxy-0.4.00 lib/loxxy/ast/lox_super_expr.rb
loxxy-0.3.03 lib/loxxy/ast/lox_super_expr.rb
loxxy-0.3.02 lib/loxxy/ast/lox_super_expr.rb
loxxy-0.3.01 lib/loxxy/ast/lox_super_expr.rb
loxxy-0.3.00 lib/loxxy/ast/lox_super_expr.rb
loxxy-0.2.06 lib/loxxy/ast/lox_super_expr.rb
loxxy-0.2.05 lib/loxxy/ast/lox_super_expr.rb
loxxy-0.2.04 lib/loxxy/ast/lox_super_expr.rb
loxxy-0.2.03 lib/loxxy/ast/lox_super_expr.rb