Skip to content

lexy doesn't compile in Visual Studio 2022 #52

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

You must be logged in to vote

The error message isn't great, but it's not a compiler bug:

  • dsl::must(...) isn't a rule, so can't be composed with one. Instead, it must be used in the form dsl::must(...).error<my_error>: https://lexy.foonathan.net/reference/dsl/error/#must
  • dsl::identifier() expects a character class, not another rule: https://lexy.foonathan.net/reference/dsl/identifier/#identifier
  • you don't actually create a production: the rule must be part of a type with a rule and value member.
  • This isn't an error, but you don't actually need dsl::must in lexy in 99% of situations (and it does something completely different from pegtl::must, maybe the name isn't ideal). Backtracking in lexy is controlled via >>.

I …

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Derailedzack
Comment options

@Derailedzack
Comment options

@foonathan
Comment options

Answer selected by Derailedzack
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
Converted from issue

This discussion was converted from issue #51 on February 14, 2022 10:39.