Skip to content

ArtifactBuilder

1 min read

Import: import system.codegen;

ArtifactBuilder

Builds generated source text and records its source locations.

public class ArtifactBuilder

source_map

Locations mapping generated text back to source declarations.

public source_map: GenSourceMap

constructor

Creates an empty builder.

public constructor()

append

Appends text and advances the source-map position.

public fun append(text: string): void

mapped

Appends text mapped to the given snapshot node identity.

public fun mapped(text: string, target: string): void

line

Appends a complete line of artifact text.

public fun line(text: string): void

to_string

Returns the accumulated artifact text.

public override fun to_string(): string