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

- old
+ new

@@ -1,25 +1,27 @@ # frozen_string_literal: true -require_relative 'lox_compound_expr' +require_relative 'lox_node' module Loxxy module Ast # rubocop: disable Style/AccessorGrouping - class LoxFunStmt < LoxCompoundExpr + class LoxFunStmt < LoxNode attr_reader :name attr_reader :params attr_reader :body + attr_accessor :is_method # @param aPosition [Rley::Lexical::Position] Position of the entry in the input stream. # @param aName [String] # @param arguments [Array<String>] # @param body [Ast::LoxBlockStmt] def initialize(aPosition, aName, paramList, aBody) - super(aPosition, []) + super(aPosition) @name = aName.dup @params = paramList @body = aBody + @is_method = false end # Part of the 'visitee' role in Visitor design pattern. # @param visitor [Ast::ASTVisitor] the visitor def accept(visitor)