[ragel-users] //line directives in ragel-generated Go code

Daniel Nelson daniel at wavesofdawn.com
Tue May 15 17:48:56 UTC 2018

On Tue, May 15, 2018 at 05:17:40PM +0200, Dmitry Savintsev wrote:
> What is the meaning and intended usage of `//line filename.go` directives
> in the Go code generated by ragel? I understand that '//line filename.rl'
> references can help to trace back the origin of the statements, but don't
> yet see the significance or intended usage of the .go file references.

The //line directive[1] is used to modify the stacktraces reported by the Go
compiler.  This way the stacktrace will point to your machine definition
instead of into the generated file, which is helpful if you have a compile

[1] https://golang.org/cmd/compile/#hdr-Compiler_Directives
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://www.colm.net/pipermail/ragel-users/attachments/20180515/870aada8/attachment.sig>

More information about the ragel-users mailing list