ml_switcheroo.compiler.backends.sass.emitter¶

SASS Emitter (Backend).

Converts SASS AST nodes into formatted assembly text.

Classes¶

SassEmitter

Converts SASS AST nodes into textual assembly code.

Module Contents¶

class ml_switcheroo.compiler.backends.sass.emitter.SassEmitter[source]¶

Converts SASS AST nodes into textual assembly code.

emit(nodes: List[ml_switcheroo.compiler.frontends.sass.nodes.SassNode]) → str[source]¶

Generates the SASS source string from a list of nodes.

Formatting Rules: - Labels (e.g. L_1:) are rendered flush-left. - All other nodes are indented by 4 spaces.

Parameters:

nodes (List[SassNode]) – AST nodes.

Returns:

The formatted SASS source code string.

Return type:

str