diff options
author | sebres <sebres@users.sourceforge.net> | 2018-05-29 17:11:52 (GMT) |
---|---|---|
committer | sebres <sebres@users.sourceforge.net> | 2018-05-29 17:11:52 (GMT) |
commit | 9b3dad29d72deaf01d61c8eeb18a238ca1854eb9 (patch) | |
tree | 88fc872a7e53ec8dcb215e04fa44a66dadc1def7 /generic | |
parent | 743a4fee3d210f177179ff4212a36a2eb8213b9c (diff) | |
download | tcl-9b3dad29d72deaf01d61c8eeb18a238ca1854eb9.zip tcl-9b3dad29d72deaf01d61c8eeb18a238ca1854eb9.tar.gz tcl-9b3dad29d72deaf01d61c8eeb18a238ca1854eb9.tar.bz2 |
FreeScan: repair scanning date/time with TZ using '+', ex.: "31 Jan 14 23:59:59 +0100", additionally another TZ formats can be used now (token [zone] used instead of sequence '-' tNUMBER); test cases extended.
Closes http://core.tcl.tk/tcl/tktview?name=5019748c73
Cherry picked from fossil branch "sebres_clock_tz_fix", check-in [5f72c863f17145b4]
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclDate.c | 271 | ||||
-rw-r--r-- | generic/tclGetDate.y | 23 |
2 files changed, 130 insertions, 164 deletions
diff --git a/generic/tclDate.c b/generic/tclDate.c index 55d1d36..b716209 100644 --- a/generic/tclDate.c +++ b/generic/tclDate.c @@ -455,16 +455,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 79 +#define YYLAST 75 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 26 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 16 /* YYNRULES -- Number of rules. */ -#define YYNRULES 56 +#define YYNRULES 55 /* YYNRULES -- Number of states. */ -#define YYNSTATES 83 +#define YYNSTATES 79 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 @@ -480,7 +480,7 @@ static const yytype_uint8 yytranslate[] = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 25, 22, 21, 24, 23, 2, 2, + 2, 2, 2, 25, 21, 23, 24, 22, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 20, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -512,11 +512,11 @@ static const yytype_uint8 yytranslate[] = static const yytype_uint8 yyprhs[] = { 0, 0, 3, 4, 7, 9, 11, 13, 15, 17, - 19, 21, 23, 25, 28, 33, 39, 46, 54, 57, - 59, 61, 63, 66, 69, 73, 76, 80, 86, 88, - 94, 100, 103, 108, 111, 113, 117, 120, 124, 128, - 136, 139, 144, 147, 149, 153, 156, 159, 163, 165, - 167, 169, 171, 173, 175, 177, 178 + 19, 21, 23, 25, 28, 33, 40, 43, 45, 47, + 50, 52, 55, 58, 62, 65, 69, 75, 77, 83, + 89, 92, 97, 100, 102, 106, 109, 113, 117, 125, + 128, 133, 136, 138, 142, 145, 148, 152, 154, 156, + 158, 160, 162, 164, 166, 167 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ @@ -525,32 +525,31 @@ static const yytype_int8 yyrhs[] = 27, 0, -1, -1, 27, 28, -1, 29, -1, 30, -1, 32, -1, 33, -1, 31, -1, 36, -1, 34, -1, 35, -1, 40, -1, 13, 7, -1, 13, 20, - 13, 41, -1, 13, 20, 13, 21, 13, -1, 13, - 20, 13, 20, 13, 41, -1, 13, 20, 13, 20, - 13, 21, 13, -1, 14, 16, -1, 14, -1, 5, - -1, 4, -1, 4, 22, -1, 13, 4, -1, 38, - 13, 4, -1, 19, 4, -1, 13, 23, 13, -1, - 13, 23, 13, 23, 13, -1, 17, -1, 13, 21, - 8, 21, 13, -1, 13, 21, 13, 21, 13, -1, - 8, 13, -1, 8, 13, 22, 13, -1, 13, 8, - -1, 15, -1, 13, 8, 13, -1, 19, 8, -1, - 19, 13, 8, -1, 17, 14, 17, -1, 17, 14, - 13, 20, 13, 20, 13, -1, 17, 17, -1, 10, - 13, 24, 13, -1, 37, 3, -1, 37, -1, 38, - 13, 39, -1, 13, 39, -1, 19, 39, -1, 19, - 13, 39, -1, 39, -1, 21, -1, 25, -1, 11, - -1, 18, -1, 9, -1, 13, -1, -1, 7, -1 + 13, 41, -1, 13, 20, 13, 20, 13, 41, -1, + 14, 16, -1, 14, -1, 5, -1, 38, 13, -1, + 4, -1, 4, 21, -1, 13, 4, -1, 38, 13, + 4, -1, 19, 4, -1, 13, 22, 13, -1, 13, + 22, 13, 22, 13, -1, 17, -1, 13, 23, 8, + 23, 13, -1, 13, 23, 13, 23, 13, -1, 8, + 13, -1, 8, 13, 21, 13, -1, 13, 8, -1, + 15, -1, 13, 8, 13, -1, 19, 8, -1, 19, + 13, 8, -1, 17, 14, 17, -1, 17, 14, 13, + 20, 13, 20, 13, -1, 17, 17, -1, 10, 13, + 24, 13, -1, 37, 3, -1, 37, -1, 38, 13, + 39, -1, 13, 39, -1, 19, 39, -1, 19, 13, + 39, -1, 39, -1, 23, -1, 25, -1, 11, -1, + 18, -1, 9, -1, 13, -1, -1, 7, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 152, 152, 153, 156, 159, 162, 165, 168, 171, - 174, 178, 183, 186, 192, 198, 206, 212, 223, 227, - 231, 237, 241, 245, 249, 253, 259, 263, 268, 273, - 278, 283, 287, 292, 296, 301, 308, 312, 318, 327, - 336, 346, 360, 365, 368, 371, 374, 377, 380, 385, - 388, 393, 397, 401, 407, 425, 428 + 174, 178, 183, 186, 192, 198, 206, 210, 214, 218, + 224, 228, 232, 236, 240, 246, 250, 255, 260, 265, + 270, 274, 279, 283, 288, 295, 299, 305, 314, 323, + 333, 347, 352, 355, 358, 361, 364, 367, 372, 375, + 380, 384, 388, 394, 412, 415 }; #endif @@ -562,7 +561,7 @@ static const char *const yytname[] = "$end", "error", "$undefined", "tAGO", "tDAY", "tDAYZONE", "tID", "tMERIDIAN", "tMONTH", "tMONTH_UNIT", "tSTARDATE", "tSEC_UNIT", "tSNUMBER", "tUNUMBER", "tZONE", "tEPOCH", "tDST", "tISOBASE", - "tDAY_UNIT", "tNEXT", "':'", "'-'", "','", "'/'", "'.'", "'+'", + "tDAY_UNIT", "tNEXT", "':'", "','", "'/'", "'-'", "'.'", "'+'", "$accept", "spec", "item", "time", "zone", "day", "date", "ordMonth", "iso", "trek", "relspec", "relunits", "sign", "unit", "number", "o_merid", 0 @@ -576,7 +575,7 @@ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 58, 45, 44, 47, 46, 43 + 58, 44, 47, 45, 46, 43 }; # endif @@ -584,22 +583,22 @@ static const yytype_uint16 yytoknum[] = static const yytype_uint8 yyr1[] = { 0, 26, 27, 27, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 29, 29, 29, 29, 29, 30, 30, - 30, 31, 31, 31, 31, 31, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 33, 33, 34, 34, - 34, 35, 36, 36, 37, 37, 37, 37, 37, 38, - 38, 39, 39, 39, 40, 41, 41 + 28, 28, 28, 29, 29, 29, 30, 30, 30, 30, + 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 33, 33, 34, 34, 34, + 35, 36, 36, 37, 37, 37, 37, 37, 38, 38, + 39, 39, 39, 40, 41, 41 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 0, 2, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 2, 4, 5, 6, 7, 2, 1, - 1, 1, 2, 2, 3, 2, 3, 5, 1, 5, - 5, 2, 4, 2, 1, 3, 2, 3, 3, 7, - 2, 4, 2, 1, 3, 2, 2, 3, 1, 1, - 1, 1, 1, 1, 1, 0, 1 + 1, 1, 1, 2, 4, 6, 2, 1, 1, 2, + 1, 2, 2, 3, 2, 3, 5, 1, 5, 5, + 2, 4, 2, 1, 3, 2, 3, 3, 7, 2, + 4, 2, 1, 3, 2, 2, 3, 1, 1, 1, + 1, 1, 1, 1, 0, 1 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -607,45 +606,43 @@ static const yytype_uint8 yyr2[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 2, 0, 1, 21, 20, 0, 53, 0, 51, 54, - 19, 34, 28, 52, 0, 49, 50, 3, 4, 5, - 8, 6, 7, 10, 11, 9, 43, 0, 48, 12, - 22, 31, 0, 23, 13, 33, 0, 0, 0, 45, - 18, 0, 40, 25, 36, 0, 46, 42, 0, 0, - 0, 35, 55, 0, 0, 26, 0, 38, 37, 47, - 24, 44, 32, 41, 56, 0, 0, 14, 0, 0, - 0, 0, 55, 15, 29, 30, 27, 0, 0, 16, - 0, 17, 39 + 2, 0, 1, 20, 18, 0, 52, 0, 50, 53, + 17, 33, 27, 51, 0, 48, 49, 3, 4, 5, + 8, 6, 7, 10, 11, 9, 42, 0, 47, 12, + 21, 30, 0, 22, 13, 32, 0, 0, 0, 44, + 16, 0, 39, 24, 35, 0, 45, 41, 19, 0, + 0, 34, 54, 25, 0, 0, 0, 37, 36, 46, + 23, 43, 31, 40, 55, 0, 14, 0, 0, 0, + 0, 54, 26, 28, 29, 0, 15, 0, 38 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { -1, 1, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 67 + 25, 26, 27, 28, 29, 66 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -22 +#define YYPACT_NINF -18 static const yytype_int8 yypact[] = { - -22, 2, -22, -21, -22, -4, -22, 1, -22, 22, - 18, -22, 8, -22, 40, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, 32, 28, -22, -22, - -22, 24, 26, -22, -22, 42, 47, -5, 49, -22, - -22, 15, -22, -22, -22, 48, -22, -22, 43, 50, - 51, -22, 17, 44, 46, 45, 52, -22, -22, -22, - -22, -22, -22, -22, -22, 56, 57, -22, 58, 60, - 61, 62, -3, -22, -22, -22, -22, 59, 63, -22, - 64, -22, -22 + -18, 2, -18, -17, -18, -4, -18, 10, -18, 22, + 8, -18, 18, -18, 39, -18, -18, -18, -18, -18, + -18, -18, -18, -18, -18, -18, 25, 21, -18, -18, + -18, 16, 14, -18, -18, 28, 36, 41, -5, -18, + -18, 5, -18, -18, -18, 47, -18, -18, 42, 46, + 48, -18, -6, 40, 43, 44, 49, -18, -18, -18, + -18, -18, -18, -18, -18, 50, -18, 51, 55, 57, + 58, 65, -18, -18, -18, 53, -18, 61, -18 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -9, -22, 6 + -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, + -18, -18, -18, -9, -18, 4 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -655,26 +652,26 @@ static const yytype_int8 yypgoto[] = #define YYTABLE_NINF -1 static const yytype_uint8 yytable[] = { - 39, 30, 2, 53, 64, 46, 3, 4, 54, 31, - 5, 6, 7, 8, 32, 9, 10, 11, 78, 12, - 13, 14, 41, 15, 64, 42, 33, 16, 56, 34, - 35, 6, 57, 8, 40, 47, 59, 65, 66, 61, - 13, 48, 36, 37, 43, 38, 49, 60, 44, 6, - 50, 8, 6, 45, 8, 51, 58, 6, 13, 8, - 52, 13, 55, 62, 63, 68, 13, 69, 70, 72, - 73, 74, 71, 75, 76, 77, 81, 82, 79, 80 + 39, 64, 2, 54, 30, 46, 3, 4, 55, 31, + 5, 6, 7, 8, 65, 9, 10, 11, 56, 12, + 13, 14, 57, 32, 40, 15, 33, 16, 47, 34, + 35, 6, 41, 8, 48, 42, 59, 49, 50, 61, + 13, 51, 36, 43, 37, 38, 60, 44, 6, 52, + 8, 6, 45, 8, 53, 58, 6, 13, 8, 62, + 13, 63, 67, 71, 72, 13, 68, 69, 73, 70, + 74, 75, 64, 77, 78, 76 }; static const yytype_uint8 yycheck[] = { - 9, 22, 0, 8, 7, 14, 4, 5, 13, 13, - 8, 9, 10, 11, 13, 13, 14, 15, 21, 17, - 18, 19, 14, 21, 7, 17, 4, 25, 13, 7, - 8, 9, 17, 11, 16, 3, 45, 20, 21, 48, - 18, 13, 20, 21, 4, 23, 22, 4, 8, 9, - 24, 11, 9, 13, 11, 13, 8, 9, 18, 11, - 13, 18, 13, 13, 13, 21, 18, 21, 23, 13, - 13, 13, 20, 13, 13, 13, 13, 13, 72, 20 + 9, 7, 0, 8, 21, 14, 4, 5, 13, 13, + 8, 9, 10, 11, 20, 13, 14, 15, 13, 17, + 18, 19, 17, 13, 16, 23, 4, 25, 3, 7, + 8, 9, 14, 11, 13, 17, 45, 21, 24, 48, + 18, 13, 20, 4, 22, 23, 4, 8, 9, 13, + 11, 9, 13, 11, 13, 8, 9, 18, 11, 13, + 18, 13, 22, 13, 13, 18, 23, 23, 13, 20, + 13, 13, 7, 20, 13, 71 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -682,14 +679,13 @@ static const yytype_uint8 yycheck[] = static const yytype_uint8 yystos[] = { 0, 27, 0, 4, 5, 8, 9, 10, 11, 13, - 14, 15, 17, 18, 19, 21, 25, 28, 29, 30, + 14, 15, 17, 18, 19, 23, 25, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 22, 13, 13, 4, 7, 8, 20, 21, 23, 39, - 16, 14, 17, 4, 8, 13, 39, 3, 13, 22, - 24, 13, 13, 8, 13, 13, 13, 17, 8, 39, - 4, 39, 13, 13, 7, 20, 21, 41, 21, 21, - 23, 20, 13, 13, 13, 13, 13, 13, 21, 41, - 20, 13, 13 + 21, 13, 13, 4, 7, 8, 20, 22, 23, 39, + 16, 14, 17, 4, 8, 13, 39, 3, 13, 21, + 24, 13, 13, 13, 8, 13, 13, 17, 8, 39, + 4, 39, 13, 13, 7, 20, 41, 22, 23, 23, + 20, 13, 13, 13, 13, 13, 41, 20, 13 }; #define yyerrok (yyerrstatus = 0) @@ -1631,42 +1627,33 @@ yyreduce: case 15: { - yyHour = (yyvsp[(1) - (5)].Number); - yyMinutes = (yyvsp[(3) - (5)].Number); - yyMeridian = MER24; - yyDSTmode = DSToff; - yyTimezone = ((yyvsp[(5) - (5)].Number) % 100 + ((yyvsp[(5) - (5)].Number) / 100) * 60); - ++yyHaveZone; + yyHour = (yyvsp[(1) - (6)].Number); + yyMinutes = (yyvsp[(3) - (6)].Number); + yySeconds = (yyvsp[(5) - (6)].Number); + yyMeridian = (yyvsp[(6) - (6)].Meridian); ;} break; case 16: { - yyHour = (yyvsp[(1) - (6)].Number); - yyMinutes = (yyvsp[(3) - (6)].Number); - yySeconds = (yyvsp[(5) - (6)].Number); - yyMeridian = (yyvsp[(6) - (6)].Meridian); + yyTimezone = (yyvsp[(1) - (2)].Number); + yyDSTmode = DSTon; ;} break; case 17: { - yyHour = (yyvsp[(1) - (7)].Number); - yyMinutes = (yyvsp[(3) - (7)].Number); - yySeconds = (yyvsp[(5) - (7)].Number); - yyMeridian = MER24; + yyTimezone = (yyvsp[(1) - (1)].Number); yyDSTmode = DSToff; - yyTimezone = ((yyvsp[(7) - (7)].Number) % 100 + ((yyvsp[(7) - (7)].Number) / 100) * 60); - ++yyHaveZone; ;} break; case 18: { - yyTimezone = (yyvsp[(1) - (2)].Number); + yyTimezone = (yyvsp[(1) - (1)].Number); yyDSTmode = DSTon; ;} break; @@ -1674,7 +1661,7 @@ yyreduce: case 19: { - yyTimezone = (yyvsp[(1) - (1)].Number); + yyTimezone = -(yyvsp[(1) - (2)].Number)*((yyvsp[(2) - (2)].Number) % 100 + ((yyvsp[(2) - (2)].Number) / 100) * 60); yyDSTmode = DSToff; ;} break; @@ -1682,20 +1669,12 @@ yyreduce: case 20: { - yyTimezone = (yyvsp[(1) - (1)].Number); - yyDSTmode = DSTon; - ;} - break; - - case 21: - - { yyDayOrdinal = 1; yyDayNumber = (yyvsp[(1) - (1)].Number); ;} break; - case 22: + case 21: { yyDayOrdinal = 1; @@ -1703,7 +1682,7 @@ yyreduce: ;} break; - case 23: + case 22: { yyDayOrdinal = (yyvsp[(1) - (2)].Number); @@ -1711,7 +1690,7 @@ yyreduce: ;} break; - case 24: + case 23: { yyDayOrdinal = (yyvsp[(1) - (3)].Number) * (yyvsp[(2) - (3)].Number); @@ -1719,7 +1698,7 @@ yyreduce: ;} break; - case 25: + case 24: { yyDayOrdinal = 2; @@ -1727,7 +1706,7 @@ yyreduce: ;} break; - case 26: + case 25: { yyMonth = (yyvsp[(1) - (3)].Number); @@ -1735,7 +1714,7 @@ yyreduce: ;} break; - case 27: + case 26: { yyMonth = (yyvsp[(1) - (5)].Number); @@ -1744,7 +1723,7 @@ yyreduce: ;} break; - case 28: + case 27: { yyYear = (yyvsp[(1) - (1)].Number) / 10000; @@ -1753,7 +1732,7 @@ yyreduce: ;} break; - case 29: + case 28: { yyDay = (yyvsp[(1) - (5)].Number); @@ -1762,7 +1741,7 @@ yyreduce: ;} break; - case 30: + case 29: { yyMonth = (yyvsp[(3) - (5)].Number); @@ -1771,7 +1750,7 @@ yyreduce: ;} break; - case 31: + case 30: { yyMonth = (yyvsp[(1) - (2)].Number); @@ -1779,7 +1758,7 @@ yyreduce: ;} break; - case 32: + case 31: { yyMonth = (yyvsp[(1) - (4)].Number); @@ -1788,7 +1767,7 @@ yyreduce: ;} break; - case 33: + case 32: { yyMonth = (yyvsp[(2) - (2)].Number); @@ -1796,7 +1775,7 @@ yyreduce: ;} break; - case 34: + case 33: { yyMonth = 1; @@ -1805,7 +1784,7 @@ yyreduce: ;} break; - case 35: + case 34: { yyMonth = (yyvsp[(2) - (3)].Number); @@ -1814,7 +1793,7 @@ yyreduce: ;} break; - case 36: + case 35: { yyMonthOrdinalIncr = 1; @@ -1822,7 +1801,7 @@ yyreduce: ;} break; - case 37: + case 36: { yyMonthOrdinalIncr = (yyvsp[(2) - (3)].Number); @@ -1830,7 +1809,7 @@ yyreduce: ;} break; - case 38: + case 37: { if ((yyvsp[(2) - (3)].Number) != HOUR( 7)) YYABORT; @@ -1843,7 +1822,7 @@ yyreduce: ;} break; - case 39: + case 38: { if ((yyvsp[(2) - (7)].Number) != HOUR( 7)) YYABORT; @@ -1856,7 +1835,7 @@ yyreduce: ;} break; - case 40: + case 39: { yyYear = (yyvsp[(1) - (2)].Number) / 10000; @@ -1868,7 +1847,7 @@ yyreduce: ;} break; - case 41: + case 40: { /* @@ -1884,7 +1863,7 @@ yyreduce: ;} break; - case 42: + case 41: { yyRelSeconds *= -1; @@ -1893,56 +1872,56 @@ yyreduce: ;} break; - case 44: + case 43: { *yyRelPointer += (yyvsp[(1) - (3)].Number) * (yyvsp[(2) - (3)].Number) * (yyvsp[(3) - (3)].Number); ;} break; - case 45: + case 44: { *yyRelPointer += (yyvsp[(1) - (2)].Number) * (yyvsp[(2) - (2)].Number); ;} break; - case 46: + case 45: { *yyRelPointer += (yyvsp[(2) - (2)].Number); ;} break; - case 47: + case 46: { *yyRelPointer += (yyvsp[(2) - (3)].Number) * (yyvsp[(3) - (3)].Number); ;} break; - case 48: + case 47: { *yyRelPointer += (yyvsp[(1) - (1)].Number); ;} break; - case 49: + case 48: { (yyval.Number) = -1; ;} break; - case 50: + case 49: { (yyval.Number) = 1; ;} break; - case 51: + case 50: { (yyval.Number) = (yyvsp[(1) - (1)].Number); @@ -1950,7 +1929,7 @@ yyreduce: ;} break; - case 52: + case 51: { (yyval.Number) = (yyvsp[(1) - (1)].Number); @@ -1958,7 +1937,7 @@ yyreduce: ;} break; - case 53: + case 52: { (yyval.Number) = (yyvsp[(1) - (1)].Number); @@ -1966,7 +1945,7 @@ yyreduce: ;} break; - case 54: + case 53: { if (yyHaveTime && yyHaveDate && !yyHaveRel) { @@ -1986,14 +1965,14 @@ yyreduce: ;} break; - case 55: + case 54: { (yyval.Meridian) = MER24; ;} break; - case 56: + case 55: { (yyval.Meridian) = (yyvsp[(1) - (1)].Meridian); diff --git a/generic/tclGetDate.y b/generic/tclGetDate.y index d6f9b11..e546938 100644 --- a/generic/tclGetDate.y +++ b/generic/tclGetDate.y @@ -195,29 +195,12 @@ time : tUNUMBER tMERIDIAN { yySeconds = 0; yyMeridian = $4; } - | tUNUMBER ':' tUNUMBER '-' tUNUMBER { - yyHour = $1; - yyMinutes = $3; - yyMeridian = MER24; - yyDSTmode = DSToff; - yyTimezone = ($5 % 100 + ($5 / 100) * 60); - ++yyHaveZone; - } | tUNUMBER ':' tUNUMBER ':' tUNUMBER o_merid { yyHour = $1; yyMinutes = $3; yySeconds = $5; yyMeridian = $6; } - | tUNUMBER ':' tUNUMBER ':' tUNUMBER '-' tUNUMBER { - yyHour = $1; - yyMinutes = $3; - yySeconds = $5; - yyMeridian = MER24; - yyDSTmode = DSToff; - yyTimezone = ($7 % 100 + ($7 / 100) * 60); - ++yyHaveZone; - } ; zone : tZONE tDST { @@ -232,6 +215,10 @@ zone : tZONE tDST { yyTimezone = $1; yyDSTmode = DSTon; } + | sign tUNUMBER { + yyTimezone = -$1*($2 % 100 + ($2 / 100) * 60); + yyDSTmode = DSToff; + } ; day : tDAY { @@ -659,7 +646,7 @@ TclDateerror( infoPtr->separatrix = "\n"; } -MODULE_SCOPE int +int ToSeconds( int Hours, int Minutes, |