ndp.lua

changeset 26
309073a2bb53
parent 25
caf8bbcbaf07
child 28
3ddc836b7845
equal deleted inserted replaced
25:caf8bbcbaf07 26:309073a2bb53
125 local time = relative_to or os.time(); 125 local time = relative_to or os.time();
126 local P, Pi = lpeg.P, lpeg.Pi; 126 local P, Pi = lpeg.P, lpeg.Pi;
127 127
128 local patterns = 128 local patterns =
129 { 129 {
130 { Pi"today" };
130 { Pi"tomorrow" / 131 { Pi"tomorrow" /
132 function ()
133 time = time + seconds_in_a.day;
134 end };
135 { (lpeg.one_of{"a ", "the "}+true) * Pi"day after" /
131 function () 136 function ()
132 time = time + seconds_in_a.day; 137 time = time + seconds_in_a.day;
133 end }; 138 end };
134 { Pi"next week" / 139 { Pi"next week" /
135 function () 140 function ()

mercurial