protocompile icon indicating copy to clipboard operation
protocompile copied to clipboard

Implement comment tracking in the new lexer

Open mcy opened this issue 1 year ago • 1 comments

This change does two things:

  1. It adds support for attacking comments to tokens in the token package, as well as a way to query the actual text of a comment token. Comment tokens which are token trees are used to represent tokens that are grouped together.

  2. It adds support in the lexer for automatically attaching comments. I have included a test consisting of all of the funny cases listed on protobuf.com.

mcy avatar Dec 09 '24 21:12 mcy

As discussed elsewhere, W're going to punt this for now. I'm going to convert this to draft for future reference, but what we'll probably do is make comment attribution lazy.

mcy avatar Dec 12 '24 20:12 mcy