summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2015-07-08 09:45:20 (GMT)
committersebres <sebres@users.sourceforge.net>2015-07-08 09:45:20 (GMT)
commit68684fed1c43487f6f25d366a890482cad2c8c55 (patch)
tree815a8e7d6ac116bf6254ce5d282777340a3fca30
parent2b797142c1709ff69e5a78e59f0d47011dd01364 (diff)
downloadtcl-sebres_clock_tz_fix.zip
tcl-sebres_clock_tz_fix.tar.gz
tcl-sebres_clock_tz_fix.tar.bz2
clock - FreeScan (resp. Oldscan): 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);sebres_clock_tz_fix
test cases extended.
-rw-r--r--generic/tclDate.c271
-rw-r--r--generic/tclGetDate.y21
-rw-r--r--tests/clock.test41
3 files changed, 170 insertions, 163 deletions
diff --git a/generic/tclDate.c b/generic/tclDate.c
index a8d6965..42b9446 100644
--- a/generic/tclDate.c
+++ b/generic/tclDate.c
@@ -527,16 +527,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
@@ -552,7 +552,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,
@@ -584,11 +584,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. */
@@ -597,32 +597,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, 223, 223, 224, 227, 230, 233, 236, 239, 242,
- 245, 249, 254, 257, 263, 269, 277, 283, 294, 298,
- 302, 308, 312, 316, 320, 324, 330, 334, 339, 344,
- 349, 354, 358, 363, 367, 372, 379, 383, 389, 398,
- 407, 417, 431, 436, 439, 442, 445, 448, 451, 456,
- 459, 464, 468, 472, 478, 496, 499
+ 245, 249, 254, 257, 263, 269, 277, 281, 285, 289,
+ 295, 299, 303, 307, 311, 317, 321, 326, 331, 336,
+ 341, 345, 350, 354, 359, 366, 370, 376, 385, 394,
+ 404, 418, 423, 426, 429, 432, 435, 438, 443, 446,
+ 451, 455, 459, 465, 483, 486
};
#endif
@@ -634,7 +633,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
@@ -648,7 +647,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
@@ -656,22 +655,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
@@ -679,45 +678,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
@@ -727,26 +724,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
@@ -754,14 +751,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)
@@ -1703,42 +1699,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;
@@ -1746,7 +1733,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;
@@ -1754,20 +1741,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;
@@ -1775,7 +1754,7 @@ yyreduce:
;}
break;
- case 23:
+ case 22:
{
yyDayOrdinal = (yyvsp[(1) - (2)].Number);
@@ -1783,7 +1762,7 @@ yyreduce:
;}
break;
- case 24:
+ case 23:
{
yyDayOrdinal = (yyvsp[(1) - (3)].Number) * (yyvsp[(2) - (3)].Number);
@@ -1791,7 +1770,7 @@ yyreduce:
;}
break;
- case 25:
+ case 24:
{
yyDayOrdinal = 2;
@@ -1799,7 +1778,7 @@ yyreduce:
;}
break;
- case 26:
+ case 25:
{
yyMonth = (yyvsp[(1) - (3)].Number);
@@ -1807,7 +1786,7 @@ yyreduce:
;}
break;
- case 27:
+ case 26:
{
yyMonth = (yyvsp[(1) - (5)].Number);
@@ -1816,7 +1795,7 @@ yyreduce:
;}
break;
- case 28:
+ case 27:
{
yyYear = (yyvsp[(1) - (1)].Number) / 10000;
@@ -1825,7 +1804,7 @@ yyreduce:
;}
break;
- case 29:
+ case 28:
{
yyDay = (yyvsp[(1) - (5)].Number);
@@ -1834,7 +1813,7 @@ yyreduce:
;}
break;
- case 30:
+ case 29:
{
yyMonth = (yyvsp[(3) - (5)].Number);
@@ -1843,7 +1822,7 @@ yyreduce:
;}
break;
- case 31:
+ case 30:
{
yyMonth = (yyvsp[(1) - (2)].Number);
@@ -1851,7 +1830,7 @@ yyreduce:
;}
break;
- case 32:
+ case 31:
{
yyMonth = (yyvsp[(1) - (4)].Number);
@@ -1860,7 +1839,7 @@ yyreduce:
;}
break;
- case 33:
+ case 32:
{
yyMonth = (yyvsp[(2) - (2)].Number);
@@ -1868,7 +1847,7 @@ yyreduce:
;}
break;
- case 34:
+ case 33:
{
yyMonth = 1;
@@ -1877,7 +1856,7 @@ yyreduce:
;}
break;
- case 35:
+ case 34:
{
yyMonth = (yyvsp[(2) - (3)].Number);
@@ -1886,7 +1865,7 @@ yyreduce:
;}
break;
- case 36:
+ case 35:
{
yyMonthOrdinal = 1;
@@ -1894,7 +1873,7 @@ yyreduce:
;}
break;
- case 37:
+ case 36:
{
yyMonthOrdinal = (yyvsp[(2) - (3)].Number);
@@ -1902,7 +1881,7 @@ yyreduce:
;}
break;
- case 38:
+ case 37:
{
if ((yyvsp[(2) - (3)].Number) != HOUR( 7)) YYABORT;
@@ -1915,7 +1894,7 @@ yyreduce:
;}
break;
- case 39:
+ case 38:
{
if ((yyvsp[(2) - (7)].Number) != HOUR( 7)) YYABORT;
@@ -1928,7 +1907,7 @@ yyreduce:
;}
break;
- case 40:
+ case 39:
{
yyYear = (yyvsp[(1) - (2)].Number) / 10000;
@@ -1940,7 +1919,7 @@ yyreduce:
;}
break;
- case 41:
+ case 40:
{
/*
@@ -1956,7 +1935,7 @@ yyreduce:
;}
break;
- case 42:
+ case 41:
{
yyRelSeconds *= -1;
@@ -1965,56 +1944,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);
@@ -2022,7 +2001,7 @@ yyreduce:
;}
break;
- case 52:
+ case 51:
{
(yyval.Number) = (yyvsp[(1) - (1)].Number);
@@ -2030,7 +2009,7 @@ yyreduce:
;}
break;
- case 53:
+ case 52:
{
(yyval.Number) = (yyvsp[(1) - (1)].Number);
@@ -2038,7 +2017,7 @@ yyreduce:
;}
break;
- case 54:
+ case 53:
{
if (yyHaveTime && yyHaveDate && !yyHaveRel) {
@@ -2058,14 +2037,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 551b1ed..82cb791 100644
--- a/generic/tclGetDate.y
+++ b/generic/tclGetDate.y
@@ -266,29 +266,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 {
@@ -303,6 +286,10 @@ zone : tZONE tDST {
yyTimezone = $1;
yyDSTmode = DSTon;
}
+ | sign tUNUMBER {
+ yyTimezone = -$1*($2 % 100 + ($2 / 100) * 60);
+ yyDSTmode = DSToff;
+ }
;
day : tDAY {
diff --git a/tests/clock.test b/tests/clock.test
index ae79680..7ba401d 100644
--- a/tests/clock.test
+++ b/tests/clock.test
@@ -35618,6 +35618,47 @@ test clock-34.11 {clock scan tests} {
clock format $time -format {%b %d,%Y %H:%M GMT} -gmt true
} {Jan 01,2037 00:00 GMT}
+test clock-34.11.1 {clock scan tests (-TZ)} {
+ set time [clock scan "31 Jan 14 23:59:59 -0100"]
+ clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true
+} {Feb 01,2014 00:59:59 GMT}
+test clock-34.11.2 {clock scan tests (+TZ)} {
+ set time [clock scan "31 Jan 14 23:59:59 +0100"]
+ clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true
+} {Jan 31,2014 22:59:59 GMT}
+test clock-34.11.3 {clock scan tests (-TZ)} {
+ set time [clock scan "23:59:59 -0100" -base 0]
+ clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true
+} {Jan 02,1970 00:59:59 GMT}
+test clock-34.11.4 {clock scan tests (+TZ)} {
+ set time [clock scan "23:59:59 +0100" -base 0]
+ clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true
+} {Jan 01,1970 22:59:59 GMT}
+test clock-34.11.5 {clock scan tests (TZ)} {
+ set time [clock scan "Mon, 30 Jun 2014 23:59:59 CEST"]
+ clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true
+} {Jun 30,2014 21:59:59 GMT}
+test clock-34.11.6 {clock scan tests (TZ)} {
+ set time [clock scan "Fri, 31 Jan 2014 23:59:59 CET"]
+ clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true
+} {Jan 31,2014 22:59:59 GMT}
+test clock-34.11.7 {clock scan tests (relspec, day unit not TZ)} {
+ set time [clock scan "23:59:59 +15 day" -base 2000000]
+ clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true
+} {Feb 08,1970 22:59:59 GMT}
+test clock-34.11.8 {clock scan tests (relspec, day unit not TZ)} {
+ set time [clock scan "23:59:59 -15 day" -base 2000000]
+ clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true
+} {Jan 09,1970 22:59:59 GMT}
+test clock-34.11.9 {clock scan tests (merid and TZ)} {
+ set time [clock scan "10:59 pm CET" -base 2000000]
+ clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true
+} {Jan 24,1970 21:59:00 GMT}
+test clock-34.11.10 {clock scan tests (merid and TZ)} {
+ set time [clock scan "10:59 pm +0100" -base 2000000]
+ clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true
+} {Jan 24,1970 21:59:00 GMT}
+
test clock-34.12 {clock scan, relative times} {
set time [clock scan "Oct 23, 1992 -1 day"]
clock format $time -format {%b %d, %Y}