X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fgetdate.y;h=877b264250ac6c15d6f0e73faf8c2f4528f1c29e;hb=d952dbeaa9ceb3f9cef0684e7d9d3ecfa71a6294;hp=f9cd86c3a3054226351d16e4a24ce5474dede70d;hpb=ec560ef5cab3aec7a68fb2da6b2dbbbd7415caf1;p=gnulib.git diff --git a/lib/getdate.y b/lib/getdate.y index f9cd86c3a..877b26425 100644 --- a/lib/getdate.y +++ b/lib/getdate.y @@ -293,7 +293,7 @@ set_hhmmss (parser_control *pc, long int hour, long int minutes, %token tAGO tDST %token tYEAR_UNIT tMONTH_UNIT tHOUR_UNIT tMINUTE_UNIT tSEC_UNIT -%token tDAY_UNIT +%token tDAY_UNIT tDAY_SHIFT %token tDAY tDAYZONE tLOCAL_ZONE tMERIDIAN %token tMONTH tORDINAL tZONE @@ -304,7 +304,7 @@ set_hhmmss (parser_control *pc, long int hour, long int minutes, %type o_colon_minutes o_merid %type seconds signed_seconds unsigned_seconds -%type relunit relunit_snumber +%type relunit relunit_snumber dayshift %% @@ -502,6 +502,8 @@ rel: { apply_relative_time (pc, $1, -1); } | relunit { apply_relative_time (pc, $1, 1); } + | dayshift + { apply_relative_time (pc, $1, 1); } ; relunit: @@ -563,6 +565,11 @@ relunit_snumber: { $$ = RELATIVE_TIME_0; $$.seconds = $1.value; } ; +dayshift: + tDAY_SHIFT + { $$ = RELATIVE_TIME_0; $$.day = $1; } + ; + seconds: signed_seconds | unsigned_seconds; signed_seconds: @@ -669,10 +676,10 @@ static table const time_units_table[] = /* Assorted relative-time words. */ static table const relative_time_table[] = { - { "TOMORROW", tDAY_UNIT, 1 }, - { "YESTERDAY",tDAY_UNIT, -1 }, - { "TODAY", tDAY_UNIT, 0 }, - { "NOW", tDAY_UNIT, 0 }, + { "TOMORROW", tDAY_SHIFT, 1 }, + { "YESTERDAY",tDAY_SHIFT, -1 }, + { "TODAY", tDAY_SHIFT, 0 }, + { "NOW", tDAY_SHIFT, 0 }, { "LAST", tORDINAL, -1 }, { "THIS", tORDINAL, 0 }, { "NEXT", tORDINAL, 1 },