sun::ast::InterpolatedStringAST

sun::ast::InterpolatedStringAST

class · Source (opens in a new tab)

class sun::ast::InterpolatedStringAST : public sun::ast::ExprAST

Template 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

Types

Public Functions

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 override

Returns 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) override

Visits 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() const

Returns the unprocessed source contents.

getSegments

public · function · Source (opens in a new tab)

const std::vector< Segment > & sun::ast::InterpolatedStringAST::getSegments() const

Returns 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 override

Returns 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 override

Returns 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