fpco / inline-c

284 stars 50 forks source link

add #line directives for more relevant error reporting #90

Closed ekmett closed 5 years ago

ekmett commented 5 years ago

This patch adds #line directives to the generated C source file so that the locations reported to the user are based on the location of the template-haskell splice point rather than some made-up location in a now-deleted temporary file.

To get the line directives to work right, this also modifies inlineItems to place everything on one line -- er which actually helps give the user context for error messages, anyways.

I left the locations optional at the inlineCode level.