A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://ruby-syntax-tree.github.io/syntax_tree/SyntaxTree/ModuleDeclaration.html below:

class SyntaxTree::ModuleDeclaration - RDoc Documentation

  1. SyntaxTree::
  2. ModuleDeclaration
class SyntaxTree::ModuleDeclaration

ModuleDeclaration represents defining a module using the module keyword.

module Namespace
end
Attributes
BodyStmt

the expressions to be executed in the context of the module

Public Class Methods

Source

def initialize(constant:, bodystmt:, location:)
  @constant = constant
  @bodystmt = bodystmt
  @location = location
  @comments = []
end
Public Instance Methods

Source

def ===(other)
  other.is_a?(ModuleDeclaration) && constant === other.constant &&
    bodystmt === other.bodystmt
end

Source

def accept(visitor)
  visitor.visit_module(self)
end

Source

def child_nodes
  [constant, bodystmt]
end

Source

def copy(constant: nil, bodystmt: nil, location: nil)
  node =
    ModuleDeclaration.new(
      constant: constant || self.constant,
      bodystmt: bodystmt || self.bodystmt,
      location: location || self.location
    )

  node.comments.concat(comments.map(&:copy))
  node
end

Source

def deconstruct_keys(_keys)
  {
    constant: constant,
    bodystmt: bodystmt,
    location: location,
    comments: comments
  }
end

Source

def format(q)
  if bodystmt.empty?
    q.group do
      format_declaration(q)
      q.breakable_force
      q.text("end")
    end
  else
    q.group do
      format_declaration(q)

      q.indent do
        q.breakable_force
        q.format(bodystmt)
      end

      q.breakable_force
      q.text("end")
    end
  end
end

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4