diff --git a/goyacc/main.go b/goyacc/main.go index 69da64b73..c85d221d0 100644 --- a/goyacc/main.go +++ b/goyacc/main.go @@ -222,7 +222,15 @@ func (s symsUsed) Less(i, j int) bool { return false } - return strings.ToLower(s[i].sym.Name) < strings.ToLower(s[j].sym.Name) + caseFoldedCompare := strings.Compare(strings.ToLower(s[i].sym.Name), strings.ToLower(s[j].sym.Name)) + if caseFoldedCompare < 0 { + return true + } + if caseFoldedCompare > 0 { + return false + } + + return s[i].sym.Name < s[j].sym.Name } func main1(in string) (err error) { diff --git a/parser.go b/parser.go index 56f8ae6f0..0165e213c 100644 --- a/parser.go +++ b/parser.go @@ -1065,8 +1065,8 @@ var ( 57817: 539, // AssignmentList (3x) 57830: 540, // ByItem (3x) 57847: 541, // ColumnPosition (3x) - 57380: 542, // constraint (3x) - 57853: 543, // Constraint (3x) + 57853: 542, // Constraint (3x) + 57380: 543, // constraint (3x) 57855: 544, // ConstraintKeywordOpt (3x) 57897: 545, // ExplainableStmt (3x) 57914: 546, // FloatOpt (3x) @@ -1907,8 +1907,8 @@ var ( "AssignmentList", "ByItem", "ColumnPosition", - "constraint", "Constraint", + "constraint", "ConstraintKeywordOpt", "ExplainableStmt", "FloatOpt", @@ -3326,7 +3326,7 @@ var ( {545, 1}, {782, 1}, {782, 3}, - {543, 2}, + {542, 2}, {668, 1}, {668, 1}, {668, 4}, @@ -5639,7 +5639,7 @@ var ( // 1720 {1203, 1203}, {2: 1547, 1470, 1471, 1503, 7: 1481, 1552, 1496, 1549, 1515, 1521, 1550, 1548, 1551, 1562, 1554, 1555, 1558, 1590, 22: 1583, 1602, 1524, 1527, 1528, 1482, 1618, 1502, 1545, 1658, 1638, 1640, 1639, 1539, 1490, 1510, 1596, 1597, 1593, 1559, 1601, 1541, 1495, 1579, 1617, 1501, 1514, 1516, 1489, 1488, 1563, 1512, 1586, 1526, 1531, 1544, 1571, 1616, 1509, 1564, 1594, 1574, 1599, 1613, 1610, 1588, 1536, 1537, 1626, 1474, 1581, 1627, 1483, 1484, 1485, 1646, 1629, 1491, 1576, 1492, 1494, 1577, 1504, 1505, 1654, 1630, 1584, 1580, 1518, 1519, 1615, 1523, 1632, 1525, 1532, 1533, 1535, 1468, 1472, 1475, 1477, 1476, 1478, 1628, 1624, 1480, 1611, 1546, 1566, 1486, 1487, 1493, 1497, 1498, 1585, 1589, 1507, 1582, 1508, 1560, 1499, 1573, 1655, 1619, 1631, 1511, 1570, 1553, 1606, 1607, 1608, 1609, 1620, 1540, 1556, 1587, 1568, 1598, 1595, 1600, 1660, 1625, 1565, 1623, 1569, 1520, 1603, 1604, 1612, 1605, 1522, 1635, 1636, 1634, 1633, 1614, 1621, 1529, 1530, 1637, 1671, 1534, 1561, 1567, 1622, 1538, 1641, 1542, 1469, 1473, 1642, 1643, 1644, 1479, 1645, 1592, 1647, 1648, 1649, 1650, 1500, 1651, 1506, 1652, 1653, 1464, 1657, 1656, 1513, 1659, 1661, 1517, 1578, 1557, 1591, 1543, 1572, 1575, 1665, 1666, 1667, 1668, 1662, 1663, 1664, 1669, 1670, 1672, 354: 1673, 1466, 1467, 1465, 435: 3342}, - {2: 1547, 1470, 1471, 1503, 7: 1481, 1552, 1496, 1549, 1515, 1521, 1550, 1548, 1551, 1562, 1554, 1555, 1558, 1590, 22: 1583, 1602, 1524, 1527, 1528, 1482, 1618, 1502, 1545, 1658, 1638, 1640, 1639, 1539, 1490, 1510, 1596, 1597, 1593, 1559, 1601, 1541, 1495, 1579, 1617, 1501, 1514, 1516, 1489, 1488, 1563, 1512, 1586, 1526, 1531, 1544, 1571, 1616, 1509, 1564, 1594, 1574, 1599, 1613, 1610, 1588, 1536, 1537, 1626, 1474, 1581, 1627, 1483, 1484, 1485, 1646, 1629, 1491, 1576, 1492, 1494, 1577, 1504, 1505, 1654, 1630, 1584, 1580, 1518, 1519, 1615, 1523, 1632, 1525, 1532, 1533, 1535, 1468, 1472, 1475, 1477, 1476, 1478, 1628, 1624, 1480, 1611, 1546, 1566, 1486, 1487, 1493, 1497, 1498, 1585, 1589, 1507, 1582, 1508, 1560, 1499, 1573, 1655, 1619, 1631, 1511, 1570, 1553, 1606, 1607, 1608, 1609, 1620, 1540, 1556, 1587, 1568, 1598, 1595, 1600, 1660, 1625, 1565, 1623, 1569, 1520, 1603, 1604, 1612, 1605, 1522, 1635, 1636, 1634, 1633, 1614, 1621, 1529, 1530, 1637, 1671, 1534, 1561, 1567, 1622, 1538, 1641, 1542, 1469, 1473, 1642, 1643, 1644, 1479, 1645, 1592, 1647, 1648, 1649, 1650, 1500, 1651, 1506, 1652, 1653, 1464, 1657, 1656, 1513, 1659, 1661, 1517, 1578, 1557, 1591, 1543, 1572, 1575, 1665, 1666, 1667, 1668, 1662, 1663, 1664, 1669, 1670, 1672, 249: 3085, 309: 1309, 347: 1309, 1309, 3089, 354: 1736, 1466, 1467, 1465, 365: 1309, 378: 1309, 1309, 439: 3084, 486: 3087, 542: 3083, 3088, 3086, 668: 3090, 787: 3091}, + {2: 1547, 1470, 1471, 1503, 7: 1481, 1552, 1496, 1549, 1515, 1521, 1550, 1548, 1551, 1562, 1554, 1555, 1558, 1590, 22: 1583, 1602, 1524, 1527, 1528, 1482, 1618, 1502, 1545, 1658, 1638, 1640, 1639, 1539, 1490, 1510, 1596, 1597, 1593, 1559, 1601, 1541, 1495, 1579, 1617, 1501, 1514, 1516, 1489, 1488, 1563, 1512, 1586, 1526, 1531, 1544, 1571, 1616, 1509, 1564, 1594, 1574, 1599, 1613, 1610, 1588, 1536, 1537, 1626, 1474, 1581, 1627, 1483, 1484, 1485, 1646, 1629, 1491, 1576, 1492, 1494, 1577, 1504, 1505, 1654, 1630, 1584, 1580, 1518, 1519, 1615, 1523, 1632, 1525, 1532, 1533, 1535, 1468, 1472, 1475, 1477, 1476, 1478, 1628, 1624, 1480, 1611, 1546, 1566, 1486, 1487, 1493, 1497, 1498, 1585, 1589, 1507, 1582, 1508, 1560, 1499, 1573, 1655, 1619, 1631, 1511, 1570, 1553, 1606, 1607, 1608, 1609, 1620, 1540, 1556, 1587, 1568, 1598, 1595, 1600, 1660, 1625, 1565, 1623, 1569, 1520, 1603, 1604, 1612, 1605, 1522, 1635, 1636, 1634, 1633, 1614, 1621, 1529, 1530, 1637, 1671, 1534, 1561, 1567, 1622, 1538, 1641, 1542, 1469, 1473, 1642, 1643, 1644, 1479, 1645, 1592, 1647, 1648, 1649, 1650, 1500, 1651, 1506, 1652, 1653, 1464, 1657, 1656, 1513, 1659, 1661, 1517, 1578, 1557, 1591, 1543, 1572, 1575, 1665, 1666, 1667, 1668, 1662, 1663, 1664, 1669, 1670, 1672, 249: 3085, 309: 1309, 347: 1309, 1309, 3089, 354: 1736, 1466, 1467, 1465, 365: 1309, 378: 1309, 1309, 439: 3084, 486: 3087, 542: 3088, 3083, 3086, 668: 3090, 787: 3091}, {2: 1547, 1470, 1471, 1503, 7: 1481, 1552, 1496, 1549, 1515, 1521, 1550, 1548, 1551, 1562, 1554, 1555, 1558, 1590, 22: 1583, 1602, 1524, 1527, 1528, 1482, 1618, 1502, 1545, 1658, 1638, 1640, 1639, 1539, 1490, 1510, 1596, 1597, 1593, 1559, 1601, 1541, 1495, 1579, 1617, 1501, 1514, 1516, 1489, 1488, 1563, 1512, 1586, 1526, 1531, 1544, 1571, 1616, 1509, 1564, 1594, 1574, 1599, 1613, 1610, 1588, 1536, 1537, 1626, 1474, 1581, 1627, 1483, 1484, 1485, 1646, 1629, 1491, 1576, 1492, 1494, 1577, 1504, 1505, 1654, 1630, 1584, 1580, 1518, 1519, 1615, 1523, 1632, 1525, 1532, 1533, 1535, 1468, 1472, 1475, 1477, 1476, 1478, 1628, 1624, 1480, 1611, 1546, 1566, 1486, 1487, 1493, 1497, 1498, 1585, 1589, 1507, 1582, 1508, 1560, 1499, 1573, 1655, 1619, 1631, 1511, 1570, 1553, 1606, 1607, 1608, 1609, 1620, 1540, 1556, 1587, 1568, 1598, 1595, 1600, 1660, 1625, 1565, 1623, 1569, 1520, 1603, 1604, 1612, 1605, 1522, 1635, 1636, 1634, 1633, 1614, 1621, 1529, 1530, 1637, 1671, 1534, 1561, 1567, 1622, 1538, 1641, 1542, 1469, 1473, 1642, 1643, 1644, 1479, 1645, 1592, 1647, 1648, 1649, 1650, 1500, 1651, 1506, 1652, 1653, 1464, 1657, 1656, 1513, 1659, 1661, 1517, 1578, 1557, 1591, 1543, 1572, 1575, 1665, 1666, 1667, 1668, 1662, 1663, 1664, 1669, 1670, 1672, 309: 1308, 347: 1308, 1308, 354: 3341, 1466, 1467, 1465, 365: 1308, 378: 1308, 1308, 667: 3340}, {35: 3230, 50: 3227, 3226, 56: 3229, 61: 3214, 96: 3228, 101: 3204, 3198, 3197, 115: 3212, 136: 3206, 159: 3222, 239: 3213, 252: 3208, 294: 154, 380: 3199, 3195, 3189, 384: 3215, 387: 3196, 3218, 390: 3203, 3201, 3190, 3191, 3192, 3193, 3194, 3225, 3220, 3224, 3219, 3188, 3223, 3200, 3216, 3202, 3187, 3217, 3186, 3221, 3209, 691: 3185, 3210, 3182, 709: 3180, 722: 3183, 3184, 734: 3181, 748: 3205, 751: 3178, 784: 3179, 794: 3211, 798: 3177, 803: 3207}, // 1725 @@ -5651,7 +5651,7 @@ var ( // 1730 {6: 237, 21: 237}, {6: 3092, 21: 3093}, - {2: 1547, 1470, 1471, 1503, 7: 1481, 1552, 1496, 1549, 1515, 1521, 1550, 1548, 1551, 1562, 1554, 1555, 1558, 1590, 22: 1583, 1602, 1524, 1527, 1528, 1482, 1618, 1502, 1545, 1658, 1638, 1640, 1639, 1539, 1490, 1510, 1596, 1597, 1593, 1559, 1601, 1541, 1495, 1579, 1617, 1501, 1514, 1516, 1489, 1488, 1563, 1512, 1586, 1526, 1531, 1544, 1571, 1616, 1509, 1564, 1594, 1574, 1599, 1613, 1610, 1588, 1536, 1537, 1626, 1474, 1581, 1627, 1483, 1484, 1485, 1646, 1629, 1491, 1576, 1492, 1494, 1577, 1504, 1505, 1654, 1630, 1584, 1580, 1518, 1519, 1615, 1523, 1632, 1525, 1532, 1533, 1535, 1468, 1472, 1475, 1477, 1476, 1478, 1628, 1624, 1480, 1611, 1546, 1566, 1486, 1487, 1493, 1497, 1498, 1585, 1589, 1507, 1582, 1508, 1560, 1499, 1573, 1655, 1619, 1631, 1511, 1570, 1553, 1606, 1607, 1608, 1609, 1620, 1540, 1556, 1587, 1568, 1598, 1595, 1600, 1660, 1625, 1565, 1623, 1569, 1520, 1603, 1604, 1612, 1605, 1522, 1635, 1636, 1634, 1633, 1614, 1621, 1529, 1530, 1637, 1671, 1534, 1561, 1567, 1622, 1538, 1641, 1542, 1469, 1473, 1642, 1643, 1644, 1479, 1645, 1592, 1647, 1648, 1649, 1650, 1500, 1651, 1506, 1652, 1653, 1464, 1657, 1656, 1513, 1659, 1661, 1517, 1578, 1557, 1591, 1543, 1572, 1575, 1665, 1666, 1667, 1668, 1662, 1663, 1664, 1669, 1670, 1672, 309: 1309, 347: 1309, 1309, 3089, 354: 1736, 1466, 1467, 1465, 365: 1309, 378: 1309, 1309, 439: 3084, 486: 3087, 542: 3083, 3088, 3086, 668: 3094}, + {2: 1547, 1470, 1471, 1503, 7: 1481, 1552, 1496, 1549, 1515, 1521, 1550, 1548, 1551, 1562, 1554, 1555, 1558, 1590, 22: 1583, 1602, 1524, 1527, 1528, 1482, 1618, 1502, 1545, 1658, 1638, 1640, 1639, 1539, 1490, 1510, 1596, 1597, 1593, 1559, 1601, 1541, 1495, 1579, 1617, 1501, 1514, 1516, 1489, 1488, 1563, 1512, 1586, 1526, 1531, 1544, 1571, 1616, 1509, 1564, 1594, 1574, 1599, 1613, 1610, 1588, 1536, 1537, 1626, 1474, 1581, 1627, 1483, 1484, 1485, 1646, 1629, 1491, 1576, 1492, 1494, 1577, 1504, 1505, 1654, 1630, 1584, 1580, 1518, 1519, 1615, 1523, 1632, 1525, 1532, 1533, 1535, 1468, 1472, 1475, 1477, 1476, 1478, 1628, 1624, 1480, 1611, 1546, 1566, 1486, 1487, 1493, 1497, 1498, 1585, 1589, 1507, 1582, 1508, 1560, 1499, 1573, 1655, 1619, 1631, 1511, 1570, 1553, 1606, 1607, 1608, 1609, 1620, 1540, 1556, 1587, 1568, 1598, 1595, 1600, 1660, 1625, 1565, 1623, 1569, 1520, 1603, 1604, 1612, 1605, 1522, 1635, 1636, 1634, 1633, 1614, 1621, 1529, 1530, 1637, 1671, 1534, 1561, 1567, 1622, 1538, 1641, 1542, 1469, 1473, 1642, 1643, 1644, 1479, 1645, 1592, 1647, 1648, 1649, 1650, 1500, 1651, 1506, 1652, 1653, 1464, 1657, 1656, 1513, 1659, 1661, 1517, 1578, 1557, 1591, 1543, 1572, 1575, 1665, 1666, 1667, 1668, 1662, 1663, 1664, 1669, 1670, 1672, 309: 1309, 347: 1309, 1309, 3089, 354: 1736, 1466, 1467, 1465, 365: 1309, 378: 1309, 1309, 439: 3084, 486: 3087, 542: 3088, 3083, 3086, 668: 3094}, {234, 234, 234, 234, 7: 234, 234, 234, 234, 234, 13: 234, 234, 234, 234, 234, 234, 234, 234, 210: 234, 214: 234, 217: 234, 238: 234, 243: 234, 353: 234, 358: 234, 234, 234, 234, 234}, {6: 236, 21: 236}, // 1735 @@ -6235,7 +6235,7 @@ var ( {360: 3654}, {1355, 1355, 6: 1355}, {374: 3650}, - {2: 1318, 1318, 1318, 1318, 7: 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 22: 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 309: 1309, 347: 1309, 1309, 360: 3640, 365: 1309, 378: 1309, 1309, 510: 3607, 3638, 542: 3083, 3639, 3086}, + {2: 1318, 1318, 1318, 1318, 7: 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 22: 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 309: 1309, 347: 1309, 1309, 360: 3640, 365: 1309, 378: 1309, 1309, 510: 3607, 3638, 542: 3639, 3083, 3086}, // 2220 {2: 1318, 1318, 1318, 1318, 7: 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 22: 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 1318, 309: 2521, 347: 3627, 360: 3628, 365: 2522, 378: 3630, 483: 3629, 510: 3607, 3626}, {554: 3625},