blob: c355642f4eda7fa56c8481600c4ca1b7f66977c9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
local m = require'lpeglabel'
local recp = m.P"oast"
local g = m.P{
'S',
S = m.V'A' * '.',
A = m.P't' * (m.P'est' + m.T'Err'),
Err = m.P'oast'
}
print(g:match("test.")) --> 6
print(g:match("toast.")) --> 7
print(g:match("oast.")) --> nil 0 oast.
print(g:match("toward.")) --> nil 0 ward.
|