Closed Derailedzack closed 2 years ago
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/#mustdsl::identifier()
expects a character class, not another rule: https://lexy.foonathan.net/reference/dsl/identifier/#identifierrule
and value
member.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 don't think your PEGTL grammar works, but this is code that parses a function declaration, maybe that helps: https://lexy.foonathan.net/playground/?id=dGGWMn37z&mode=tree