Logo fantomas

ChainSegment Type

A single dot-prefixed step in a member-access or call chain. Every step is reached through a .; the dot is an explicit so that trivia (comments, blank lines) attached to it are preserved during formatting. A segment is always intermediate: the final call of a chain is the ExprChain.Terminal, never a segment here. That is why DotApplication (an intermediate call) is distinct from DotMember (plain access) — the distinction the layout cares about (navigation vs. action) is then visible in the shape of the data itself.

Union cases

Union case Description

DotApplication(dot, expr, call)

Full Usage: DotApplication(dot, expr, call)

Parameters:
   .Foo(x)     — intermediate call — always tight, never a space before (
   .Foo()      — intermediate unit call — always tight
 e.g. the `.Foo(x)` in `a.Foo(x).Bar`.  The terminal call of a chain is not a segment.
dot : SingleTextNode
expr : Expr
call : ChainCall

DotIndex(dot, indexExpr)

Full Usage: DotIndex(dot, indexExpr)

Parameters:

Old dot-bracket index syntax: arr.[i]. DotIndex is a separate case rather than DotMember because the [ and ] brackets are not part of indexExpr in the AST — genExpr indexExpr produces only the content (e.g. 0), not [0]. No existing Expr type naturally renders bracketed index content, so the printer must add [ and ] explicitly. From a layout perspective DotIndex is identical to DotMember — both are navigation segments with no call.

dot : SingleTextNode
indexExpr : Expr

DotMember(dot, expr)

Full Usage: DotMember(dot, expr)

Parameters:

.Foo — plain property access (navigation) .Items[0] — expr = IndexWithoutDot(Items, [0]), no dedicated case needed

dot : SingleTextNode
expr : Expr

Instance members

Instance member Description

this.IsDotApplication

Full Usage: this.IsDotApplication

Returns: bool
Returns: bool

this.IsDotIndex

Full Usage: this.IsDotIndex

Returns: bool
Returns: bool

this.IsDotMember

Full Usage: this.IsDotMember

Returns: bool
Returns: bool

Type something to start searching.