sun::ast::InterpolatedStringAST
class · Source (opens in a new tab)
class sun::ast::InterpolatedStringAST : public sun::ast::ExprASTTemplate string literal: Hello ${name}!.
Preserved by the parser for a lossless parse tree; the lowering pass desugars it into std.String append calls before semantic analysis, so it never reaches the borrow checker or codegen.
Inherits
- sun::ast::ExprAST (public)
Types
Public Functions
- InterpolatedStringAST
- dotLabel
- forEachChildSlot
- getRawContent
- getSegments
- getSegmentsMutable
- getType
- toString
InterpolatedStringAST
public · function · Source (opens in a new tab)
sun::ast::InterpolatedStringAST::InterpolatedStringAST(std::string rawContent, std::vector< Segment > segments)Creates this syntax node and takes ownership of any supplied child expressions.
Related: Segment
dotLabel
public · function · Source (opens in a new tab)
std::string sun::ast::InterpolatedStringAST::dotLabel() const overrideReturns the node label used in syntax-tree graph visualizations.
forEachChildSlot
public · function · Source (opens in a new tab)
void sun::ast::InterpolatedStringAST::forEachChildSlot(const ChildSlotFn &fn) overrideVisits replaceable child expressions so tree passes can rewrite them in place.
Related: ChildSlotFn
getRawContent
public · function · Source (opens in a new tab)
const std::string & sun::ast::InterpolatedStringAST::getRawContent() constReturns the unprocessed source contents.
getSegments
public · function · Source (opens in a new tab)
const std::vector< Segment > & sun::ast::InterpolatedStringAST::getSegments() constReturns the interpolated string segments.
Related: Segment
getSegmentsMutable
public · function · Source (opens in a new tab)
std::vector< Segment > & sun::ast::InterpolatedStringAST::getSegmentsMutable()Returns the modifiable interpolated string segments.
Related: Segment
getType
public · function · Source (opens in a new tab)
ASTNodeType sun::ast::InterpolatedStringAST::getType() const overrideReturns the syntax-node kind used to dispatch tree visitors.
Related: ASTNodeType
toString
public · function · Source (opens in a new tab)
std::string sun::ast::InterpolatedStringAST::toString() const overrideReturns a readable representation for diagnostics and debugging.
Private Fields
rawContent_
private · variable · Source (opens in a new tab)
std::string sun::ast::InterpolatedStringAST::rawContent_No documentation comment.
segments_
private · variable · Source (opens in a new tab)
std::vector<Segment> sun::ast::InterpolatedStringAST::segments_No documentation comment.
Related: Segment