AbbreviateErrorTraces

scalus.sir.AbbreviateErrorTraces

Transforms error messages in SIR to abbreviated forms and collects a mapping of abbreviations to original messages.

This transformation helps reduce the size of error messages in the IR while maintaining traceability through a mapping of abbreviated forms to their original messages.

Attributes

Example
   // Input SIR containing: Error("Failed validation"), Error("Failed execution")
   // Transforms to: Error("FV"), Error("FE")
   // With mapping: Map("FV" -> "Failed validation", "FE" -> "Failed execution")
   val transformer = new AbbreviateErrorTraces
   val result = transformer.transformSIR(input)
   val abbrevMap = transformer.getAbbreviationMap
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def getAbbreviationMap: Map[String, String]

Returns the current mapping of abbreviations to original error messages.

Returns the current mapping of abbreviations to original error messages.

Attributes

Returns

A map of abbreviations to their corresponding full error messages

Transforms SIR by abbreviating all error messages.

Transforms SIR by abbreviating all error messages.

Value parameters

sir

The SIR to transform

Attributes

Returns

The transformed SIR

def transformModule(module: Module): Module

Transforms a Module by abbreviating all error messages.

Transforms a Module by abbreviating all error messages.

Value parameters

module

The module to transform

Attributes

Returns

The transformed module

def transformSIR(sir: SIR): SIR

Transforms SIR by abbreviating all error messages.

Transforms SIR by abbreviating all error messages.

Value parameters

sir

The SIR to transform

Attributes

Returns

The transformed SIR