foonathan / lexy

C++ parsing DSL
https://lexy.foonathan.net
Boost Software License 1.0
991 stars 66 forks source link

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

Closed Spartan322 closed 3 months ago

foonathan commented 3 months ago

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

Spartan322 commented 3 months ago

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?

foonathan commented 3 months ago

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.