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)

[View source]

Instance Method Detail

def anonymous? #

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


[View source]
def end_location(*args, **options) #

[View source]
def end_location(*args, **options, &) #

[View source]
def ignored? #

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


[View source]
def location(*args, **options) #

[View source]
def location(*args, **options, &) #

[View source]
def name #

Name of the argument.


[View source]
def node : Crystal::Var | Crystal::Arg #

The actual node.


[View source]
def to_s(*args, **options) #

[View source]
def to_s(*args, **options, &) #

[View source]
def variable : Variable #

Variable of this argument (may be the same node)


[View source]