lib/loxxy/ast/lox_class_stmt.rb in loxxy-0.1.12 vs lib/loxxy/ast/lox_class_stmt.rb in loxxy-0.1.13

- old
+ new

@@ -3,25 +3,28 @@ require_relative 'lox_compound_expr' module Loxxy module Ast class LoxClassStmt < LoxCompoundExpr + # @return [String] the class name attr_reader :name + # @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 [Loxxy::Ast::LoxNode] + # @param theBody [Array<Loxxy::Ast::LoxNode>] def initialize(aPosition, aName, theMethods) - super(aPosition, theMethods) + super(aPosition, []) @name = aName.dup + @body = theMethods end # Part of the 'visitee' role in Visitor design pattern. # @param visitor [Ast::ASTVisitor] the visitor def accept(visitor) visitor.visit_class_stmt(self) end - - alias body subnodes end # class end # module end # module