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

Dmitry Savintsev dsavints at gmail.com
Tue May 15 15:17:40 UTC 2018


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.

-L directive is applicable only to C/D/Ruby/C#/OCaml - I wonder if it would
be difficult to enable it for Go as well?  The '//line' directives seem to
confuse the `go test -cover` command into producing invalid data (and then
an internal error like "cover: inconsistent NumStmt: changed from 3 to
2").  I am using ragel version 6.10 (on a Mac).

The workaround I'm using is removing the `//line` lines from the generated
.go file:
sed -i '' /^\/\/line\.*/d filename.go

Many thanks,

Dmitry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.colm.net/pipermail/ragel-users/attachments/20180515/6bfe7215/attachment.html>


More information about the ragel-users mailing list