From: Hartmut Holzgraefe Date: Mon, 8 Dec 2003 22:22:57 +0000 (+0000) Subject: reduce/reduce conflicts resolved X-Git-Tag: php-5.0.0b3RC1~178 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0141080ff506b2f2666635e81f26228292e7b3df;p=php reduce/reduce conflicts resolved --- diff --git a/ext/standard/parsedate.y b/ext/standard/parsedate.y index 9bc7c4697d..21d6fcf7d5 100644 --- a/ext/standard/parsedate.y +++ b/ext/standard/parsedate.y @@ -150,8 +150,8 @@ typedef union _date_ll { %} -/* This grammar has 21 shift/reduce conflicts. */ -/* %expect 21 */ +/* This grammar has 22 shift/reduce conflicts. */ +%expect 22 %pure_parser %token tAGO tDAY tDAY_UNIT tDAYZONE tDST tHOUR_UNIT tID tTZONE tZZONE @@ -161,7 +161,7 @@ typedef union _date_ll { %type tDAY tDAY_UNIT tDAYZONE tHOUR_UNIT tMINUTE_UNIT %type tMONTH tMONTH_UNIT %type tSEC_UNIT tSNUMBER tUNUMBER tYEAR_UNIT tZONE tTZONE tZZONE -%type tMERIDIAN o_merid +%type tMERIDIAN %% @@ -185,6 +185,7 @@ item : time { ((struct date_yy *)parm)->yyHaveRel++; } | number + | o_merid ; time : tUNUMBER tMERIDIAN { @@ -193,11 +194,10 @@ time : tUNUMBER tMERIDIAN { ((struct date_yy *)parm)->yySeconds = 0; ((struct date_yy *)parm)->yyMeridian = $2; } - | tUNUMBER ':' tUNUMBER o_merid { + | tUNUMBER ':' tUNUMBER { ((struct date_yy *)parm)->yyHour = $1; ((struct date_yy *)parm)->yyMinutes = $3; ((struct date_yy *)parm)->yySeconds = 0; - ((struct date_yy *)parm)->yyMeridian = $4; } | tUNUMBER ':' tUNUMBER tSNUMBER { ((struct date_yy *)parm)->yyHour = $1; @@ -208,11 +208,10 @@ time : tUNUMBER tMERIDIAN { ? -$4 % 100 + (-$4 / 100) * 60 : - ($4 % 100 + ($4 / 100) * 60)); } - | tUNUMBER ':' tUNUMBER ':' tUNUMBER o_merid { + | tUNUMBER ':' tUNUMBER ':' tUNUMBER { ((struct date_yy *)parm)->yyHour = $1; ((struct date_yy *)parm)->yyMinutes = $3; ((struct date_yy *)parm)->yySeconds = $5; - ((struct date_yy *)parm)->yyMeridian = $6; } | tUNUMBER ':' tUNUMBER ':' tUNUMBER tSNUMBER { /* ISO 8601 format. hh:mm:ss[+-][0-9]{2}([0-9]{2})?. */ @@ -234,7 +233,6 @@ time : tUNUMBER tMERIDIAN { ((struct date_yy *)parm)->yySeconds = $5; ((struct date_yy *)parm)->yyMeridian = MER24; } - | iso8601time ; iso8601time: tUNUMBER ':' tUNUMBER ':' tUNUMBER { @@ -335,12 +333,12 @@ date : tUNUMBER '/' tUNUMBER { } } | iso8601date - | iso8601date tTZONE iso8601time { + | iso8601datetime { ((struct date_yy *)parm)->yyTimezone = 0; ((struct date_yy *)parm)->yyHaveZone++; ((struct date_yy *)parm)->yyHaveTime++; } - | iso8601date tTZONE iso8601time tZZONE { + | iso8601datetime tZZONE { ((struct date_yy *)parm)->yyTimezone = 0; ((struct date_yy *)parm)->yyHaveZone++; ((struct date_yy *)parm)->yyHaveTime++; @@ -384,6 +382,9 @@ date : tUNUMBER '/' tUNUMBER { } ; +iso8601datetime: iso8601date tTZONE iso8601time + ; + iso8601date: tUNUMBER tSNUMBER tSNUMBER { /* ISO 8601 format. yyyy-mm-dd. */ ((struct date_yy *)parm)->yyYear = $1; @@ -500,14 +501,10 @@ number : tUNUMBER } ; -o_merid : /* NULL */ - { - $$ = MER24; - } - | tMERIDIAN - { - $$ = $1; - } +o_merid : tMERIDIAN + { + ((struct date_yy *)parm)->yyMeridian = $1; + } ; %%