lua-users home
lua-l archive

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


On Fri, Apr 15, 2016 at 12:48 AM, Daurnimator <quae@daurnimator.com> wrote:
>
> Consider this piece of code:
>
> ```
> local lpeg = require 'lpeg'
>
> local D = lpeg.R'09'
> local I = lpeg.R('AZ', 'az', '\127\255') + '_'
> local SOS = lpeg.P(function(s, i) return i == 1 end) -- start of string

This is completely tangential to the topic at hand, but wouldn't this
work just as well for SOS?

local SOS = -lpeg.B(1)