Equations
Equations
Instances For
Like Lean.Syntax.updateLeading, but preserves the starting position of the syntax if it
exists (instead of setting it to 0). See the docstring of updateLeading for more details.
Equations
Instances For
Like Lean.TSyntax.updateLeading, but preserves the starting position of the syntax if it
exists (instead of setting it to 0). See the docstring of updateLeading for more details.
Equations
- stx.updateLeadingPreservingStart = { raw := stx.raw.updateLeadingPreservingStart }
Instances For
Gets the leading whitespace of .original SourceInfo, or none if not .original.
Equations
- (Lean.SourceInfo.original leading pos trailing endPos).getLeading? = some leading
- x✝.getLeading? = none
Instances For
Gets the leading whitespace of .original SourceInfo, or the empty substring if not
.original.
Equations
- info.getLeading = info.getLeading?.getD "".toRawSubstring
Instances For
Gets the trailing whitespace of .original SourceInfo, or the empty substring if not
.original.
Equations
- info.getTrailing = info.getTrailing?.getD "".toRawSubstring
Instances For
Clear the leading whitespace of the given syntax if the head SourceInfo is .original, and
otherwise leave it unchanged. See Syntax.unsetTrailing for removing trailing whitespace.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Get the start position of the leading whitespace of .original SourceInfo, or none if it
is not .original.
Equations
- (Lean.SourceInfo.original leading pos trailing endPos).getOriginalLeadingPos? = some leading.startPos
- x✝.getOriginalLeadingPos? = none
Instances For
Get the start position of the leading whitespace of .original SourceInfo, or the start
position of .synthetic SourceInfo (and none otherwise).
If canonicalOnly := false (the default), also returns none on non-canonical .synthetic
SourceInfo.
Equations
- (Lean.SourceInfo.original leading pos trailing endPos).getLeadingPos? canonicalOnly = some leading.startPos
- (Lean.SourceInfo.synthetic pos endPos true).getLeadingPos? canonicalOnly = some pos
- (Lean.SourceInfo.synthetic pos endPos canonical).getLeadingPos? = some pos
- info.getLeadingPos? canonicalOnly = none
Instances For
Get the start position of the leading whitespace of the Syntax if it is original, or the
start position if synthetic (and none otherwise).
If canonicalOnly := false (the default), also returns none on non-canonical synthetic Syntax.
Equations
- stx.getLeadingPos? canonicalOnly = stx.getHeadInfo.getLeadingPos? canonicalOnly