ndp.lua

changeset 21
983f96ebef08
parent 17
3a7672943895
child 23
16e168833048
equal deleted inserted replaced
20:1db3ee8b9bc3 21:983f96ebef08
145 145
146 number = quantities[number] or tonumber(number); 146 number = quantities[number] or tonumber(number);
147 147
148 time = time + seconds_in_a[unit] * number; 148 time = time + seconds_in_a[unit] * number;
149 end }; 149 end };
150 { lpeg.one_of{"this ", "in the ", "at "} * time_of_day / 150 { (lpeg.one_of{"this ", "in the ", "at "} + true)* time_of_day /
151 function (time_of_day) 151 function (time_of_day)
152 time_of_day = time_of_day:match("%S+$"); 152 time_of_day = time_of_day:match("%S+$");
153 153
154 if time_of_day == "morning" and get_time_part(time, "hour") > time_of_days.morning then 154 if time_of_day == "morning" and get_time_part(time, "hour") > time_of_days.morning then
155 time = time + seconds_in_a.day; -- Morning has passed, so next morning 155 time = time + seconds_in_a.day; -- Morning has passed, so next morning

mercurial