Skip to content

Why does compilation fail only if I use lexy::parse and not lexy::parse_as_tree? #162

Answered by foonathan
EmmanuelMess asked this question in Q&A
Discussion options

You must be logged in to vote

You've only used lexy::parse_as_tree before, which completely ignores all value callbacks. With lexy::parse reading from a file, the program no longer compiles because you are now instantiating the callbacks.

Your issue is that the Static production produces a value of the Static tag type, but nobody uses it. You can either use lexy::noop as the value to not produce a tag type and drop it entirely (https://godbolt.org/z/nPh1dM9aq), store the tag type in the datastructures, or just inline the rule from Static anywhere its used.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@EmmanuelMess
Comment options

@foonathan
Comment options

@EmmanuelMess
Comment options

@foonathan
Comment options

Answer selected by EmmanuelMess
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants