You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Even though parts of the input are encoded (or compressed), you can still use _constraints_ to shape them.
277
277
And if the encoding or compression can be inverted, you can also use it to _parse_ inputs again.
278
+
279
+
280
+
## Converters vs. Constraints
281
+
282
+
Since converters (and generally, generators) can do anything, they can be used for any purpose, including producing solutions that normally would come from [constraints](sec:constraints).
283
+
284
+
As an example, consider the credit card grammar from the [chapter on binary inputs](sec:binary):
Instead of having a constraint (`where`) that expresses the relationship between `<number>` and `<check_digit>`, we can easily enhance the grammar with converters between `<number>` and `<credit_card_number>`:
0 commit comments