TermSanitizer

scalus.uplc.TermSanitizer
object TermSanitizer

Sanitizes UPLC Terms to ensure all variable names conform to the UPLC text format requirements.

UPLC text format only allows:

  • First character: letters (a-z, A-Z) or underscore (_)
  • Subsequent characters: letters, digits, underscore (_), or apostrophe (')
  • Optional suffix: hyphen followed by digits (-\d+)

This sanitizer transforms variable names to comply with these rules while avoiding conflicts.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def sanitizeName(name: String): String

Sanitizes a single name to conform to UPLC identifier rules.

Sanitizes a single name to conform to UPLC identifier rules.

Value parameters

name

the original name

Attributes

Returns

a sanitized version of the name

def sanitizeNames(term: Term): Term

Sanitizes all variable names in a Term to be valid UPLC identifiers.

Sanitizes all variable names in a Term to be valid UPLC identifiers.

Value parameters

term

the term to sanitize

Attributes

Returns

a new term with all variable names sanitized