class Myst::Param
- Myst::Param
- Myst::Node
- Reference
- Object
Overview
A parameter for a method definition. Parameters can take many forms. The simplest parameter is just a name or a pattern. If the parameter is a name, it may be prefixed by a '*' to indicate a splat argument, or a '&' to indicate a block argument.
Additionally, if the parameter is a name, it may be prefixed with a pattern and a match operator, or suffixed with a type restriction and/or guard clause, as shown in the final form.
pattern | '*' name | '&' name | [ pattern '=:' ] name [ ':' const ] [ '|' guard ]
Defined in:
myst/syntax/ast.crConstructors
Instance Method Summary
-
#==(other : self)
Returns
true
if this reference is the same as other. - #accept_children(visitor)
- #block=(block : Bool)
- #block? : Bool
- #guard : Node | Nil
- #guard=(guard : Node | Nil)
- #guard? : Node | Nil | Nil
-
#hash(hasher)
See
Object#hash(hasher)
- #name : String | Nil
- #name=(name : String | Nil)
- #name? : String | Nil | Nil
- #pattern : Node | Nil
- #pattern=(pattern : Node | Nil)
- #pattern? : Node | Nil | Nil
- #restriction : Const | Nil
- #restriction=(restriction : Const | Nil)
- #restriction? : Const | Nil | Nil
- #splat=(splat : Bool)
- #splat? : Bool
Instance methods inherited from class Myst::Node
accept(visitor)
accept,
accept_children(visitor)
accept_children,
at(node : Node)at(node : Nil)
at(location : Location) at, at_end(node : Node)
at_end(node : Nil)
at_end(end_location : Location) at_end, class_desc : String class_desc, end_location : Location | Nil end_location, end_location=(end_location : Location | Nil) end_location=, location : Location | Nil location, location=(location : Location | Nil) location=
Constructor Detail
def self.new(pattern : Myst::Node | Nil = nil, name : Nil | String = nil, restriction : Nil | Myst::Const = nil, guard : Myst::Node | Nil = nil, splat : Bool = false, block : Bool = false)
#
Instance Method Detail
def ==(other : self)
#
Description copied from class Reference
Returns true
if this reference is the same as other. Invokes same?
.