A pattern that matches any string, and consumes no input
lpeg.P(1)
P(1), P.Any(1)
A pattern that matches and consumes 1 character
Pattern's constructor has no special treatment of booleans, so they happen to be treated to an int. This mean ppeg.P(True) currently has a different (misleadingly?) meaning to lpeg.P(true).
Should _ppeg.Pattern(<bool>) be special cased? Can that even be done reliably?
Should _ppeg.Pattern(None) continue to be accepted?
The current behaviour for LPeg and PPeg is
lpeg.P()
,lpeg.P(nil)
P()
lpeg.P(false)
P(None)
,P.Fail()
lpeg.P(true)
,lpeg.P(0)
P(0)
,P.Any(0)
lpeg.P(1)
P(1)
,P.Any(1)
Pattern
's constructor has no special treatment of booleans, so they happen to be treated to anint
. This meanppeg.P(True)
currently has a different (misleadingly?) meaning tolpeg.P(true)
._ppeg.Pattern(<bool>)
be special cased? Can that even be done reliably?_ppeg.Pattern(None)
continue to be accepted?