getState

open fun getState(): Any

Returns a key representing the current parse state for memoization.

The memoization table is partitioned by this key: cached results are only reused when the key matches. Override this in subclasses with mutable state that affects parsing results (e.g. an indent level stack) to return a value that reflects the current state.

The returned value is used as a Map key, so it must implement equals and hashCode consistently.

The default returns Unit, meaning all results share a single memo table.