parseModuleHeader

fun parseModuleHeader(onSuccess: (A_Phrase, ParserState) -> Unit)

Parse the header of the module from the token stream. If successful, invoke onSuccess with the ParserState just after the header, otherwise invoke onFail without reporting the problem.

If the dependenciesOnly parameter is true, only parse the bare minimum needed to determine information about which modules are used by this one.

Parameters

onSuccess

What to do after successfully parsing the header. The compilation context's header will have been updated, and the continuation will be passed the ParserState after the header. The phrase that was parsed and already processed is also passed, to apply styling.