lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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