lib/loxxy/ast/lox_class_stmt.rb in loxxy-0.1.17 vs lib/loxxy/ast/lox_class_stmt.rb in loxxy-0.2.00
- old
+ new
@@ -6,18 +6,22 @@
module Ast
class LoxClassStmt < LoxCompoundExpr
# @return [String] the class name
attr_reader :name
+ # @return [Ast::LoxVariableExpr] variable referencing the superclass (if any)
+ attr_reader :superclass
+
# @return [Array<Ast::LoxFunStmt>] the methods
attr_reader :body
# @param aPosition [Rley::Lexical::Position] Position of the entry in the input stream.
# @param condExpr [Loxxy::Ast::LoxNode] iteration condition
# @param theBody [Array<Loxxy::Ast::LoxNode>]
- def initialize(aPosition, aName, theMethods)
+ def initialize(aPosition, aName, aSuperclassName, theMethods)
super(aPosition, [])
@name = aName.dup
+ @superclass = aSuperclassName
@body = theMethods
end
# Part of the 'visitee' role in Visitor design pattern.
# @param visitor [Ast::ASTVisitor] the visitor