CsStatement class

One statement of a generated body.

Read as syntax, like everything else in this model: a statement is its kind, its source text, and — where it has one — the call its value comes out of. That last part is what lets the codespecs_derivation_contract.md §2.4 invariant-2 check ask could the generator have made this value up? rather than does the body return?.

Constructors

CsStatement({required CsStatementKind kind, required String source, required CsLocation location, CsCall? call, String? valueIdentifier, String? valueSource, String? boundName, bool isFinal = false, List<CsStatement> nested = const [], String? keyword})
Creates a statement.
const

Properties

boundName → String?
The name a CsStatementKind.localBinding binds.
final
call → CsCall?
The call the statement's value comes out of — the returned expression, the binding's initialiser, the branch condition — unwrapped from any await. null when the value expression is not a call.
final
hashCode → int
The hash code for this object.
no setterinherited
isFinal → bool
Whether a local binding is declared final.
final
keyword → String?
Which control-flow construct a CsStatementKind.controlFlow statement is — if, for, while, switch, or block for a bare nested block.
final
kind → CsStatementKind
Which of the codespecs_derivation_contract.md §2.4 statement kinds this is.
final
location → CsLocation
Where the statement is written.
final
nested → List<CsStatement>
The statements inside a control-flow statement's blocks, in source order.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
selfAndNested → Iterable<CsStatement>
This statement and every statement nested inside it, outermost first.
no setter
source → String
The statement as written, whitespace-collapsed, so a message can quote it.
final
valueIdentifier → String?
The bare identifier the value expression is, when it is one. A return of a local bound earlier in the body reads as this.
final
valueSource → String?
The source text of the value expression, when the statement has one.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited