class Ameba::AST::Argument

Overview

Represents the argument of some node. Holds the reference to the variable, thus to scope.

For example, all these vars are arguments:

def method(a, b, c = 10, &block)
  3.times do |i|
  end

  ->(x : Int32) { }
end

Defined in:

ameba/ast/variabling/argument.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(node : Crystal::ASTNode, variable : Ameba::AST::Variable) #

Creates a new argument.

Argument.new(node, variable)

Instance Method Detail

def anonymous? #

Returns true if the #name is empty, false otherwise.


def end_location(*args, **options) #

def end_location(*args, **options, &) #

def ignored? #

Returns true if the #name starts with '_', false otherwise.


def location(*args, **options) #

def location(*args, **options, &) #

def name #

Name of the argument.


def node : Crystal::Var | Crystal::Arg #

The actual node.


def to_s(*args, **options) #

def to_s(*args, **options, &) #

def variable : Variable #

Variable of this argument (may be the same node)