Skip to content

class Crystal::Assign
inherits Crystal::ASTNode

Assign expression.

target '=' value

Class methods

.new(target, value)

View source

Methods

#==(other : self)

Returns true if this reference is the same as other. Invokes same?.

#accept_children(visitor)

View source

#clone_without_location

View source

#discarded=(discarded)

Whether a class variable assignment needs to be skipped because it was replaced with another initializer

class Foo
  @@x = 1 # This will never execute
  @@x = 2
end
View source

#discarded? : Bool

Whether a class variable assignment needs to be skipped because it was replaced with another initializer

class Foo
  @@x = 1 # This will never execute
  @@x = 2
end
View source

#doc : String?

Returns the doc comment attached to this node. Not every node supports having doc comments, so by default this returns nil.

View source

#doc=(doc : String?)

View source

#end_location

The location where this node ends, or nil if the location is not known.

View source

#hash(hasher)

#interpret(method : String, args : Array(ASTNode), named_args : Hash(String, ASTNode)?, block : Crystal::Block?, interpreter : Crystal::MacroInterpreter, name_loc : Location?)

View source

#target : ASTNode

View source

#target=(target : ASTNode)

View source

#value=(value : ASTNode)

View source

#visibility=(visibility)

View source