Class FriendlyInternalName

java.lang.Object
org.ek9lang.compiler.support.FriendlyInternalName
All Implemented Interfaces:
Function<String,String>

public final class FriendlyInternalName extends Object implements Function<String,String>
Converts mangled internal symbol names to friendly display form. Replaces _Function_<hash> with fn and _Class_<hash> with cls so user-facing surfaces (coverage / quality reports, IDE panels, MCP wire descriptions, AI completion text) render intent rather than SHA-derived dynamic-function/class names.

It also reduces a PARAMETERISED generic's internal name to the generic it parameterises: _List_<hash> renders as List, _MutexKey_<hash> as MutexKey. Those names reach a reader wherever a resolved SIGNATURE is shown — a call-graph edge, a data-touch via chain — and a 64-character hash in the middle of a signature is unreadable. The TYPE ARGUMENT is not recoverable from the mangled string (the hash is a digest, not an encoding), so if you need List of String rather than List, render from the SYMBOL via getFriendlyName() instead; this is the best a string transform can do.

THE single source of truth for this transform — call it wherever a construct name is shown to a human; do not re-derive the _Class_/_Function_ regex. It is a DISPLAY-only concern: join keys must keep the mangled (unique) form, since two dynamic classes in one module both friendly to cls.

Stateless and thread-safe — share one instance across callers. Mirrors the Function<I, O> helper convention used in compiler phases 1-6 (e.g. BlockScopeName).

  • Constructor Details

    • FriendlyInternalName

      public FriendlyInternalName()
  • Method Details