I’ve finally got to trying Menhir’s incremental API and the new way of error reporting.
It works great so far, but now I wonder if I can reference actual tokens in error messages somehow.
grammar: FOO BAR BAZ
Expected a QUUX but found a BAZ ($3)
CompCert seems to do it somehow (https://github.com/AbsInt/CompCert/blob/master/cparser/handcrafted.messages#L508) but I don’t understnand how.