Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | ISO 8601 timestamp format accepts extended date and time (YYYY-MM-DD and hh:mm:ss); implements more strict TZ recognition rules by word-lookup (lookahead considering word boundaries, see test-cases), so avoid several conflicts, also confusing literal T in ISO timestamp with military TZ; closes #21 |
|---|---|
| Timelines: | family | ancestors | descendants | both | sebres-8-6-clock-speedup-bug-a1bd37b719 |
| Files: | files | file ages | folders |
| SHA3-256: |
b915ec2745e2e4213a7bf1b7c0e316cf |
| User & Date: | sebres 2020-06-22 18:21:59.411 |
Context
|
2020-06-22
| ||
| 18:22 | optimized ISO 8601 timestamp (with extended formats, T literal is optional now, more tests); decreas... check-in: 000e5124d6 user: sebres tags: sebres-8-6-clock-speedup-bug-a1bd37b719 | |
| 18:21 | ISO 8601 timestamp format accepts extended date and time (YYYY-MM-DD and hh:mm:ss); implements more... check-in: b915ec2745 user: sebres tags: sebres-8-6-clock-speedup-bug-a1bd37b719 | |
| 18:21 | added test-cases illustrating bug #21: literal may be mistakenly recognized as a time-zone (doesn't ... check-in: 67e152931d user: sebres tags: sebres-8-6-clock-speedup-bug-a1bd37b719 | |
Changes
Changes to generic/tclDate.c.
| ︙ | ︙ | |||
497 498 499 500 501 502 503 | # endif # endif #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ | | | | | | | | | 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 |
# endif
# endif
#endif /* !YYCOPY_NEEDED */
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 2
/* YYLAST -- Last index in YYTABLE. */
#define YYLAST 114
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 29
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 21
/* YYNRULES -- Number of rules. */
#define YYNRULES 70
/* YYNSTATES -- Number of states. */
#define YYNSTATES 105
/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
by yylex, with out-of-bounds checking. */
#define YYUNDEFTOK 2
#define YYMAXUTOK 276
#define YYTRANSLATE(YYX) \
((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
as returned by yylex, without out-of-bounds checking. */
static const yytype_uint8 yytranslate[] =
{
0, 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, 2, 2, 2, 2, 2, 2,
2, 2, 2, 28, 23, 24, 27, 25, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 22, 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, 26, 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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
| ︙ | ︙ | |||
555 556 557 558 559 560 561 |
};
#if YYDEBUG
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
0, 167, 167, 168, 169, 172, 175, 178, 181, 184,
| | | | | | | > | | > | | | | | | | | | | | | | | | | | | | < < | | | | | > | > | | > | | > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > | | | | < | | | < | | | > > | | | | | | > | 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 |
};
#if YYDEBUG
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
0, 167, 167, 168, 169, 172, 175, 178, 181, 184,
187, 190, 193, 197, 200, 206, 212, 218, 223, 227,
231, 235, 239, 243, 249, 250, 253, 257, 261, 265,
269, 273, 279, 285, 289, 294, 299, 304, 305, 309,
314, 318, 323, 330, 334, 340, 340, 342, 350, 355,
363, 364, 367, 381, 386, 389, 392, 395, 398, 401,
404, 409, 412, 417, 421, 425, 431, 434, 439, 457,
460
};
#endif
#if YYDEBUG || YYERROR_VERBOSE || 0
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
{
"$end", "error", "$undefined", "tAGO", "tDAY", "tDAYZONE", "tID",
"tMERIDIAN", "tMONTH", "tMONTH_UNIT", "tSTARDATE", "tSEC_UNIT",
"tUNUMBER", "tZONE", "tZONEwO4", "tZONEwO2", "tEPOCH", "tDST",
"tISOBASE", "tDAY_UNIT", "tNEXT", "SP", "':'", "','", "'-'", "'/'",
"'T'", "'.'", "'+'", "$accept", "spec", "item", "iextime", "time",
"zone", "comma", "day", "iexdate", "date", "ordMonth", "isosep", "iso",
"trek", "relspec", "relunits", "sign", "unit", "INTNUM", "number",
"o_merid", YY_NULLPTR
};
#endif
# ifdef YYPRINT
/* YYTOKNUM[NUM] -- (External) token number corresponding to the
(internal) symbol number NUM (which must be that of a token). */
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,
275, 276, 58, 44, 45, 47, 84, 46, 43
};
# endif
#define YYPACT_NINF -25
#define yypact_value_is_default(Yystate) \
(!!((Yystate) == (-25)))
#define YYTABLE_NINF -1
#define yytable_value_is_error(Yytable_value) \
0
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
static const yytype_int8 yypact[] =
{
-25, 46, -25, -19, -25, 4, -25, 21, -25, -1,
20, 60, 60, -25, 10, -25, 1, 67, -25, -25,
-25, 42, -25, -25, -25, -4, -25, -25, -25, -25,
-25, 49, 14, -25, 6, -25, 68, -25, -19, -25,
-25, 63, -25, -25, 80, 81, 26, 82, -25, 21,
21, -25, -25, -25, 29, -25, -25, 88, -25, 6,
-25, -25, -25, 75, 86, -25, -25, 95, 30, 6,
-25, -25, 89, 90, -25, 7, 76, 79, 83, -25,
-25, -25, -25, -25, -25, 92, -25, -25, 101, 6,
-25, -25, -25, 94, -25, 97, 98, 99, 85, -25,
-25, -25, -25, -25, -25
};
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
Performed when YYTABLE does not specify something else to do. Zero
means the default is an error. */
static const yytype_uint8 yydefact[] =
{
2, 0, 1, 26, 20, 0, 65, 0, 63, 66,
19, 0, 0, 41, 35, 64, 0, 0, 61, 62,
3, 69, 5, 6, 9, 37, 7, 8, 11, 12,
10, 54, 0, 60, 68, 13, 24, 27, 38, 66,
67, 0, 28, 15, 40, 0, 0, 0, 18, 0,
0, 49, 46, 45, 0, 31, 43, 66, 58, 0,
4, 70, 17, 0, 0, 51, 53, 66, 0, 23,
57, 25, 0, 0, 42, 69, 0, 0, 33, 21,
22, 47, 48, 44, 59, 0, 50, 30, 66, 0,
56, 39, 52, 0, 16, 0, 0, 0, 0, 29,
55, 14, 36, 32, 34
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int8 yypgoto[] =
{
-25, -25, 96, -24, -25, -25, 74, -25, -25, -25,
-25, -25, -25, -25, -25, -25, 57, -16, -5, -25,
39
};
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int8 yydefgoto[] =
{
-1, 1, 20, 21, 22, 23, 37, 24, 25, 26,
27, 54, 28, 29, 30, 31, 32, 33, 34, 35,
62
};
/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule whose
number is the opposite. If YYTABLE_NINF, syntax error. */
static const yytype_uint8 yytable[] =
{
58, 65, 41, 42, 36, 55, 43, 44, 63, 56,
6, 59, 8, 57, 61, 6, 38, 8, 70, 40,
15, 45, 64, 46, 47, 15, 67, 69, 51, 93,
82, 52, 40, 39, 76, 68, 53, 48, 77, 40,
86, 63, 88, 84, 79, 80, 2, 81, 40, 61,
3, 4, 66, 90, 5, 6, 7, 8, 9, 10,
11, 12, 13, 89, 14, 15, 16, 17, 49, 50,
18, 3, 4, 100, 19, 5, 6, 7, 8, 9,
10, 11, 12, 13, 18, 14, 15, 16, 19, 71,
73, 18, 74, 75, 78, 19, 83, 85, 63, 87,
95, 91, 92, 96, 98, 99, 101, 93, 97, 102,
103, 104, 72, 60, 94
};
static const yytype_uint8 yycheck[] =
{
16, 25, 7, 4, 23, 4, 7, 8, 12, 8,
9, 16, 11, 12, 7, 9, 12, 11, 34, 18,
19, 22, 26, 24, 25, 19, 12, 32, 18, 22,
54, 21, 18, 12, 8, 21, 26, 17, 12, 18,
64, 12, 12, 59, 49, 50, 0, 18, 18, 7,
4, 5, 3, 69, 8, 9, 10, 11, 12, 13,
14, 15, 16, 68, 18, 19, 20, 21, 11, 12,
24, 4, 5, 89, 28, 8, 9, 10, 11, 12,
13, 14, 15, 16, 24, 18, 19, 20, 28, 21,
27, 24, 12, 12, 12, 28, 8, 22, 12, 4,
24, 12, 12, 24, 12, 4, 12, 22, 25, 12,
12, 12, 38, 17, 75
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
static const yytype_uint8 yystos[] =
{
0, 30, 0, 4, 5, 8, 9, 10, 11, 12,
13, 14, 15, 16, 18, 19, 20, 21, 24, 28,
31, 32, 33, 34, 36, 37, 38, 39, 41, 42,
43, 44, 45, 46, 47, 48, 23, 35, 12, 12,
18, 47, 4, 7, 8, 22, 24, 25, 17, 45,
45, 18, 21, 26, 40, 4, 8, 12, 46, 47,
31, 7, 49, 12, 26, 32, 3, 12, 21, 47,
46, 21, 35, 27, 12, 12, 8, 12, 12, 47,
47, 18, 32, 8, 46, 22, 32, 4, 12, 47,
46, 12, 12, 22, 49, 24, 24, 25, 12, 4,
46, 12, 12, 12, 12
};
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const yytype_uint8 yyr1[] =
{
0, 29, 30, 30, 30, 31, 31, 31, 31, 31,
31, 31, 31, 31, 32, 33, 33, 33, 34, 34,
34, 34, 34, 34, 35, 35, 36, 36, 36, 36,
36, 36, 37, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 39, 39, 40, 40, 41, 41, 41,
41, 41, 42, 43, 43, 44, 44, 44, 44, 44,
44, 45, 45, 46, 46, 46, 47, 47, 48, 49,
49
};
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
static const yytype_uint8 yyr2[] =
{
0, 2, 0, 2, 3, 1, 1, 1, 1, 1,
1, 1, 1, 1, 5, 2, 4, 2, 2, 1,
1, 3, 3, 2, 1, 2, 1, 2, 2, 4,
3, 2, 5, 3, 5, 1, 5, 1, 2, 4,
2, 1, 3, 2, 3, 1, 1, 3, 3, 2,
3, 2, 4, 2, 1, 4, 3, 2, 2, 3,
1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
1
};
#define yyerrok (yyerrstatus = 0)
#define yyclearin (yychar = YYEMPTY)
#define YYEMPTY (-2)
#define YYEOF 0
|
| ︙ | ︙ | |||
1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 |
info->flags |= CLF_RELCONV;
}
break;
case 14:
{
yyHour = (yyvsp[-1].Number);
yyMinutes = 0;
yySeconds = 0;
yyMeridian = (yyvsp[0].Meridian);
}
break;
| > > > > > > > > > > | | < < < | | | | | | | | | | | | | > > > > > > > > > > | | | | < < < < < < < < < < | | | | | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < > > > > > > > > > > > > > > > > > > > > > > > | | | | | | | | | | | | | | | | | | 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 |
info->flags |= CLF_RELCONV;
}
break;
case 14:
{
yyHour = (yyvsp[-4].Number);
yyMinutes = (yyvsp[-2].Number);
yySeconds = (yyvsp[0].Number);
}
break;
case 15:
{
yyHour = (yyvsp[-1].Number);
yyMinutes = 0;
yySeconds = 0;
yyMeridian = (yyvsp[0].Meridian);
}
break;
case 16:
{
yyHour = (yyvsp[-3].Number);
yyMinutes = (yyvsp[-1].Number);
yySeconds = 0;
yyMeridian = (yyvsp[0].Meridian);
}
break;
case 17:
{
yyMeridian = (yyvsp[0].Meridian);
}
break;
case 18:
{
yyTimezone = (yyvsp[-1].Number);
yyDSTmode = DSTon;
}
break;
case 19:
{
yyTimezone = (yyvsp[0].Number);
yyDSTmode = DSToff;
}
break;
case 20:
{
yyTimezone = (yyvsp[0].Number);
yyDSTmode = DSTon;
}
break;
case 21:
{ /* GMT+0100, GMT-1000, etc. */
yyTimezone = (yyvsp[-2].Number) - (yyvsp[-1].Number)*((yyvsp[0].Number) % 100 + ((yyvsp[0].Number) / 100) * 60);
yyDSTmode = DSToff;
}
break;
case 22:
{ /* GMT+1, GMT-10, etc. */
yyTimezone = (yyvsp[-2].Number) - (yyvsp[-1].Number)*((yyvsp[0].Number) * 60);
yyDSTmode = DSToff;
}
break;
case 23:
{ /* +0100, -0100 */
yyTimezone = -(yyvsp[-1].Number)*((yyvsp[0].Number) % 100 + ((yyvsp[0].Number) / 100) * 60);
yyDSTmode = DSToff;
}
break;
case 26:
{
yyDayOrdinal = 1;
yyDayOfWeek = (yyvsp[0].Number);
}
break;
case 27:
{
yyDayOrdinal = 1;
yyDayOfWeek = (yyvsp[-1].Number);
}
break;
case 28:
{
yyDayOrdinal = (yyvsp[-1].Number);
yyDayOfWeek = (yyvsp[0].Number);
}
break;
case 29:
{
yyDayOrdinal = (yyvsp[-3].Number) * (yyvsp[-1].Number);
yyDayOfWeek = (yyvsp[0].Number);
}
break;
case 30:
{
yyDayOrdinal = (yyvsp[-2].Number) * (yyvsp[-1].Number);
yyDayOfWeek = (yyvsp[0].Number);
}
break;
case 31:
{
yyDayOrdinal = 2;
yyDayOfWeek = (yyvsp[0].Number);
}
break;
case 32:
{
yyMonth = (yyvsp[-2].Number);
yyDay = (yyvsp[0].Number);
yyYear = (yyvsp[-4].Number);
}
break;
case 33:
{
yyMonth = (yyvsp[-2].Number);
yyDay = (yyvsp[0].Number);
}
break;
case 34:
{
yyMonth = (yyvsp[-4].Number);
yyDay = (yyvsp[-2].Number);
yyYear = (yyvsp[0].Number);
}
break;
case 35:
{
yyYear = (yyvsp[0].Number) / 10000;
yyMonth = ((yyvsp[0].Number) % 10000)/100;
yyDay = (yyvsp[0].Number) % 100;
}
break;
case 36:
{
yyDay = (yyvsp[-4].Number);
yyMonth = (yyvsp[-2].Number);
yyYear = (yyvsp[0].Number);
}
break;
case 38:
{
yyMonth = (yyvsp[-1].Number);
yyDay = (yyvsp[0].Number);
}
break;
case 39:
{
yyMonth = (yyvsp[-3].Number);
yyDay = (yyvsp[-2].Number);
yyYear = (yyvsp[0].Number);
}
break;
case 40:
{
yyMonth = (yyvsp[0].Number);
yyDay = (yyvsp[-1].Number);
}
break;
case 41:
{
yyMonth = 1;
yyDay = 1;
yyYear = EPOCH;
}
break;
case 42:
{
yyMonth = (yyvsp[-1].Number);
yyDay = (yyvsp[-2].Number);
yyYear = (yyvsp[0].Number);
}
break;
case 43:
{
yyMonthOrdinalIncr = 1;
yyMonthOrdinal = (yyvsp[0].Number);
}
break;
case 44:
{
yyMonthOrdinalIncr = (yyvsp[-1].Number);
yyMonthOrdinal = (yyvsp[0].Number);
}
break;
case 47:
{
yyYear = (yyvsp[-2].Number) / 10000;
yyMonth = ((yyvsp[-2].Number) % 10000)/100;
yyDay = (yyvsp[-2].Number) % 100;
yyHour = (yyvsp[0].Number) / 10000;
yyMinutes = ((yyvsp[0].Number) % 10000)/100;
yySeconds = (yyvsp[0].Number) % 100;
}
break;
case 48:
{
yyYear = (yyvsp[-2].Number) / 10000;
yyMonth = ((yyvsp[-2].Number) % 10000)/100;
yyDay = (yyvsp[-2].Number) % 100;
}
break;
case 49:
{
yyYear = (yyvsp[-1].Number) / 10000;
yyMonth = ((yyvsp[-1].Number) % 10000)/100;
yyDay = (yyvsp[-1].Number) % 100;
yyHour = (yyvsp[0].Number) / 10000;
yyMinutes = ((yyvsp[0].Number) % 10000)/100;
yySeconds = (yyvsp[0].Number) % 100;
}
break;
case 52:
{
/*
* Offset computed year by -377 so that the returned years will be
* in a range accessible with a 32 bit clock seconds value.
*/
yyYear = (yyvsp[-2].Number)/1000 + 2323 - 377;
yyDay = 1;
yyMonth = 1;
yyRelDay += (((yyvsp[-2].Number)%1000)*(365 + IsLeapYear(yyYear)))/1000;
yyRelSeconds += (yyvsp[0].Number) * 144 * 60;
}
break;
case 53:
{
yyRelSeconds *= -1;
yyRelMonth *= -1;
yyRelDay *= -1;
}
break;
case 55:
{
*yyRelPointer += (yyvsp[-3].Number) * (yyvsp[-1].Number) * (yyvsp[0].Number);
}
break;
case 56:
{
*yyRelPointer += (yyvsp[-2].Number) * (yyvsp[-1].Number) * (yyvsp[0].Number);
}
break;
case 57:
{
*yyRelPointer += (yyvsp[-1].Number) * (yyvsp[0].Number);
}
break;
case 58:
{
*yyRelPointer += (yyvsp[0].Number);
}
break;
case 59:
{
*yyRelPointer += (yyvsp[-1].Number) * (yyvsp[0].Number);
}
break;
case 60:
{
*yyRelPointer += (yyvsp[0].Number);
}
break;
case 61:
{
(yyval.Number) = -1;
}
break;
case 62:
{
(yyval.Number) = 1;
}
break;
case 63:
{
(yyval.Number) = (yyvsp[0].Number);
yyRelPointer = &yyRelSeconds;
}
break;
case 64:
{
(yyval.Number) = (yyvsp[0].Number);
yyRelPointer = &yyRelDay;
}
break;
case 65:
{
(yyval.Number) = (yyvsp[0].Number);
yyRelPointer = &yyRelMonth;
}
break;
case 66:
{
(yyval.Number) = (yyvsp[0].Number);
}
break;
case 67:
{
(yyval.Number) = (yyvsp[0].Number);
}
break;
case 68:
{
if ((info->flags & (CLF_TIME|CLF_HAVEDATE|CLF_RELCONV)) == (CLF_TIME|CLF_HAVEDATE)) {
yyYear = (yyvsp[0].Number);
} else {
yyIncrFlags(CLF_TIME);
if (yyDigitCount <= 2) {
yyHour = (yyvsp[0].Number);
yyMinutes = 0;
} else {
yyHour = (yyvsp[0].Number) / 100;
yyMinutes = (yyvsp[0].Number) % 100;
}
yySeconds = 0;
yyMeridian = MER24;
}
}
break;
case 69:
{
(yyval.Meridian) = MER24;
}
break;
case 70:
{
(yyval.Meridian) = (yyvsp[0].Meridian);
}
break;
|
| ︙ | ︙ | |||
2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 |
} else {
location->last_column = yyInput - info->dateStart - 1;
return tUNUMBER;
}
}
if (!(c & 0x80) && isalpha(UCHAR(c))) { /* INTL: ISO only. */
int ret;
for (p = buff; isalpha(UCHAR(c = *yyInput++)) /* INTL: ISO only. */
|| c == '.'; ) {
if (p < &buff[sizeof buff - 1]) {
*p++ = c;
}
}
*p = '\0';
yyInput--;
location->last_column = yyInput - info->dateStart - 1;
ret = LookupWord(yylvalPtr, buff);
/*
| > > > > | > > > > | 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 |
} else {
location->last_column = yyInput - info->dateStart - 1;
return tUNUMBER;
}
}
if (!(c & 0x80) && isalpha(UCHAR(c))) { /* INTL: ISO only. */
int ret;
const char *litStart = yyInput;
for (p = buff; isalpha(UCHAR(c = *yyInput++)) /* INTL: ISO only. */
|| c == '.'; ) {
if (p < &buff[sizeof buff - 1]) {
*p++ = c;
}
}
*p = '\0';
yyInput--;
location->last_column = yyInput - info->dateStart - 1;
ret = LookupWord(yylvalPtr, buff);
/*
* lookahead:
* for spaces to consider word boundaries (for instance
* literal T in isodateTisotimeZ is not a TZ, but Z is UTC);
* for +/- digit, to differentiate between "GMT+1000 day" and "GMT +1000 day";
* bypass spaces after token (but ignore by TZ+OFFS), because should
* recognize next SP token, if TZ only.
*/
if (ret == tZONE || ret == tDAYZONE) {
c = *yyInput;
if (isdigit(c)) { /* literal not a TZ */
yyInput = litStart;
return *yyInput++;
}
if ((c == '+' || c == '-') && isdigit(UCHAR(*(yyInput+1)))) {
if ( !isdigit(UCHAR(*(yyInput+2)))
|| !isdigit(UCHAR(*(yyInput+3)))) {
/* GMT+1, GMT-10, etc. */
return tZONEwO2;
}
if ( isdigit(UCHAR(*(yyInput+4)))
|
| ︙ | ︙ |
Changes to generic/tclGetDate.y.
| ︙ | ︙ | |||
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
| trek {
yyIncrFlags(CLF_TIME|CLF_HAVEDATE);
info->flags |= CLF_RELCONV;
}
| number
;
time : tUNUMBER tMERIDIAN {
yyHour = $1;
yyMinutes = 0;
yySeconds = 0;
yyMeridian = $2;
}
| tUNUMBER ':' tUNUMBER o_merid {
yyHour = $1;
yyMinutes = $3;
yySeconds = 0;
yyMeridian = $4;
}
| > > > > > > | < < < | | 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 |
| trek {
yyIncrFlags(CLF_TIME|CLF_HAVEDATE);
info->flags |= CLF_RELCONV;
}
| number
;
iextime : tUNUMBER ':' tUNUMBER ':' tUNUMBER {
yyHour = $1;
yyMinutes = $3;
yySeconds = $5;
}
;
time : tUNUMBER tMERIDIAN {
yyHour = $1;
yyMinutes = 0;
yySeconds = 0;
yyMeridian = $2;
}
| tUNUMBER ':' tUNUMBER o_merid {
yyHour = $1;
yyMinutes = $3;
yySeconds = 0;
yyMeridian = $4;
}
| iextime o_merid {
yyMeridian = $2;
}
;
zone : tZONE tDST {
yyTimezone = $1;
yyDSTmode = DSTon;
}
|
| ︙ | ︙ | |||
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 |
}
| tNEXT tDAY {
yyDayOrdinal = 2;
yyDayOfWeek = $2;
}
;
date : tUNUMBER '/' tUNUMBER {
yyMonth = $1;
yyDay = $3;
}
| tUNUMBER '/' tUNUMBER '/' tUNUMBER {
yyMonth = $1;
yyDay = $3;
yyYear = $5;
}
| tISOBASE {
yyYear = $1 / 10000;
yyMonth = ($1 % 10000)/100;
yyDay = $1 % 100;
}
| tUNUMBER '-' tMONTH '-' tUNUMBER {
yyDay = $1;
yyMonth = $3;
yyYear = $5;
}
| > > > > > > < < | < < | 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 |
}
| tNEXT tDAY {
yyDayOrdinal = 2;
yyDayOfWeek = $2;
}
;
iexdate : tUNUMBER '-' tUNUMBER '-' tUNUMBER {
yyMonth = $3;
yyDay = $5;
yyYear = $1;
}
;
date : tUNUMBER '/' tUNUMBER {
yyMonth = $1;
yyDay = $3;
}
| tUNUMBER '/' tUNUMBER '/' tUNUMBER {
yyMonth = $1;
yyDay = $3;
yyYear = $5;
}
| tISOBASE {
yyYear = $1 / 10000;
yyMonth = ($1 % 10000)/100;
yyDay = $1 % 100;
}
| tUNUMBER '-' tMONTH '-' tUNUMBER {
yyDay = $1;
yyMonth = $3;
yyYear = $5;
}
| iexdate
| tMONTH tUNUMBER {
yyMonth = $1;
yyDay = $2;
}
| tMONTH tUNUMBER comma tUNUMBER {
yyMonth = $1;
yyDay = $2;
|
| ︙ | ︙ | |||
328 329 330 331 332 333 334 |
}
| tNEXT tUNUMBER tMONTH {
yyMonthOrdinalIncr = $2;
yyMonthOrdinal = $3;
}
;
| > > | < > > > > > < < < < < | < < < < < < < < | < < < < < < < < < < | 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 |
}
| tNEXT tUNUMBER tMONTH {
yyMonthOrdinalIncr = $2;
yyMonthOrdinal = $3;
}
;
isosep : 'T'|SP
;
iso : tISOBASE isosep tISOBASE {
yyYear = $1 / 10000;
yyMonth = ($1 % 10000)/100;
yyDay = $1 % 100;
yyHour = $3 / 10000;
yyMinutes = ($3 % 10000)/100;
yySeconds = $3 % 100;
}
| tISOBASE isosep iextime {
yyYear = $1 / 10000;
yyMonth = ($1 % 10000)/100;
yyDay = $1 % 100;
}
| tISOBASE tISOBASE {
yyYear = $1 / 10000;
yyMonth = ($1 % 10000)/100;
yyDay = $1 % 100;
yyHour = $2 / 10000;
yyMinutes = ($2 % 10000)/100;
yySeconds = $2 % 100;
}
| iexdate 'T' iextime
| iexdate iextime
;
trek : tSTARDATE INTNUM '.' tUNUMBER {
/*
* Offset computed year by -377 so that the returned years will be
* in a range accessible with a 32 bit clock seconds value.
*/
|
| ︙ | ︙ | |||
922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 |
} else {
location->last_column = yyInput - info->dateStart - 1;
return tUNUMBER;
}
}
if (!(c & 0x80) && isalpha(UCHAR(c))) { /* INTL: ISO only. */
int ret;
for (p = buff; isalpha(UCHAR(c = *yyInput++)) /* INTL: ISO only. */
|| c == '.'; ) {
if (p < &buff[sizeof buff - 1]) {
*p++ = c;
}
}
*p = '\0';
yyInput--;
location->last_column = yyInput - info->dateStart - 1;
ret = LookupWord(yylvalPtr, buff);
/*
| > > > > | > > > > | 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 |
} else {
location->last_column = yyInput - info->dateStart - 1;
return tUNUMBER;
}
}
if (!(c & 0x80) && isalpha(UCHAR(c))) { /* INTL: ISO only. */
int ret;
const char *litStart = yyInput;
for (p = buff; isalpha(UCHAR(c = *yyInput++)) /* INTL: ISO only. */
|| c == '.'; ) {
if (p < &buff[sizeof buff - 1]) {
*p++ = c;
}
}
*p = '\0';
yyInput--;
location->last_column = yyInput - info->dateStart - 1;
ret = LookupWord(yylvalPtr, buff);
/*
* lookahead:
* for spaces to consider word boundaries (for instance
* literal T in isodateTisotimeZ is not a TZ, but Z is UTC);
* for +/- digit, to differentiate between "GMT+1000 day" and "GMT +1000 day";
* bypass spaces after token (but ignore by TZ+OFFS), because should
* recognize next SP token, if TZ only.
*/
if (ret == tZONE || ret == tDAYZONE) {
c = *yyInput;
if (isdigit(c)) { /* literal not a TZ */
yyInput = litStart;
return *yyInput++;
}
if ((c == '+' || c == '-') && isdigit(UCHAR(*(yyInput+1)))) {
if ( !isdigit(UCHAR(*(yyInput+2)))
|| !isdigit(UCHAR(*(yyInput+3)))) {
/* GMT+1, GMT-10, etc. */
return tZONEwO2;
}
if ( isdigit(UCHAR(*(yyInput+4)))
|
| ︙ | ︙ |