raver has quit [Read error: Connection reset by peer]
ArthurStrong has quit [Quit: leaving]
<d_bot>
<Lupus> is there a way to attach some side-channel information to all tokens in menhir? I want to capture all comments and attach a list of preceding comments to each token
<d_bot>
<Lupus> I could do that by specifying token type, but that seems very verbose
<d_bot>
<Lupus> may be there is something more convenient? 🤔
<companion_cube>
you could have comment tokens
<companion_cube>
and aggregate them in the parser
<companion_cube>
look at how OCaml handles attributes
<d_bot>
<Lupus> is the aggregation hand-coded for each rule?
<d_bot>
<Lupus> I'll look at OCaml parser, thanks!
<companion_cube>
I think it collects attributes a bit like this
<companion_cube>
(including docstrings)
tane has joined #ocaml
<sleepydog>
Lupus: funny, i just had that exact problem
<sleepydog>
what i did was keep a global hash table of comments by end position, and used $startofs in the parser to access it
zolk3ri has quit [Remote host closed the connection]
<companion_cube>
I don't know how ocamlformat, works, it must be a pain
zolk3ri has joined #ocaml
mxns has quit [Ping timeout: 265 seconds]
nullcone has joined #ocaml
mengu has quit []
olle has quit [Ping timeout: 265 seconds]
boxscape has quit [Quit: Connection closed]
boxscape has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
<d_bot>
<Lupus> > what i did was keep a global hash table of comments by end position, and used $startofs in the parser to access it
<d_bot>
<Lupus> sounds better than putting this into each token variant constructor
boxscape has quit [Quit: Connection closed]
boxscape has joined #ocaml
andreas303 has quit [Remote host closed the connection]
andreas303 has joined #ocaml
borne has quit [Ping timeout: 264 seconds]
mxns has joined #ocaml
bartholin has quit [Quit: Leaving]
azot has quit [Remote host closed the connection]
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
azot has joined #ocaml
boxscape has quit [Quit: Connection closed]
zolk3ri has quit [Remote host closed the connection]
zolk3ri has joined #ocaml
Haudegen has joined #ocaml
boxscape has joined #ocaml
dckc- has joined #ocaml
DanC has quit [Ping timeout: 260 seconds]
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
zolk3ri has quit [Remote host closed the connection]
zolk3ri has joined #ocaml
<d_bot>
<hhugo> Ocamlformat collect all comments after parsing and attach them back to ast nodes based on location.
boxscape has quit [Quit: Connection closed]
boxscape has joined #ocaml
boxscape has quit [Client Quit]
boxscape has joined #ocaml
zolk3ri has quit [Remote host closed the connection]