lexy icon indicating copy to clipboard operation
lexy copied to clipboard

`invalid use of incomplete type 'struct lexyd::_capt` on use of `scanner::capture_token`

Open Spartan322 opened this issue 1 year ago • 3 comments

Spartan322 avatar May 11 '24 01:05 Spartan322

Are you including <lexy/dsl.hpp> (or specifically <lexy/dsl/capture.hpp>)?

foonathan avatar May 12 '24 19:05 foonathan

Yes, I believe the issue is that the _capt struct was renamed to _cap at some point, I can't find the definition for _capt anywhere in the code base but looking through the history when https://github.com/foonathan/lexy/blob/e8eb4d67c4eb33e1476218c0374f68e198723526/include/lexy/dsl/scan.hpp#L21 was added in the codebase it seemed to refer to a struct that's fairly similar to what _cap now is.

The change happened in 84161b0d5aeac5c7dca320baff857a1b5e8035eb but I don't see scan.hpp there so the change seems to have flown under the radar, I presume, given the content of that commit, it was meant to be removed?

Spartan322 avatar May 12 '24 20:05 Spartan322

Oh, good catch!

Yes, I forgot about scanner when doing that change. I think the correct approach would be to mirror the behavior: remove .capture and rename .capture_token to .capture (and change _capt -> _cap). I can fix that later this week, but you can also do a PR if you want to contribute.

foonathan avatar May 13 '24 15:05 foonathan