Class Nodes.CaseMatchNode
java.lang.Object
org.prism.Nodes.Node
org.prism.Nodes.CaseMatchNode
- Enclosing class:
Nodes
Represents the use of a case statement for pattern matching.
case true
in false
end
^^^^^^^^^
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal Nodes.InNode[]Represents the conditions of the case match.final Nodes.ElseNodeRepresents the else clause of the case match.final Nodes.NodeRepresents the predicate of the case match.Fields inherited from class org.prism.Nodes.Node
EMPTY_ARRAY, length, startOffset -
Constructor Summary
ConstructorsConstructorDescriptionCaseMatchNode(int startOffset, int length, Nodes.Node predicate, Nodes.InNode[] conditions, Nodes.ElseNode else_clause) -
Method Summary
Modifier and TypeMethodDescription<T> Taccept(AbstractNodeVisitor<T> visitor) protected String<T> voidvisitChildNodes(AbstractNodeVisitor<T> visitor) Methods inherited from class org.prism.Nodes.Node
endOffset, hasNewLineFlag, setNewLineFlag, setNewLineFlag, toString
-
Field Details
-
predicate
Represents the predicate of the case match. This can be either `nil` or any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). case true; in false; end ^^^^ -
conditions
Represents the conditions of the case match. case true; in false; end ^^^^^^^^ -
else_clause
Represents the else clause of the case match. case true; in false; else; end ^^^^
-
-
Constructor Details
-
CaseMatchNode
public CaseMatchNode(int startOffset, int length, Nodes.Node predicate, Nodes.InNode[] conditions, Nodes.ElseNode else_clause)
-
-
Method Details
-
visitChildNodes
- Specified by:
visitChildNodesin classNodes.Node
-
childNodes
- Specified by:
childNodesin classNodes.Node
-
accept
- Specified by:
acceptin classNodes.Node
-
toString
- Specified by:
toStringin classNodes.Node
-