package stele
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=4a2c12c3a90d763a7c2c7d1a6982493c
sha512=f9004a4c4d999d8b71a3f7178ac72bd48574f2c9f4bfcaff4c6e5b2031d015bfc64b4cd02848e34054e841dac142befdd8cd5938c061dc9f7c9fc417c2176837
doc/stele.runtime/Parser_error_runtime/Make/index.html
Module Parser_error_runtime.MakeSource
Parameters
Signature
A resolved marker and its own label text (the marker prefix and its bounds removed): a delimiter hint gives a span at the opening delimiter as wide as the alias its label names (one character for a plain (, two for a compound [|), a hedge subject the whole construct's true span (rendered as a multi-line spine when it crosses several lines).
resolve ~source ~env message post-processes a stele-generated message against the error environment env and the whole source text source: it expands any Menhir $i source-slice references, then turns each marker line into a label:
<N>…anchors at theN-th stack cell's opening delimiter (walking back over blanks and line breaks to the(/[/{when the cell's own start is not itself the delimiter);<^N>…anchors across theN-th stack cell's full span (the whole construct, however many lines it crosses), and dropped when that span is zero-width (an epsilon reduction — no construct to point at).
Returns the main message (marker lines removed) and the located labels in the order the markers appear (subject before delimiter hint, matching the generator's emission). A marker whose depth exceeds the live stack, or whose depth field it does not recognise (anything but decimal digits, after an optional ^), is left inline in the main message.