workUnitCompletion

fun <ArgType> workUnitCompletion(lexingState: LexingState, optionalSafetyCheck: AtomicBoolean?, continuation: (ArgType) -> Unit): (ArgType) -> Unit

Construct and answer a function that wraps the specified continuation in logic that will increment the count of completed work units and potentially call the unambiguous statement.

Return

A new continuation. It accepts an argument of some kind, which will be passed forward to the argument continuation.

Parameters

ArgType

The type of value that will be passed to the continuation.

lexingState

The LexingState for which to report problems.

optionalSafetyCheck

Either null or an AtomicBoolean which must transition from false to true only once.

continuation

What to do as a work unit.