Matches entire if statements, including their condition expressions
and their true and false branches.
This pattern only matches nodes of type statement.
Properties
ifStatement produces a record that contains the following properties:
| Name | Type | Description |
|---|---|---|
conditionExpression |
expression |
The condition of the if
|
falseStatement |
statement? |
The statement to execute if the condition is false;
null if there is none
|
trueStatement |
statement |
The statement to execute if the condition is true |
Inherits properties from:
- astnode
- statement
Example
The following CodeXM pattern matches if statements
that have no else clause:
pattern ifNoElse {
ifStatement {
.falseStatement == null
}
};