On Mon, Feb 23, 2009 at 9:55 PM, Nick Gammon
<nick@gammon.com.au> wrote:
Hello,
A minor issue in the documentation of lpeg.S:
lpeg.S (string)
Returns a pattern that matches any single character that appears in the given string. (The S stands for Set.)
As an example, the pattern lpeg.S("+-*/") matches any arithmetic operator.
Note that, if s is a character (that is, a string of length 1), then lpeg.P(s) is equivalent to lpeg.S(s) which is equivalent to lpeg.R(s..s). Note also that both lpeg.S("") and lpeg.R() are patterns that always fail.
The reference to "if s is a character" does not make sense as "s" is not defined.
Suggest either changing the heading to:
lpeg.S (s)
or rewording to "if the argument is a single character".
- Nick