Support for 'today' and 'the day after'

Mon, 22 Jun 2009 01:21:17 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Mon, 22 Jun 2009 01:21:17 +0100
changeset 26
309073a2bb53
parent 25
caf8bbcbaf07
child 27
1422a41b53ac

Support for 'today' and 'the day after'

ndp.lua file | annotate | diff | comparison | revisions
--- a/ndp.lua	Mon Jun 22 01:16:01 2009 +0100
+++ b/ndp.lua	Mon Jun 22 01:21:17 2009 +0100
@@ -127,10 +127,15 @@
 	
 	local patterns = 
 	{ 
+		{ Pi"today" };
 		{ Pi"tomorrow" /
 			function ()
 				time = time + seconds_in_a.day;
 			end };
+		{ (lpeg.one_of{"a ", "the "}+true) * Pi"day after" /
+			function ()
+				time = time + seconds_in_a.day;
+			end };
 		{ Pi"next week" /
 			function ()
 				time = time + seconds_in_a.week;

mercurial