/usr/share/doc/libghc-language-python-doc/html/language-python.txt is in libghc-language-python-doc 0.5.4-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 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 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 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 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 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 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 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 543 544 545 546 547 548 549 550 551 552 553 554 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 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 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 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 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 | -- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Parsing and pretty printing of Python code.
--
-- language-python is a Haskell library for lexical analysis, parsing and
-- pretty printing Python code. It supports versions 2.x and 3.x of
-- Python.
@package language-python
@version 0.5.4
-- | Conversion to/from escaped characters in strings. Note: currently does
-- not support escaped Unicode character names.
--
-- See:
--
-- <ul>
-- <li>Version 2.6
-- <a>http://www.python.org/doc/2.6/reference/lexical_analysis.html#string-literals</a></li>
-- <li>Version 3.1
-- <a>http://www.python.org/doc/3.1/reference/lexical_analysis.html#string-and-bytes-literals</a></li>
-- </ul>
module Language.Python.Common.StringEscape
-- | Convert escaped sequences of characters into <i>real</i> characters in
-- a normal Python string.
unescapeString :: String -> String
unescapeRawString :: String -> String
-- | The set of valid octal digits in Python.
octalDigits :: String
-- | The set of valid hex digits in Python.
hexDigits :: String
-- | Convenience class for pretty printing combinators.
module Language.Python.Common.Pretty
-- | All types which can be transformed into a <a>Doc</a>.
class Pretty a
pretty :: Pretty a => a -> Doc
-- | Transform values into strings.
prettyText :: Pretty a => a -> String
-- | Print just the prefix of something
prettyPrefix :: Pretty a => Int -> a -> Doc
-- | Conditionally wrap parentheses around an item.
parensIf :: Pretty a => (a -> Bool) -> a -> Doc
perhaps :: Pretty a => Maybe a -> Doc -> Doc
-- | A list of things separated by commas.
commaList :: Pretty a => [a] -> Doc
instance Language.Python.Common.Pretty.Pretty GHC.Base.String
instance Language.Python.Common.Pretty.Pretty GHC.Types.Int
instance Language.Python.Common.Pretty.Pretty GHC.Integer.Type.Integer
instance Language.Python.Common.Pretty.Pretty GHC.Types.Double
instance Language.Python.Common.Pretty.Pretty GHC.Types.Bool
instance Language.Python.Common.Pretty.Pretty a => Language.Python.Common.Pretty.Pretty (GHC.Base.Maybe a)
-- | Source location information for the Python lexer and parser. This
-- module provides single-point locations and spans, and conversions
-- between them.
module Language.Python.Common.SrcLocation
-- | A location for a syntactic entity from the source code. The location
-- is specified by its filename, and starting row and column.
data SrcLocation
Sloc :: !String -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> SrcLocation
[sloc_filename] :: SrcLocation -> !String
[sloc_row] :: SrcLocation -> {-# UNPACK #-} !Int
[sloc_column] :: SrcLocation -> {-# UNPACK #-} !Int
NoLocation :: SrcLocation
-- | Source location spanning a contiguous section of a file.
data SrcSpan
-- | A span which starts and ends on the same line.
SpanCoLinear :: !String -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> SrcSpan
[span_filename] :: SrcSpan -> !String
[span_row] :: SrcSpan -> {-# UNPACK #-} !Int
[span_start_column] :: SrcSpan -> {-# UNPACK #-} !Int
[span_end_column] :: SrcSpan -> {-# UNPACK #-} !Int
-- | A span which starts and ends on different lines.
SpanMultiLine :: !String -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> SrcSpan
[span_filename] :: SrcSpan -> !String
[span_start_row] :: SrcSpan -> {-# UNPACK #-} !Int
[span_start_column] :: SrcSpan -> {-# UNPACK #-} !Int
[span_end_row] :: SrcSpan -> {-# UNPACK #-} !Int
[span_end_column] :: SrcSpan -> {-# UNPACK #-} !Int
-- | A span which is actually just one point in the file.
SpanPoint :: !String -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> SrcSpan
[span_filename] :: SrcSpan -> !String
[span_row] :: SrcSpan -> {-# UNPACK #-} !Int
[span_column] :: SrcSpan -> {-# UNPACK #-} !Int
-- | No span information.
SpanEmpty :: SrcSpan
-- | Types which have a span.
class Span a where getSpan x = SpanEmpty
getSpan :: Span a => a -> SrcSpan
-- | Create a new span which encloses two spanned things.
spanning :: (Span a, Span b) => a -> b -> SrcSpan
-- | Make a span from two locations. Assumption: either the arguments are
-- the same, or the left one preceeds the right one.
mkSrcSpan :: SrcLocation -> SrcLocation -> SrcSpan
-- | Combines two <a>SrcSpan</a> into one that spans at least all the
-- characters within both spans. Assumes the "file" part is the same in
-- both inputs
combineSrcSpans :: SrcSpan -> SrcSpan -> SrcSpan
-- | Construct the initial source location for a file.
initialSrcLocation :: String -> SrcLocation
-- | Make a point span from the start of a span
spanStartPoint :: SrcSpan -> SrcSpan
-- | Increment the column of a location.
incColumn :: Int -> SrcLocation -> SrcLocation
-- | Decrement the column of a location, only if they are on the same row.
decColumn :: Int -> SrcLocation -> SrcLocation
-- | Increment the line number (row) of a location by one.
incLine :: Int -> SrcLocation -> SrcLocation
-- | Increment the column of a location by one tab stop.
incTab :: SrcLocation -> SrcLocation
-- | Get the column of the end of a span.
endCol :: SrcSpan -> Int
-- | Get the row of the end of a span.
endRow :: SrcSpan -> Int
-- | Get the column of the start of a span.
startCol :: SrcSpan -> Int
-- | Get the row of the start of a span.
startRow :: SrcSpan -> Int
instance Data.Data.Data Language.Python.Common.SrcLocation.SrcSpan
instance GHC.Show.Show Language.Python.Common.SrcLocation.SrcSpan
instance GHC.Classes.Ord Language.Python.Common.SrcLocation.SrcSpan
instance GHC.Classes.Eq Language.Python.Common.SrcLocation.SrcSpan
instance Data.Data.Data Language.Python.Common.SrcLocation.SrcLocation
instance GHC.Show.Show Language.Python.Common.SrcLocation.SrcLocation
instance GHC.Classes.Ord Language.Python.Common.SrcLocation.SrcLocation
instance GHC.Classes.Eq Language.Python.Common.SrcLocation.SrcLocation
instance Language.Python.Common.Pretty.Pretty Language.Python.Common.SrcLocation.SrcLocation
instance Language.Python.Common.SrcLocation.Span a => Language.Python.Common.SrcLocation.Span [a]
instance Language.Python.Common.SrcLocation.Span a => Language.Python.Common.SrcLocation.Span (GHC.Base.Maybe a)
instance (Language.Python.Common.SrcLocation.Span a, Language.Python.Common.SrcLocation.Span b) => Language.Python.Common.SrcLocation.Span (Data.Either.Either a b)
instance (Language.Python.Common.SrcLocation.Span a, Language.Python.Common.SrcLocation.Span b) => Language.Python.Common.SrcLocation.Span (a, b)
instance Language.Python.Common.SrcLocation.Span Language.Python.Common.SrcLocation.SrcSpan
instance Language.Python.Common.Pretty.Pretty Language.Python.Common.SrcLocation.SrcSpan
instance Language.Python.Common.SrcLocation.Span Language.Python.Common.SrcLocation.SrcLocation
-- | Lexical tokens for the Python lexer. Contains the superset of tokens
-- from version 2 and version 3 of Python (they are mostly the same).
module Language.Python.Common.Token
-- | Lexical tokens.
data Token
-- | Indentation: increase.
IndentToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Indentation: decrease.
DedentToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Newline.
NewlineToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Line join (backslash at end of line).
LineJoinToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Single line comment.
CommentToken :: !SrcSpan -> !String -> Token
[token_span] :: Token -> !SrcSpan
[token_literal] :: Token -> !String
-- | Identifier.
IdentifierToken :: !SrcSpan -> !String -> Token
[token_span] :: Token -> !SrcSpan
[token_literal] :: Token -> !String
-- | Literal: string.
StringToken :: !SrcSpan -> !String -> Token
[token_span] :: Token -> !SrcSpan
[token_literal] :: Token -> !String
-- | Literal: byte string.
ByteStringToken :: !SrcSpan -> !String -> Token
[token_span] :: Token -> !SrcSpan
[token_literal] :: Token -> !String
-- | Literal: unicode string, version 2 only.
UnicodeStringToken :: !SrcSpan -> !String -> Token
[token_span] :: Token -> !SrcSpan
[token_literal] :: Token -> !String
-- | Literal: integer.
IntegerToken :: !SrcSpan -> !String -> !Integer -> Token
[token_span] :: Token -> !SrcSpan
[token_literal] :: Token -> !String
[token_integer] :: Token -> !Integer
-- | Literal: long integer. <i>Version 2 only</i>.
LongIntegerToken :: !SrcSpan -> !String -> !Integer -> Token
[token_span] :: Token -> !SrcSpan
[token_literal] :: Token -> !String
[token_integer] :: Token -> !Integer
-- | Literal: floating point.
FloatToken :: !SrcSpan -> !String -> !Double -> Token
[token_span] :: Token -> !SrcSpan
[token_literal] :: Token -> !String
[token_double] :: Token -> !Double
-- | Literal: imaginary number.
ImaginaryToken :: !SrcSpan -> !String -> !Double -> Token
[token_span] :: Token -> !SrcSpan
[token_literal] :: Token -> !String
[token_double] :: Token -> !Double
-- | Keyword: 'def'.
DefToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: 'while'.
WhileToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: 'if'.
IfToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: 'True'.
TrueToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: 'False'.
FalseToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: 'Return'.
ReturnToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: 'try'.
TryToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: 'except'.
ExceptToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: 'raise'.
RaiseToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: 'in'.
InToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: 'is'.
IsToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: 'lambda'.
LambdaToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: 'class'.
ClassToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: 'finally'.
FinallyToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: 'None'.
NoneToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: 'for'.
ForToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: 'from'.
FromToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: 'global'.
GlobalToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: 'with'.
WithToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: 'as'.
AsToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: 'elif'.
ElifToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: 'yield'.
YieldToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: 'assert'.
AssertToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: 'import'.
ImportToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: 'pass'.
PassToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: 'break'.
BreakToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: 'continue'.
ContinueToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: 'del'.
DeleteToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: 'else'.
ElseToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: 'not'.
NotToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: boolean conjunction 'and'.
AndToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: boolean disjunction 'or'. Version 3.x only:
OrToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: 'nonlocal' (Python 3.x only) Version 2.x only:
NonLocalToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: 'print'. (Python 2.x only)
PrintToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Keyword: 'exec'. (Python 2.x only)
ExecToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Delimiter: at sign '@'.
AtToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Delimiter: left round bracket '('.
LeftRoundBracketToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Delimiter: right round bracket ')'.
RightRoundBracketToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Delimiter: left square bracket '['.
LeftSquareBracketToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Delimiter: right square bracket ']'.
RightSquareBracketToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Delimiter: left curly bracket '{'.
LeftBraceToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Delimiter: right curly bracket '}'.
RightBraceToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Delimiter: dot (full stop) '.'.
DotToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Delimiter: comma ','.
CommaToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Delimiter: semicolon ';'.
SemiColonToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Delimiter: colon ':'.
ColonToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Delimiter: ellipses (three dots) '...'.
EllipsisToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Delimiter: right facing arrow '->'.
RightArrowToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Delimiter: assignment '='.
AssignToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Delimiter: plus assignment '+='.
PlusAssignToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Delimiter: minus assignment '-='.
MinusAssignToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Delimiter: multiply assignment '*='
MultAssignToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Delimiter: divide assignment '/='.
DivAssignToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Delimiter: modulus assignment '%='.
ModAssignToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Delimiter: power assignment '**='.
PowAssignToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Delimiter: binary-and assignment '&='.
BinAndAssignToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Delimiter: binary-or assignment '|='.
BinOrAssignToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Delimiter: binary-xor assignment '^='.
BinXorAssignToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Delimiter: binary-left-shift assignment '<<='.
LeftShiftAssignToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Delimiter: binary-right-shift assignment '>>='.
RightShiftAssignToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Delimiter: floor-divide assignment '//='.
FloorDivAssignToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Delimiter: back quote character '`\'.
BackQuoteToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Operator: plus '+'.
PlusToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Operator: minus: '-'.
MinusToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Operator: multiply '*'.
MultToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Operator: divide '/'.
DivToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Operator: greater-than '>'.
GreaterThanToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Operator: less-than '<'.
LessThanToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Operator: equals '=='.
EqualityToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Operator: greater-than-or-equals '>='.
GreaterThanEqualsToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Operator: less-than-or-equals '<='.
LessThanEqualsToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Operator: exponential '**'.
ExponentToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Operator: binary-or '|'.
BinaryOrToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Operator: binary-xor '^'.
XorToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Operator: binary-and '&'.
BinaryAndToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Operator: binary-shift-left '<<'.
ShiftLeftToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Operator: binary-shift-right '>>'.
ShiftRightToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Operator: modulus '%'.
ModuloToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Operator: floor-divide '//'.
FloorDivToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Operator: tilde '~'.
TildeToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Operator: not-equals '!='.
NotEqualsToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Operator: not-equals '<>'. Version 2 only.
NotEqualsV2Token :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | End of file
EOFToken :: !SrcSpan -> Token
[token_span] :: Token -> !SrcSpan
-- | Produce a string from a token containing detailed information. Mainly
-- intended for debugging.
debugTokenString :: Token -> String
-- | Produce a string from a token which is suitable for printing as Python
-- concrete syntax. <i>Invisible</i> tokens yield an empty string.
tokenString :: Token -> String
-- | Test if a token contains its literal source text.
hasLiteral :: Token -> Bool
-- | Classification of tokens
data TokenClass
Comment :: TokenClass
Number :: TokenClass
Identifier :: TokenClass
Punctuation :: TokenClass
Bracket :: TokenClass
Layout :: TokenClass
Keyword :: TokenClass
String :: TokenClass
Operator :: TokenClass
Assignment :: TokenClass
classifyToken :: Token -> TokenClass
instance GHC.Classes.Ord Language.Python.Common.Token.TokenClass
instance GHC.Classes.Eq Language.Python.Common.Token.TokenClass
instance GHC.Show.Show Language.Python.Common.Token.TokenClass
instance Data.Data.Data Language.Python.Common.Token.Token
instance GHC.Show.Show Language.Python.Common.Token.Token
instance GHC.Classes.Ord Language.Python.Common.Token.Token
instance GHC.Classes.Eq Language.Python.Common.Token.Token
instance Language.Python.Common.SrcLocation.Span Language.Python.Common.Token.Token
-- | Representation of the Python abstract syntax tree (AST). The
-- representation is a superset of versions 2.x and 3.x of Python. In
-- many cases they are identical. The documentation in this module
-- indicates where they are different.
--
-- All the data types have a (polymorphic) parameter which allows the AST
-- to be annotated by an arbitrary type (for example source locations).
-- Specialised instances of the types are provided for source spans. For
-- example <tt>Module a</tt> is the type of modules, and
-- <tt>ModuleSpan</tt> is the type of modules annoted with source span
-- information.
--
-- Note: there are cases where the AST is more liberal than the formal
-- grammar of the language. Therefore some care must be taken when
-- constructing Python programs using the raw AST.
module Language.Python.Common.AST
-- | Convenient access to annotations in annotated types.
class Annotated t
-- | Given an annotated type, project out its annotation value.
annot :: Annotated t => t annot -> annot
-- | A module (Python source file).
--
-- <ul>
-- <li>Version 2.6
-- <a>http://www.python.org/doc/2.6/reference/toplevel_components.html</a></li>
-- <li>Version 3.1
-- <a>http://www.python.org/doc/3.1/reference/toplevel_components.html</a></li>
-- </ul>
newtype Module annot
-- | A module is just a sequence of top-level statements.
Module :: [Statement annot] -> Module annot
type ModuleSpan = Module SrcSpan
-- | Identifier.
data Ident annot
Ident :: !String -> annot -> Ident annot
[ident_string] :: Ident annot -> !String
[ident_annot] :: Ident annot -> annot
type IdentSpan = Ident SrcSpan
-- | A compound name constructed with the dot operator.
type DottedName annot = [Ident annot]
type DottedNameSpan = DottedName SrcSpan
-- | Statements.
--
-- <ul>
-- <li>Simple statements:</li>
-- <li>Version 2.6
-- <a>http://www.python.org/doc/2.6/reference/simple_stmts.html</a></li>
-- <li>Version 3.1
-- <a>http://www.python.org/doc/3.1/reference/simple_stmts.html</a></li>
-- <li>Compound statements:</li>
-- <li>Version 2.6
-- <a>http://www.python.org/doc/2.6/reference/compound_stmts.html</a></li>
-- <li>Version 3.1
-- <a>http://www.python.org/doc/3.1/reference/compound_stmts.html</a></li>
-- </ul>
data Statement annot
-- | Import statement.
Import :: [ImportItem annot] -> annot -> Statement annot
-- | Items to import.
[import_items] :: Statement annot -> [ImportItem annot]
[stmt_annot] :: Statement annot -> annot
-- | From ... import statement.
FromImport :: ImportRelative annot -> FromItems annot -> annot -> Statement annot
-- | Module to import from.
[from_module] :: Statement annot -> ImportRelative annot
-- | Items to import.
[from_items] :: Statement annot -> FromItems annot
[stmt_annot] :: Statement annot -> annot
-- | While loop.
While :: Expr annot -> Suite annot -> Suite annot -> annot -> Statement annot
-- | Loop condition.
[while_cond] :: Statement annot -> Expr annot
-- | Loop body.
[while_body] :: Statement annot -> Suite annot
-- | Else clause.
[while_else] :: Statement annot -> Suite annot
[stmt_annot] :: Statement annot -> annot
-- | For loop.
For :: [Expr annot] -> Expr annot -> Suite annot -> Suite annot -> annot -> Statement annot
-- | Loop variables.
[for_targets] :: Statement annot -> [Expr annot]
-- | Loop generator.
[for_generator] :: Statement annot -> Expr annot
-- | Loop body
[for_body] :: Statement annot -> Suite annot
-- | Else clause.
[for_else] :: Statement annot -> Suite annot
[stmt_annot] :: Statement annot -> annot
-- | Function definition.
Fun :: Ident annot -> [Parameter annot] -> Maybe (Expr annot) -> Suite annot -> annot -> Statement annot
-- | Function name.
[fun_name] :: Statement annot -> Ident annot
-- | Function parameter list.
[fun_args] :: Statement annot -> [Parameter annot]
-- | Optional result annotation.
[fun_result_annotation] :: Statement annot -> Maybe (Expr annot)
-- | Function body.
[fun_body] :: Statement annot -> Suite annot
[stmt_annot] :: Statement annot -> annot
-- | Class definition.
Class :: Ident annot -> [Argument annot] -> Suite annot -> annot -> Statement annot
-- | Class name.
[class_name] :: Statement annot -> Ident annot
-- | Class argument list. In version 2.x this is only ArgExprs.
[class_args] :: Statement annot -> [Argument annot]
-- | Class body.
[class_body] :: Statement annot -> Suite annot
[stmt_annot] :: Statement annot -> annot
-- | Conditional statement (if-elif-else).
Conditional :: [(Expr annot, Suite annot)] -> Suite annot -> annot -> Statement annot
-- | Sequence of if-elif conditional clauses.
[cond_guards] :: Statement annot -> [(Expr annot, Suite annot)]
-- | Possibly empty unconditional else clause.
[cond_else] :: Statement annot -> Suite annot
[stmt_annot] :: Statement annot -> annot
-- | Assignment statement.
Assign :: [Expr annot] -> Expr annot -> annot -> Statement annot
-- | Entity to assign to.
[assign_to] :: Statement annot -> [Expr annot]
-- | Expression to evaluate.
[assign_expr] :: Statement annot -> Expr annot
[stmt_annot] :: Statement annot -> annot
-- | Augmented assignment statement.
AugmentedAssign :: Expr annot -> AssignOp annot -> Expr annot -> annot -> Statement annot
-- | Entity to assign to.
[aug_assign_to] :: Statement annot -> Expr annot
-- | Assignment operator (for example '+=').
[aug_assign_op] :: Statement annot -> AssignOp annot
-- | Expression to evaluate.
[aug_assign_expr] :: Statement annot -> Expr annot
[stmt_annot] :: Statement annot -> annot
-- | Decorated definition of a function or class.
Decorated :: [Decorator annot] -> Statement annot -> annot -> Statement annot
-- | Decorators.
[decorated_decorators] :: Statement annot -> [Decorator annot]
-- | Function or class definition to be decorated.
[decorated_def] :: Statement annot -> Statement annot
[stmt_annot] :: Statement annot -> annot
-- | Return statement (may only occur syntactically nested in a function
-- definition).
Return :: Maybe (Expr annot) -> annot -> Statement annot
-- | Optional expression to evaluate and return to caller.
[return_expr] :: Statement annot -> Maybe (Expr annot)
[stmt_annot] :: Statement annot -> annot
-- | Try statement (exception handling).
Try :: Suite annot -> [Handler annot] -> Suite annot -> Suite annot -> annot -> Statement annot
-- | Try clause.
[try_body] :: Statement annot -> Suite annot
-- | Exception handlers.
[try_excepts] :: Statement annot -> [Handler annot]
-- | Possibly empty else clause, executed if and when control flows off the
-- end of the try clause.
[try_else] :: Statement annot -> Suite annot
-- | Possibly empty finally clause.
[try_finally] :: Statement annot -> Suite annot
[stmt_annot] :: Statement annot -> annot
-- | Raise statement (exception throwing).
Raise :: RaiseExpr annot -> annot -> Statement annot
[raise_expr] :: Statement annot -> RaiseExpr annot
[stmt_annot] :: Statement annot -> annot
-- | With statement (context management).
With :: [(Expr annot, Maybe (Expr annot))] -> Suite annot -> annot -> Statement annot
-- | Context expression(s) (yields a context manager).
[with_context] :: Statement annot -> [(Expr annot, Maybe (Expr annot))]
-- | Suite to be managed.
[with_body] :: Statement annot -> Suite annot
[stmt_annot] :: Statement annot -> annot
-- | Pass statement (null operation).
Pass :: annot -> Statement annot
[stmt_annot] :: Statement annot -> annot
-- | Break statement (may only occur syntactically nested in a for or while
-- loop, but not nested in a function or class definition within that
-- loop).
Break :: annot -> Statement annot
[stmt_annot] :: Statement annot -> annot
-- | Continue statement (may only occur syntactically nested in a for or
-- while loop, but not nested in a function or class definition or
-- finally clause within that loop).
Continue :: annot -> Statement annot
[stmt_annot] :: Statement annot -> annot
-- | Del statement (delete).
Delete :: [Expr annot] -> annot -> Statement annot
-- | Items to delete.
[del_exprs] :: Statement annot -> [Expr annot]
[stmt_annot] :: Statement annot -> annot
-- | Expression statement.
StmtExpr :: Expr annot -> annot -> Statement annot
[stmt_expr] :: Statement annot -> Expr annot
[stmt_annot] :: Statement annot -> annot
-- | Global declaration.
Global :: [Ident annot] -> annot -> Statement annot
-- | Variables declared global in the current block.
[global_vars] :: Statement annot -> [Ident annot]
[stmt_annot] :: Statement annot -> annot
-- | Nonlocal declaration. <i>Version 3.x only</i>.
NonLocal :: [Ident annot] -> annot -> Statement annot
-- | Variables declared nonlocal in the current block (their binding comes
-- from bound the nearest enclosing scope).
[nonLocal_vars] :: Statement annot -> [Ident annot]
[stmt_annot] :: Statement annot -> annot
-- | Assertion.
Assert :: [Expr annot] -> annot -> Statement annot
-- | Expressions being asserted.
[assert_exprs] :: Statement annot -> [Expr annot]
[stmt_annot] :: Statement annot -> annot
-- | Print statement. <i>Version 2 only</i>.
Print :: Bool -> [Expr annot] -> Bool -> annot -> Statement annot
-- | Optional chevron (>>)
[print_chevron] :: Statement annot -> Bool
-- | Arguments to print
[print_exprs] :: Statement annot -> [Expr annot]
-- | Does it end in a comma?
[print_trailing_comma] :: Statement annot -> Bool
[stmt_annot] :: Statement annot -> annot
-- | Exec statement. <i>Version 2 only</i>.
Exec :: Expr annot -> Maybe (Expr annot, Maybe (Expr annot)) -> annot -> Statement annot
-- | Expression to exec.
[exec_expr] :: Statement annot -> Expr annot
-- | Global and local environments to evaluate the expression within.
[exec_globals_locals] :: Statement annot -> Maybe (Expr annot, Maybe (Expr annot))
[stmt_annot] :: Statement annot -> annot
type StatementSpan = Statement SrcSpan
-- | A block of statements. A suite is a group of statements controlled by
-- a clause, for example, the body of a loop.
--
-- <ul>
-- <li>Version 2.6
-- <a>http://www.python.org/doc/2.6/reference/compound_stmts.html</a></li>
-- <li>Version 3.1
-- <a>http://www.python.org/doc/3.1/reference/compound_stmts.html</a></li>
-- </ul>
type Suite annot = [Statement annot]
type SuiteSpan = Suite SrcSpan
-- | Formal parameter of function definitions and lambda expressions.
--
-- <ul>
-- <li>Version 2.6:</li>
--
-- <li><a>http://www.python.org/doc/2.6/reference/compound_stmts.html#function-definitions</a></li>
--
-- <li><a>http://www.python.org/doc/2.6/reference/expressions.html#calls</a></li>
-- <li>Version 3.1:</li>
--
-- <li><a>http://www.python.org/doc/3.1/reference/compound_stmts.html#function-definitions</a></li>
--
-- <li><a>http://www.python.org/doc/3.1/reference/expressions.html#calls</a></li>
-- </ul>
data Parameter annot
-- | Ordinary named parameter.
Param :: Ident annot -> Maybe (Expr annot) -> Maybe (Expr annot) -> annot -> Parameter annot
-- | Parameter name.
[param_name] :: Parameter annot -> Ident annot
-- | Optional annotation.
[param_py_annotation] :: Parameter annot -> Maybe (Expr annot)
-- | Optional default value.
[param_default] :: Parameter annot -> Maybe (Expr annot)
[param_annot] :: Parameter annot -> annot
-- | Excess positional parameter (single asterisk before its name in the
-- concrete syntax).
VarArgsPos :: Ident annot -> Maybe (Expr annot) -> annot -> Parameter annot
-- | Parameter name.
[param_name] :: Parameter annot -> Ident annot
-- | Optional annotation.
[param_py_annotation] :: Parameter annot -> Maybe (Expr annot)
[param_annot] :: Parameter annot -> annot
-- | Excess keyword parameter (double asterisk before its name in the
-- concrete syntax).
VarArgsKeyword :: Ident annot -> Maybe (Expr annot) -> annot -> Parameter annot
-- | Parameter name.
[param_name] :: Parameter annot -> Ident annot
-- | Optional annotation.
[param_py_annotation] :: Parameter annot -> Maybe (Expr annot)
[param_annot] :: Parameter annot -> annot
-- | Marker for the end of positional parameters (not a parameter itself).
EndPositional :: annot -> Parameter annot
[param_annot] :: Parameter annot -> annot
-- | Tuple unpack. <i>Version 2 only</i>.
UnPackTuple :: ParamTuple annot -> Maybe (Expr annot) -> annot -> Parameter annot
-- | The tuple to unpack.
[param_unpack_tuple] :: Parameter annot -> ParamTuple annot
-- | Optional default value.
[param_default] :: Parameter annot -> Maybe (Expr annot)
[param_annot] :: Parameter annot -> annot
type ParameterSpan = Parameter SrcSpan
-- | Tuple unpack parameter. <i>Version 2 only</i>.
data ParamTuple annot
-- | A variable name.
ParamTupleName :: Ident annot -> annot -> ParamTuple annot
[param_tuple_name] :: ParamTuple annot -> Ident annot
[param_tuple_annot] :: ParamTuple annot -> annot
-- | A (possibly nested) tuple parameter.
ParamTuple :: [ParamTuple annot] -> annot -> ParamTuple annot
[param_tuple] :: ParamTuple annot -> [ParamTuple annot]
[param_tuple_annot] :: ParamTuple annot -> annot
type ParamTupleSpan = ParamTuple SrcSpan
-- | Decorator.
data Decorator annot
Decorator :: DottedName annot -> [Argument annot] -> annot -> Decorator annot
-- | Decorator name.
[decorator_name] :: Decorator annot -> DottedName annot
-- | Decorator arguments.
[decorator_args] :: Decorator annot -> [Argument annot]
[decorator_annot] :: Decorator annot -> annot
type DecoratorSpan = Decorator SrcSpan
-- | Augmented assignment operators.
data AssignOp annot
-- | '+='
PlusAssign :: annot -> AssignOp annot
[assignOp_annot] :: AssignOp annot -> annot
-- | '-='
MinusAssign :: annot -> AssignOp annot
[assignOp_annot] :: AssignOp annot -> annot
-- | '*='
MultAssign :: annot -> AssignOp annot
[assignOp_annot] :: AssignOp annot -> annot
-- | '/='
DivAssign :: annot -> AssignOp annot
[assignOp_annot] :: AssignOp annot -> annot
-- | '%='
ModAssign :: annot -> AssignOp annot
[assignOp_annot] :: AssignOp annot -> annot
-- | '*='
PowAssign :: annot -> AssignOp annot
[assignOp_annot] :: AssignOp annot -> annot
-- | '&='
BinAndAssign :: annot -> AssignOp annot
[assignOp_annot] :: AssignOp annot -> annot
-- | '|='
BinOrAssign :: annot -> AssignOp annot
[assignOp_annot] :: AssignOp annot -> annot
-- | '^='
BinXorAssign :: annot -> AssignOp annot
[assignOp_annot] :: AssignOp annot -> annot
-- | '<<='
LeftShiftAssign :: annot -> AssignOp annot
[assignOp_annot] :: AssignOp annot -> annot
-- | '>>='
RightShiftAssign :: annot -> AssignOp annot
[assignOp_annot] :: AssignOp annot -> annot
-- | '//='
FloorDivAssign :: annot -> AssignOp annot
[assignOp_annot] :: AssignOp annot -> annot
type AssignOpSpan = AssignOp SrcSpan
-- | Expressions.
--
-- <ul>
-- <li>Version 2.6
-- <a>http://www.python.org/doc/2.6/reference/expressions.html</a>.</li>
-- <li>Version 3.1
-- <a>http://www.python.org/doc/3.1/reference/expressions.html</a>.</li>
-- </ul>
data Expr annot
-- | Variable.
Var :: Ident annot -> annot -> Expr annot
[var_ident] :: Expr annot -> Ident annot
[expr_annot] :: Expr annot -> annot
-- | Literal integer.
Int :: Integer -> String -> annot -> Expr annot
[int_value] :: Expr annot -> Integer
[expr_literal] :: Expr annot -> String
[expr_annot] :: Expr annot -> annot
-- | Long literal integer. <i>Version 2 only</i>.
LongInt :: Integer -> String -> annot -> Expr annot
[int_value] :: Expr annot -> Integer
[expr_literal] :: Expr annot -> String
[expr_annot] :: Expr annot -> annot
-- | Literal floating point number.
Float :: Double -> String -> annot -> Expr annot
[float_value] :: Expr annot -> Double
[expr_literal] :: Expr annot -> String
[expr_annot] :: Expr annot -> annot
-- | Literal imaginary number.
Imaginary :: Double -> String -> annot -> Expr annot
[imaginary_value] :: Expr annot -> Double
[expr_literal] :: Expr annot -> String
[expr_annot] :: Expr annot -> annot
-- | Literal boolean.
Bool :: Bool -> annot -> Expr annot
[bool_value] :: Expr annot -> Bool
[expr_annot] :: Expr annot -> annot
-- | Literal 'None' value.
None :: annot -> Expr annot
[expr_annot] :: Expr annot -> annot
-- | Ellipsis '...'.
Ellipsis :: annot -> Expr annot
[expr_annot] :: Expr annot -> annot
-- | Literal byte string.
ByteStrings :: [String] -> annot -> Expr annot
[byte_string_strings] :: Expr annot -> [String]
[expr_annot] :: Expr annot -> annot
-- | Literal strings (to be concatentated together).
Strings :: [String] -> annot -> Expr annot
[strings_strings] :: Expr annot -> [String]
[expr_annot] :: Expr annot -> annot
-- | Unicode literal strings (to be concatentated together). Version 2
-- only.
UnicodeStrings :: [String] -> annot -> Expr annot
[unicodestrings_strings] :: Expr annot -> [String]
[expr_annot] :: Expr annot -> annot
-- | Function call.
Call :: Expr annot -> [Argument annot] -> annot -> Expr annot
-- | Expression yielding a callable object (such as a function).
[call_fun] :: Expr annot -> Expr annot
-- | Call arguments.
[call_args] :: Expr annot -> [Argument annot]
[expr_annot] :: Expr annot -> annot
-- | Subscription, for example 'x [y]'.
Subscript :: Expr annot -> Expr annot -> annot -> Expr annot
[subscriptee] :: Expr annot -> Expr annot
[subscript_expr] :: Expr annot -> Expr annot
[expr_annot] :: Expr annot -> annot
-- | Slicing, for example 'w [x:y:z]'.
SlicedExpr :: Expr annot -> [Slice annot] -> annot -> Expr annot
[slicee] :: Expr annot -> Expr annot
[slices] :: Expr annot -> [Slice annot]
[expr_annot] :: Expr annot -> annot
-- | Conditional expresison.
CondExpr :: Expr annot -> Expr annot -> Expr annot -> annot -> Expr annot
-- | Expression to evaluate if condition is True.
[ce_true_branch] :: Expr annot -> Expr annot
-- | Boolean condition.
[ce_condition] :: Expr annot -> Expr annot
-- | Expression to evaluate if condition is False.
[ce_false_branch] :: Expr annot -> Expr annot
[expr_annot] :: Expr annot -> annot
-- | Binary operator application.
BinaryOp :: Op annot -> Expr annot -> Expr annot -> annot -> Expr annot
[operator] :: Expr annot -> Op annot
[left_op_arg] :: Expr annot -> Expr annot
[right_op_arg] :: Expr annot -> Expr annot
[expr_annot] :: Expr annot -> annot
-- | Unary operator application.
UnaryOp :: Op annot -> Expr annot -> annot -> Expr annot
[operator] :: Expr annot -> Op annot
[op_arg] :: Expr annot -> Expr annot
[expr_annot] :: Expr annot -> annot
Dot :: Expr annot -> Ident annot -> annot -> Expr annot
[dot_expr] :: Expr annot -> Expr annot
[dot_attribute] :: Expr annot -> Ident annot
[expr_annot] :: Expr annot -> annot
-- | Anonymous function definition (lambda).
Lambda :: [Parameter annot] -> Expr annot -> annot -> Expr annot
[lambda_args] :: Expr annot -> [Parameter annot]
[lambda_body] :: Expr annot -> Expr annot
[expr_annot] :: Expr annot -> annot
-- | Tuple. Can be empty.
Tuple :: [Expr annot] -> annot -> Expr annot
[tuple_exprs] :: Expr annot -> [Expr annot]
[expr_annot] :: Expr annot -> annot
-- | Generator yield.
Yield :: Maybe (YieldArg annot) -> annot -> Expr annot
-- | Optional Yield argument.
[yield_arg] :: Expr annot -> Maybe (YieldArg annot)
[expr_annot] :: Expr annot -> annot
-- | Generator.
Generator :: Comprehension annot -> annot -> Expr annot
[gen_comprehension] :: Expr annot -> Comprehension annot
[expr_annot] :: Expr annot -> annot
-- | List comprehension.
ListComp :: Comprehension annot -> annot -> Expr annot
[list_comprehension] :: Expr annot -> Comprehension annot
[expr_annot] :: Expr annot -> annot
-- | List.
List :: [Expr annot] -> annot -> Expr annot
[list_exprs] :: Expr annot -> [Expr annot]
[expr_annot] :: Expr annot -> annot
-- | Dictionary.
Dictionary :: [DictMappingPair annot] -> annot -> Expr annot
[dict_mappings] :: Expr annot -> [DictMappingPair annot]
[expr_annot] :: Expr annot -> annot
-- | Dictionary comprehension. <i>Version 3 only</i>.
DictComp :: Comprehension annot -> annot -> Expr annot
[dict_comprehension] :: Expr annot -> Comprehension annot
[expr_annot] :: Expr annot -> annot
-- | Set.
Set :: [Expr annot] -> annot -> Expr annot
[set_exprs] :: Expr annot -> [Expr annot]
[expr_annot] :: Expr annot -> annot
-- | Set comprehension. <i>Version 3 only</i>.
SetComp :: Comprehension annot -> annot -> Expr annot
[set_comprehension] :: Expr annot -> Comprehension annot
[expr_annot] :: Expr annot -> annot
-- | Starred expression. <i>Version 3 only</i>.
Starred :: Expr annot -> annot -> Expr annot
[starred_expr] :: Expr annot -> Expr annot
[expr_annot] :: Expr annot -> annot
-- | Parenthesised expression.
Paren :: Expr annot -> annot -> Expr annot
[paren_expr] :: Expr annot -> Expr annot
[expr_annot] :: Expr annot -> annot
-- | String conversion (backquoted expression). Version 2 only.
StringConversion :: Expr annot -> annot -> Expr annot
[backquoted_expr] :: Expr annot -> Expr annot
[expr_anot] :: Expr annot -> annot
type ExprSpan = Expr SrcSpan
-- | Operators.
data Op annot
-- | 'and'
And :: annot -> Op annot
[op_annot] :: Op annot -> annot
-- | 'or'
Or :: annot -> Op annot
[op_annot] :: Op annot -> annot
-- | 'not'
Not :: annot -> Op annot
[op_annot] :: Op annot -> annot
-- | '**'
Exponent :: annot -> Op annot
[op_annot] :: Op annot -> annot
-- | '<'
LessThan :: annot -> Op annot
[op_annot] :: Op annot -> annot
-- | '>'
GreaterThan :: annot -> Op annot
[op_annot] :: Op annot -> annot
-- | '=='
Equality :: annot -> Op annot
[op_annot] :: Op annot -> annot
-- | '>='
GreaterThanEquals :: annot -> Op annot
[op_annot] :: Op annot -> annot
-- | '<='
LessThanEquals :: annot -> Op annot
[op_annot] :: Op annot -> annot
-- | '!='
NotEquals :: annot -> Op annot
[op_annot] :: Op annot -> annot
-- | '<>'. Version 2 only.
NotEqualsV2 :: annot -> Op annot
[op_annot] :: Op annot -> annot
-- | 'in'
In :: annot -> Op annot
[op_annot] :: Op annot -> annot
-- | 'is'
Is :: annot -> Op annot
[op_annot] :: Op annot -> annot
-- | 'is not'
IsNot :: annot -> Op annot
[op_annot] :: Op annot -> annot
-- | 'not in'
NotIn :: annot -> Op annot
[op_annot] :: Op annot -> annot
-- | '|'
BinaryOr :: annot -> Op annot
[op_annot] :: Op annot -> annot
-- | '^'
Xor :: annot -> Op annot
[op_annot] :: Op annot -> annot
-- | '&'
BinaryAnd :: annot -> Op annot
[op_annot] :: Op annot -> annot
-- | '<<'
ShiftLeft :: annot -> Op annot
[op_annot] :: Op annot -> annot
-- | '>>'
ShiftRight :: annot -> Op annot
[op_annot] :: Op annot -> annot
-- | '*'
Multiply :: annot -> Op annot
[op_annot] :: Op annot -> annot
-- | '+'
Plus :: annot -> Op annot
[op_annot] :: Op annot -> annot
-- | '-'
Minus :: annot -> Op annot
[op_annot] :: Op annot -> annot
-- | '/'
Divide :: annot -> Op annot
[op_annot] :: Op annot -> annot
-- | '//'
FloorDivide :: annot -> Op annot
[op_annot] :: Op annot -> annot
-- | '~' (bitwise inversion of its integer argument)
Invert :: annot -> Op annot
[op_annot] :: Op annot -> annot
-- | '%'
Modulo :: annot -> Op annot
[op_annot] :: Op annot -> annot
type OpSpan = Op SrcSpan
-- | Arguments to function calls, class declarations and decorators.
data Argument annot
-- | Ordinary argument expression.
ArgExpr :: Expr annot -> annot -> Argument annot
-- | Argument expression.
[arg_expr] :: Argument annot -> Expr annot
[arg_annot] :: Argument annot -> annot
-- | Excess positional argument.
ArgVarArgsPos :: Expr annot -> annot -> Argument annot
-- | Argument expression.
[arg_expr] :: Argument annot -> Expr annot
[arg_annot] :: Argument annot -> annot
-- | Excess keyword argument.
ArgVarArgsKeyword :: Expr annot -> annot -> Argument annot
-- | Argument expression.
[arg_expr] :: Argument annot -> Expr annot
[arg_annot] :: Argument annot -> annot
-- | Keyword argument.
ArgKeyword :: Ident annot -> Expr annot -> annot -> Argument annot
-- | Keyword name.
[arg_keyword] :: Argument annot -> Ident annot
-- | Argument expression.
[arg_expr] :: Argument annot -> Expr annot
[arg_annot] :: Argument annot -> annot
type ArgumentSpan = Argument SrcSpan
-- | Slice compenent.
data Slice annot
SliceProper :: Maybe (Expr annot) -> Maybe (Expr annot) -> Maybe (Maybe (Expr annot)) -> annot -> Slice annot
[slice_lower] :: Slice annot -> Maybe (Expr annot)
[slice_upper] :: Slice annot -> Maybe (Expr annot)
[slice_stride] :: Slice annot -> Maybe (Maybe (Expr annot))
[slice_annot] :: Slice annot -> annot
SliceExpr :: Expr annot -> annot -> Slice annot
[slice_expr] :: Slice annot -> Expr annot
[slice_annot] :: Slice annot -> annot
SliceEllipsis :: annot -> Slice annot
[slice_annot] :: Slice annot -> annot
type SliceSpan = Slice SrcSpan
data DictMappingPair annot
DictMappingPair :: (Expr annot) -> (Expr annot) -> DictMappingPair annot
type DictMappingPairSpan = DictMappingPair SrcSpan
data YieldArg annot
-- | Yield from a generator (Version 3 only)
YieldFrom :: (Expr annot) -> annot -> YieldArg annot
-- | Yield value of an expression
YieldExpr :: (Expr annot) -> YieldArg annot
type YieldArgSpan = YieldArg SrcSpan
-- | An entity imported using the 'import' keyword.
--
-- <ul>
-- <li>Version 2.6
-- <a>http://www.python.org/doc/2.6/reference/simple_stmts.html#the-import-statement</a></li>
-- <li>Version 3.1
-- <a>http://www.python.org/doc/3.1/reference/simple_stmts.html#the-import-statement</a></li>
-- </ul>
data ImportItem annot
ImportItem :: DottedName annot -> Maybe (Ident annot) -> annot -> ImportItem annot
-- | The name of module to import.
[import_item_name] :: ImportItem annot -> DottedName annot
-- | An optional name to refer to the entity (the 'as' name).
[import_as_name] :: ImportItem annot -> Maybe (Ident annot)
[import_item_annot] :: ImportItem annot -> annot
type ImportItemSpan = ImportItem SrcSpan
-- | An entity imported using the 'from ... import' construct.
--
-- <ul>
-- <li>Version 2.6
-- <a>http://www.python.org/doc/2.6/reference/simple_stmts.html#the-import-statement</a></li>
-- <li>Version 3.1
-- <a>http://www.python.org/doc/3.1/reference/simple_stmts.html#the-import-statement</a></li>
-- </ul>
data FromItem annot
FromItem :: Ident annot -> Maybe (Ident annot) -> annot -> FromItem annot
-- | The name of the entity imported.
[from_item_name] :: FromItem annot -> Ident annot
-- | An optional name to refer to the entity (the 'as' name).
[from_as_name] :: FromItem annot -> Maybe (Ident annot)
[from_item_annot] :: FromItem annot -> annot
type FromItemSpan = FromItem SrcSpan
-- | Items imported using the 'from ... import' construct.
data FromItems annot
-- | Import everything exported from the module.
ImportEverything :: annot -> FromItems annot
[from_items_annot] :: FromItems annot -> annot
-- | Import a specific list of items from the module.
FromItems :: [FromItem annot] -> annot -> FromItems annot
[from_items_items] :: FromItems annot -> [FromItem annot]
[from_items_annot] :: FromItems annot -> annot
type FromItemsSpan = FromItems SrcSpan
-- | A reference to the module to import from using the 'from ... import'
-- construct.
data ImportRelative annot
ImportRelative :: Int -> Maybe (DottedName annot) -> annot -> ImportRelative annot
[import_relative_dots] :: ImportRelative annot -> Int
[import_relative_module] :: ImportRelative annot -> Maybe (DottedName annot)
[import_relative_annot] :: ImportRelative annot -> annot
type ImportRelativeSpan = ImportRelative SrcSpan
-- | Exception handler.
data Handler annot
Handler :: ExceptClause annot -> Suite annot -> annot -> Handler annot
[handler_clause] :: Handler annot -> ExceptClause annot
[handler_suite] :: Handler annot -> Suite annot
[handler_annot] :: Handler annot -> annot
type HandlerSpan = Handler SrcSpan
-- | Exception clause.
data ExceptClause annot
ExceptClause :: Maybe (Expr annot, Maybe (Expr annot)) -> annot -> ExceptClause annot
[except_clause] :: ExceptClause annot -> Maybe (Expr annot, Maybe (Expr annot))
[except_clause_annot] :: ExceptClause annot -> annot
type ExceptClauseSpan = ExceptClause SrcSpan
-- | The argument for a <tt>raise</tt> statement.
data RaiseExpr annot
-- | Optional expression to evaluate, and optional 'from' clause.
-- <i>Version 3 only</i>.
RaiseV3 :: (Maybe (Expr annot, Maybe (Expr annot))) -> RaiseExpr annot
-- | <i>Version 2 only</i>.
RaiseV2 :: (Maybe (Expr annot, Maybe (Expr annot, Maybe (Expr annot)))) -> RaiseExpr annot
type RaiseExprSpan = RaiseExpr SrcSpan
-- | Comprehension. In version 3.x this can be used for lists, sets,
-- dictionaries and generators. data Comprehension e annot
data Comprehension annot
Comprehension :: ComprehensionExpr annot -> CompFor annot -> annot -> Comprehension annot
[comprehension_expr] :: Comprehension annot -> ComprehensionExpr annot
[comprehension_for] :: Comprehension annot -> CompFor annot
[comprehension_annot] :: Comprehension annot -> annot
type ComprehensionSpan = Comprehension SrcSpan
data ComprehensionExpr annot
ComprehensionExpr :: (Expr annot) -> ComprehensionExpr annot
ComprehensionDict :: (DictMappingPair annot) -> ComprehensionExpr annot
type ComprehensionExprSpan = ComprehensionExpr SrcSpan
-- | Comprehension 'for' component.
data CompFor annot
CompFor :: [Expr annot] -> Expr annot -> Maybe (CompIter annot) -> annot -> CompFor annot
[comp_for_exprs] :: CompFor annot -> [Expr annot]
[comp_in_expr] :: CompFor annot -> Expr annot
[comp_for_iter] :: CompFor annot -> Maybe (CompIter annot)
[comp_for_annot] :: CompFor annot -> annot
type CompForSpan = CompFor SrcSpan
-- | Comprehension guard.
data CompIf annot
CompIf :: Expr annot -> Maybe (CompIter annot) -> annot -> CompIf annot
[comp_if] :: CompIf annot -> Expr annot
[comp_if_iter] :: CompIf annot -> Maybe (CompIter annot)
[comp_if_annot] :: CompIf annot -> annot
type CompIfSpan = CompIf SrcSpan
-- | Comprehension iterator (either a 'for' or an 'if').
data CompIter annot
IterFor :: CompFor annot -> annot -> CompIter annot
[comp_iter_for] :: CompIter annot -> CompFor annot
[comp_iter_annot] :: CompIter annot -> annot
IterIf :: CompIf annot -> annot -> CompIter annot
[comp_iter_if] :: CompIter annot -> CompIf annot
[comp_iter_annot] :: CompIter annot -> annot
type CompIterSpan = CompIter SrcSpan
instance GHC.Base.Functor Language.Python.Common.AST.Module
instance Data.Data.Data annot => Data.Data.Data (Language.Python.Common.AST.Module annot)
instance GHC.Show.Show annot => GHC.Show.Show (Language.Python.Common.AST.Module annot)
instance GHC.Classes.Ord annot => GHC.Classes.Ord (Language.Python.Common.AST.Module annot)
instance GHC.Classes.Eq annot => GHC.Classes.Eq (Language.Python.Common.AST.Module annot)
instance GHC.Base.Functor Language.Python.Common.AST.Handler
instance Data.Data.Data annot => Data.Data.Data (Language.Python.Common.AST.Handler annot)
instance GHC.Show.Show annot => GHC.Show.Show (Language.Python.Common.AST.Handler annot)
instance GHC.Classes.Ord annot => GHC.Classes.Ord (Language.Python.Common.AST.Handler annot)
instance GHC.Classes.Eq annot => GHC.Classes.Eq (Language.Python.Common.AST.Handler annot)
instance GHC.Base.Functor Language.Python.Common.AST.Statement
instance Data.Data.Data annot => Data.Data.Data (Language.Python.Common.AST.Statement annot)
instance GHC.Show.Show annot => GHC.Show.Show (Language.Python.Common.AST.Statement annot)
instance GHC.Classes.Ord annot => GHC.Classes.Ord (Language.Python.Common.AST.Statement annot)
instance GHC.Classes.Eq annot => GHC.Classes.Eq (Language.Python.Common.AST.Statement annot)
instance GHC.Base.Functor Language.Python.Common.AST.AssignOp
instance Data.Data.Data annot => Data.Data.Data (Language.Python.Common.AST.AssignOp annot)
instance GHC.Show.Show annot => GHC.Show.Show (Language.Python.Common.AST.AssignOp annot)
instance GHC.Classes.Ord annot => GHC.Classes.Ord (Language.Python.Common.AST.AssignOp annot)
instance GHC.Classes.Eq annot => GHC.Classes.Eq (Language.Python.Common.AST.AssignOp annot)
instance GHC.Base.Functor Language.Python.Common.AST.RaiseExpr
instance Data.Data.Data annot => Data.Data.Data (Language.Python.Common.AST.RaiseExpr annot)
instance GHC.Show.Show annot => GHC.Show.Show (Language.Python.Common.AST.RaiseExpr annot)
instance GHC.Classes.Ord annot => GHC.Classes.Ord (Language.Python.Common.AST.RaiseExpr annot)
instance GHC.Classes.Eq annot => GHC.Classes.Eq (Language.Python.Common.AST.RaiseExpr annot)
instance GHC.Base.Functor Language.Python.Common.AST.Decorator
instance Data.Data.Data annot => Data.Data.Data (Language.Python.Common.AST.Decorator annot)
instance GHC.Show.Show annot => GHC.Show.Show (Language.Python.Common.AST.Decorator annot)
instance GHC.Classes.Ord annot => GHC.Classes.Ord (Language.Python.Common.AST.Decorator annot)
instance GHC.Classes.Eq annot => GHC.Classes.Eq (Language.Python.Common.AST.Decorator annot)
instance GHC.Base.Functor Language.Python.Common.AST.ExceptClause
instance Data.Data.Data annot => Data.Data.Data (Language.Python.Common.AST.ExceptClause annot)
instance GHC.Show.Show annot => GHC.Show.Show (Language.Python.Common.AST.ExceptClause annot)
instance GHC.Classes.Ord annot => GHC.Classes.Ord (Language.Python.Common.AST.ExceptClause annot)
instance GHC.Classes.Eq annot => GHC.Classes.Eq (Language.Python.Common.AST.ExceptClause annot)
instance GHC.Base.Functor Language.Python.Common.AST.Parameter
instance Data.Data.Data annot => Data.Data.Data (Language.Python.Common.AST.Parameter annot)
instance GHC.Show.Show annot => GHC.Show.Show (Language.Python.Common.AST.Parameter annot)
instance GHC.Classes.Ord annot => GHC.Classes.Ord (Language.Python.Common.AST.Parameter annot)
instance GHC.Classes.Eq annot => GHC.Classes.Eq (Language.Python.Common.AST.Parameter annot)
instance GHC.Base.Functor Language.Python.Common.AST.Argument
instance Data.Data.Data annot => Data.Data.Data (Language.Python.Common.AST.Argument annot)
instance GHC.Show.Show annot => GHC.Show.Show (Language.Python.Common.AST.Argument annot)
instance GHC.Classes.Ord annot => GHC.Classes.Ord (Language.Python.Common.AST.Argument annot)
instance GHC.Classes.Eq annot => GHC.Classes.Eq (Language.Python.Common.AST.Argument annot)
instance GHC.Base.Functor Language.Python.Common.AST.ComprehensionExpr
instance Data.Data.Data annot => Data.Data.Data (Language.Python.Common.AST.ComprehensionExpr annot)
instance GHC.Show.Show annot => GHC.Show.Show (Language.Python.Common.AST.ComprehensionExpr annot)
instance GHC.Classes.Ord annot => GHC.Classes.Ord (Language.Python.Common.AST.ComprehensionExpr annot)
instance GHC.Classes.Eq annot => GHC.Classes.Eq (Language.Python.Common.AST.ComprehensionExpr annot)
instance GHC.Base.Functor Language.Python.Common.AST.CompIf
instance Data.Data.Data annot => Data.Data.Data (Language.Python.Common.AST.CompIf annot)
instance GHC.Show.Show annot => GHC.Show.Show (Language.Python.Common.AST.CompIf annot)
instance GHC.Classes.Ord annot => GHC.Classes.Ord (Language.Python.Common.AST.CompIf annot)
instance GHC.Classes.Eq annot => GHC.Classes.Eq (Language.Python.Common.AST.CompIf annot)
instance GHC.Base.Functor Language.Python.Common.AST.CompIter
instance Data.Data.Data annot => Data.Data.Data (Language.Python.Common.AST.CompIter annot)
instance GHC.Show.Show annot => GHC.Show.Show (Language.Python.Common.AST.CompIter annot)
instance GHC.Classes.Ord annot => GHC.Classes.Ord (Language.Python.Common.AST.CompIter annot)
instance GHC.Classes.Eq annot => GHC.Classes.Eq (Language.Python.Common.AST.CompIter annot)
instance GHC.Base.Functor Language.Python.Common.AST.CompFor
instance Data.Data.Data annot => Data.Data.Data (Language.Python.Common.AST.CompFor annot)
instance GHC.Show.Show annot => GHC.Show.Show (Language.Python.Common.AST.CompFor annot)
instance GHC.Classes.Ord annot => GHC.Classes.Ord (Language.Python.Common.AST.CompFor annot)
instance GHC.Classes.Eq annot => GHC.Classes.Eq (Language.Python.Common.AST.CompFor annot)
instance GHC.Base.Functor Language.Python.Common.AST.Comprehension
instance Data.Data.Data annot => Data.Data.Data (Language.Python.Common.AST.Comprehension annot)
instance GHC.Show.Show annot => GHC.Show.Show (Language.Python.Common.AST.Comprehension annot)
instance GHC.Classes.Ord annot => GHC.Classes.Ord (Language.Python.Common.AST.Comprehension annot)
instance GHC.Classes.Eq annot => GHC.Classes.Eq (Language.Python.Common.AST.Comprehension annot)
instance GHC.Base.Functor Language.Python.Common.AST.YieldArg
instance Data.Data.Data annot => Data.Data.Data (Language.Python.Common.AST.YieldArg annot)
instance GHC.Show.Show annot => GHC.Show.Show (Language.Python.Common.AST.YieldArg annot)
instance GHC.Classes.Ord annot => GHC.Classes.Ord (Language.Python.Common.AST.YieldArg annot)
instance GHC.Classes.Eq annot => GHC.Classes.Eq (Language.Python.Common.AST.YieldArg annot)
instance GHC.Base.Functor Language.Python.Common.AST.DictMappingPair
instance Data.Data.Data annot => Data.Data.Data (Language.Python.Common.AST.DictMappingPair annot)
instance GHC.Show.Show annot => GHC.Show.Show (Language.Python.Common.AST.DictMappingPair annot)
instance GHC.Classes.Ord annot => GHC.Classes.Ord (Language.Python.Common.AST.DictMappingPair annot)
instance GHC.Classes.Eq annot => GHC.Classes.Eq (Language.Python.Common.AST.DictMappingPair annot)
instance GHC.Base.Functor Language.Python.Common.AST.Slice
instance Data.Data.Data annot => Data.Data.Data (Language.Python.Common.AST.Slice annot)
instance GHC.Show.Show annot => GHC.Show.Show (Language.Python.Common.AST.Slice annot)
instance GHC.Classes.Ord annot => GHC.Classes.Ord (Language.Python.Common.AST.Slice annot)
instance GHC.Classes.Eq annot => GHC.Classes.Eq (Language.Python.Common.AST.Slice annot)
instance GHC.Base.Functor Language.Python.Common.AST.Expr
instance Data.Data.Data annot => Data.Data.Data (Language.Python.Common.AST.Expr annot)
instance GHC.Show.Show annot => GHC.Show.Show (Language.Python.Common.AST.Expr annot)
instance GHC.Classes.Ord annot => GHC.Classes.Ord (Language.Python.Common.AST.Expr annot)
instance GHC.Classes.Eq annot => GHC.Classes.Eq (Language.Python.Common.AST.Expr annot)
instance GHC.Base.Functor Language.Python.Common.AST.Op
instance Data.Data.Data annot => Data.Data.Data (Language.Python.Common.AST.Op annot)
instance GHC.Show.Show annot => GHC.Show.Show (Language.Python.Common.AST.Op annot)
instance GHC.Classes.Ord annot => GHC.Classes.Ord (Language.Python.Common.AST.Op annot)
instance GHC.Classes.Eq annot => GHC.Classes.Eq (Language.Python.Common.AST.Op annot)
instance GHC.Base.Functor Language.Python.Common.AST.ParamTuple
instance Data.Data.Data annot => Data.Data.Data (Language.Python.Common.AST.ParamTuple annot)
instance GHC.Show.Show annot => GHC.Show.Show (Language.Python.Common.AST.ParamTuple annot)
instance GHC.Classes.Ord annot => GHC.Classes.Ord (Language.Python.Common.AST.ParamTuple annot)
instance GHC.Classes.Eq annot => GHC.Classes.Eq (Language.Python.Common.AST.ParamTuple annot)
instance GHC.Base.Functor Language.Python.Common.AST.ImportRelative
instance Data.Data.Data annot => Data.Data.Data (Language.Python.Common.AST.ImportRelative annot)
instance GHC.Show.Show annot => GHC.Show.Show (Language.Python.Common.AST.ImportRelative annot)
instance GHC.Classes.Ord annot => GHC.Classes.Ord (Language.Python.Common.AST.ImportRelative annot)
instance GHC.Classes.Eq annot => GHC.Classes.Eq (Language.Python.Common.AST.ImportRelative annot)
instance GHC.Base.Functor Language.Python.Common.AST.FromItems
instance Data.Data.Data annot => Data.Data.Data (Language.Python.Common.AST.FromItems annot)
instance GHC.Show.Show annot => GHC.Show.Show (Language.Python.Common.AST.FromItems annot)
instance GHC.Classes.Ord annot => GHC.Classes.Ord (Language.Python.Common.AST.FromItems annot)
instance GHC.Classes.Eq annot => GHC.Classes.Eq (Language.Python.Common.AST.FromItems annot)
instance GHC.Base.Functor Language.Python.Common.AST.FromItem
instance Data.Data.Data annot => Data.Data.Data (Language.Python.Common.AST.FromItem annot)
instance GHC.Show.Show annot => GHC.Show.Show (Language.Python.Common.AST.FromItem annot)
instance GHC.Classes.Ord annot => GHC.Classes.Ord (Language.Python.Common.AST.FromItem annot)
instance GHC.Classes.Eq annot => GHC.Classes.Eq (Language.Python.Common.AST.FromItem annot)
instance GHC.Base.Functor Language.Python.Common.AST.ImportItem
instance Data.Data.Data annot => Data.Data.Data (Language.Python.Common.AST.ImportItem annot)
instance GHC.Show.Show annot => GHC.Show.Show (Language.Python.Common.AST.ImportItem annot)
instance GHC.Classes.Ord annot => GHC.Classes.Ord (Language.Python.Common.AST.ImportItem annot)
instance GHC.Classes.Eq annot => GHC.Classes.Eq (Language.Python.Common.AST.ImportItem annot)
instance GHC.Base.Functor Language.Python.Common.AST.Ident
instance Data.Data.Data annot => Data.Data.Data (Language.Python.Common.AST.Ident annot)
instance GHC.Show.Show annot => GHC.Show.Show (Language.Python.Common.AST.Ident annot)
instance GHC.Classes.Ord annot => GHC.Classes.Ord (Language.Python.Common.AST.Ident annot)
instance GHC.Classes.Eq annot => GHC.Classes.Eq (Language.Python.Common.AST.Ident annot)
instance Language.Python.Common.SrcLocation.Span Language.Python.Common.AST.IdentSpan
instance Language.Python.Common.AST.Annotated Language.Python.Common.AST.Ident
instance Language.Python.Common.SrcLocation.Span Language.Python.Common.AST.ImportItemSpan
instance Language.Python.Common.AST.Annotated Language.Python.Common.AST.ImportItem
instance Language.Python.Common.SrcLocation.Span Language.Python.Common.AST.FromItemSpan
instance Language.Python.Common.AST.Annotated Language.Python.Common.AST.FromItem
instance Language.Python.Common.SrcLocation.Span Language.Python.Common.AST.FromItemsSpan
instance Language.Python.Common.AST.Annotated Language.Python.Common.AST.FromItems
instance Language.Python.Common.SrcLocation.Span Language.Python.Common.AST.ImportRelativeSpan
instance Language.Python.Common.AST.Annotated Language.Python.Common.AST.ImportRelative
instance Language.Python.Common.SrcLocation.Span Language.Python.Common.AST.StatementSpan
instance Language.Python.Common.AST.Annotated Language.Python.Common.AST.Statement
instance Language.Python.Common.SrcLocation.Span Language.Python.Common.AST.DecoratorSpan
instance Language.Python.Common.AST.Annotated Language.Python.Common.AST.Decorator
instance Language.Python.Common.SrcLocation.Span Language.Python.Common.AST.ParameterSpan
instance Language.Python.Common.AST.Annotated Language.Python.Common.AST.Parameter
instance Language.Python.Common.SrcLocation.Span Language.Python.Common.AST.ParamTupleSpan
instance Language.Python.Common.AST.Annotated Language.Python.Common.AST.ParamTuple
instance Language.Python.Common.SrcLocation.Span Language.Python.Common.AST.ArgumentSpan
instance Language.Python.Common.AST.Annotated Language.Python.Common.AST.Argument
instance Language.Python.Common.SrcLocation.Span Language.Python.Common.AST.HandlerSpan
instance Language.Python.Common.AST.Annotated Language.Python.Common.AST.Handler
instance Language.Python.Common.SrcLocation.Span Language.Python.Common.AST.ExceptClauseSpan
instance Language.Python.Common.AST.Annotated Language.Python.Common.AST.ExceptClause
instance Language.Python.Common.SrcLocation.Span Language.Python.Common.AST.ComprehensionSpan
instance Language.Python.Common.AST.Annotated Language.Python.Common.AST.Comprehension
instance Language.Python.Common.SrcLocation.Span Language.Python.Common.AST.ComprehensionExprSpan
instance Language.Python.Common.SrcLocation.Span Language.Python.Common.AST.CompForSpan
instance Language.Python.Common.AST.Annotated Language.Python.Common.AST.CompFor
instance Language.Python.Common.SrcLocation.Span Language.Python.Common.AST.CompIfSpan
instance Language.Python.Common.AST.Annotated Language.Python.Common.AST.CompIf
instance Language.Python.Common.SrcLocation.Span Language.Python.Common.AST.CompIterSpan
instance Language.Python.Common.AST.Annotated Language.Python.Common.AST.CompIter
instance Language.Python.Common.SrcLocation.Span Language.Python.Common.AST.ExprSpan
instance Language.Python.Common.SrcLocation.Span Language.Python.Common.AST.YieldArgSpan
instance Language.Python.Common.AST.Annotated Language.Python.Common.AST.Expr
instance Language.Python.Common.SrcLocation.Span Language.Python.Common.AST.DictMappingPairSpan
instance Language.Python.Common.SrcLocation.Span Language.Python.Common.AST.SliceSpan
instance Language.Python.Common.AST.Annotated Language.Python.Common.AST.Slice
instance Language.Python.Common.SrcLocation.Span Language.Python.Common.AST.OpSpan
instance Language.Python.Common.AST.Annotated Language.Python.Common.AST.Op
instance Language.Python.Common.SrcLocation.Span Language.Python.Common.AST.AssignOpSpan
instance Language.Python.Common.AST.Annotated Language.Python.Common.AST.AssignOp
-- | Pretty printing of the Python abstract syntax (version 2.x and 3.x).
module Language.Python.Common.PrettyAST
instance Language.Python.Common.Pretty.Pretty (Language.Python.Common.AST.Module a)
instance Language.Python.Common.Pretty.Pretty (Language.Python.Common.AST.Ident a)
instance Language.Python.Common.Pretty.Pretty (Language.Python.Common.AST.ImportItem a)
instance Language.Python.Common.Pretty.Pretty (Language.Python.Common.AST.FromItem a)
instance Language.Python.Common.Pretty.Pretty (Language.Python.Common.AST.FromItems a)
instance Language.Python.Common.Pretty.Pretty (Language.Python.Common.AST.ImportRelative a)
instance Language.Python.Common.Pretty.Pretty (Language.Python.Common.AST.Statement a)
instance Language.Python.Common.Pretty.Pretty (Language.Python.Common.AST.Handler a)
instance Language.Python.Common.Pretty.Pretty (Language.Python.Common.AST.ExceptClause a)
instance Language.Python.Common.Pretty.Pretty (Language.Python.Common.AST.RaiseExpr a)
instance Language.Python.Common.Pretty.Pretty (Language.Python.Common.AST.Decorator a)
instance Language.Python.Common.Pretty.Pretty (Language.Python.Common.AST.Parameter a)
instance Language.Python.Common.Pretty.Pretty (Language.Python.Common.AST.ParamTuple a)
instance Language.Python.Common.Pretty.Pretty (Language.Python.Common.AST.Argument a)
instance Language.Python.Common.Pretty.Pretty (Language.Python.Common.AST.Comprehension a)
instance Language.Python.Common.Pretty.Pretty (Language.Python.Common.AST.ComprehensionExpr a)
instance Language.Python.Common.Pretty.Pretty (Language.Python.Common.AST.CompFor a)
instance Language.Python.Common.Pretty.Pretty (Language.Python.Common.AST.CompIf a)
instance Language.Python.Common.Pretty.Pretty (Language.Python.Common.AST.CompIter a)
instance Language.Python.Common.Pretty.Pretty (Language.Python.Common.AST.Expr a)
instance Language.Python.Common.Pretty.Pretty (Language.Python.Common.AST.YieldArg a)
instance Language.Python.Common.Pretty.Pretty (Language.Python.Common.AST.DictMappingPair a)
instance Language.Python.Common.Pretty.Pretty (Language.Python.Common.AST.Slice a)
instance Language.Python.Common.Pretty.Pretty (Language.Python.Common.AST.Op a)
instance Language.Python.Common.Pretty.Pretty (Language.Python.Common.AST.AssignOp a)
-- | Pretty printing of tokens. Note the output is intended for displaying
-- in messages to the user, and may not be valid Python syntax. For
-- instance the pretty printing is useful for displaying parser error
-- messages, but not useful for producing concrete Python source.
module Language.Python.Common.PrettyToken
instance Language.Python.Common.Pretty.Pretty Language.Python.Common.Token.Token
-- | Error values for the lexer and parser.
module Language.Python.Common.ParseError
data ParseError
-- | An error from the parser. Token found where it should not be. Note:
-- tokens contain their own source span.
UnexpectedToken :: Token -> ParseError
-- | An error from the lexer. Character found where it should not be.
UnexpectedChar :: Char -> SrcLocation -> ParseError
-- | A generic error containing a string message. No source location.
StrError :: String -> ParseError
instance GHC.Show.Show Language.Python.Common.ParseError.ParseError
instance GHC.Classes.Ord Language.Python.Common.ParseError.ParseError
instance GHC.Classes.Eq Language.Python.Common.ParseError.ParseError
instance Control.Monad.Trans.Error.Error Language.Python.Common.ParseError.ParseError
-- | Pretty printing of parse errors.
module Language.Python.Common.PrettyParseError
instance Language.Python.Common.Pretty.Pretty Language.Python.Common.ParseError.ParseError
-- | Monad support for Python parser and lexer.
module Language.Python.Common.ParserMonad
type P a = StateT ParseState (Either ParseError) a
execParser :: P a -> ParseState -> Either ParseError a
execParserKeepComments :: P a -> ParseState -> Either ParseError (a, [Token])
runParser :: P a -> ParseState -> Either ParseError (a, ParseState)
thenP :: P a -> (a -> P b) -> P b
returnP :: a -> P a
setLocation :: SrcLocation -> P ()
getLocation :: P SrcLocation
getInput :: P String
setInput :: String -> P ()
getLastToken :: P Token
setLastToken :: Token -> P ()
setLastEOL :: SrcSpan -> P ()
getLastEOL :: P SrcSpan
data ParseError
-- | An error from the parser. Token found where it should not be. Note:
-- tokens contain their own source span.
UnexpectedToken :: Token -> ParseError
-- | An error from the lexer. Character found where it should not be.
UnexpectedChar :: Char -> SrcLocation -> ParseError
-- | A generic error containing a string message. No source location.
StrError :: String -> ParseError
data ParseState
ParseState :: !SrcLocation -> !String -> !Token -> [Int] -> [Int] -> [Token] -> !SrcSpan -> [Token] -> ParseState
[location] :: ParseState -> !SrcLocation
[input] :: ParseState -> !String
[previousToken] :: ParseState -> !Token
[startCodeStack] :: ParseState -> [Int]
[indentStack] :: ParseState -> [Int]
[parenStack] :: ParseState -> [Token]
[lastEOL] :: ParseState -> !SrcSpan
[comments] :: ParseState -> [Token]
initialState :: SrcLocation -> String -> [Int] -> ParseState
pushStartCode :: Int -> P ()
popStartCode :: P ()
getStartCode :: P Int
getIndent :: P Int
pushIndent :: Int -> P ()
popIndent :: P ()
getIndentStackDepth :: P Int
getParen :: P (Maybe Token)
pushParen :: Token -> P ()
popParen :: P ()
getParenStackDepth :: P Int
addComment :: Token -> P ()
getComments :: P [Token]
spanError :: Span a => a -> String -> P b
instance GHC.Show.Show Language.Python.Common.ParserMonad.ParseState
-- | Lexical analysis for Python version 3.x programs. See:
-- <a>http://www.python.org/doc/3.1/reference/lexical_analysis.html</a>.
module Language.Python.Version3.Lexer
-- | Parse a string into a list of Python Tokens, or return an error.
lex :: String -> String -> Either ParseError [Token]
-- | Try to lex the first token in an input string. Return either a parse
-- error or a pair containing the next token and the rest of the input
-- after the token.
lexOneToken :: String -> String -> Either ParseError (Token, String)
-- | Lex a sequence of tokens.
lexer :: P [Token]
initLexState :: String -> String -> ParseState
-- | A parser for Python version 3.x programs. Parsers are provided for
-- modules, statements, and expressions. The parsers produce comment
-- tokens in addition to the abstract syntax tree.
--
-- See:
--
-- <ul>
-- <li><a>http://www.python.org/doc/3.1/reference/index.html</a> for an
-- overview of the language.</li>
-- <li><a>http://www.python.org/doc/3.1/reference/grammar.html</a> for
-- the full grammar.</li>
--
-- <li><a>http://www.python.org/doc/3.1/reference/toplevel_components.html</a>
-- for a description of the various Python top-levels, which correspond
-- to the parsers provided here.</li>
-- </ul>
module Language.Python.Version3.Parser
-- | Parse a whole Python source file. Return comments in addition to the
-- parsed module.
parseModule :: String -> String -> Either ParseError (ModuleSpan, [Token])
-- | Parse one compound statement, or a sequence of simple statements.
-- Generally used for interactive input, such as from the command line of
-- an interpreter. Return comments in addition to the parsed statements.
parseStmt :: String -> String -> Either ParseError ([StatementSpan], [Token])
-- | Parse an expression. Generally used as input for the 'eval' primitive.
-- Return comments in addition to the parsed expression.
parseExpr :: String -> String -> Either ParseError (ExprSpan, [Token])
-- | A convenient re-export of the parser and lexer for version 3.x of
-- Python.
--
-- See:
--
-- <ul>
-- <li><a>http://www.python.org/doc/3.1/reference/index.html</a> for an
-- overview of the language.</li>
-- <li><a>http://www.python.org/doc/3.1/reference/grammar.html</a> for
-- the full grammar.</li>
--
-- <li><a>http://www.python.org/doc/3.1/reference/toplevel_components.html</a>
-- for a description of the various Python top-levels, which correspond
-- to the parsers provided here.</li>
-- </ul>
module Language.Python.Version3
-- | Lexical analysis for Python version 2.x programs. See:
-- <a>http://www.python.org/doc/2.6/reference/lexical_analysis.html</a>.
module Language.Python.Version2.Lexer
-- | Parse a string into a list of Python Tokens, or return an error.
lex :: String -> String -> Either ParseError [Token]
-- | Try to lex the first token in an input string. Return either a parse
-- error or a pair containing the next token and the rest of the input
-- after the token.
lexOneToken :: String -> String -> Either ParseError (Token, String)
-- | A parser for Python version 2.x programs. Parsers are provided for
-- modules, statements, and expressions. The parsers produce comment
-- tokens in addition to the abstract syntax tree.
--
-- See:
--
-- <ul>
-- <li><a>http://www.python.org/doc/2.6/reference/index.html</a> for an
-- overview of the language.</li>
-- <li><a>http://www.python.org/doc/2.6/reference/grammar.html</a> for
-- the full grammar.</li>
--
-- <li><a>http://www.python.org/doc/2.6/reference/toplevel_components.html</a>
-- for a description of the various Python top-levels, which correspond
-- to the parsers provided here.</li>
-- </ul>
module Language.Python.Version2.Parser
-- | Parse a whole Python source file. Return comments in addition to the
-- parsed module.
parseModule :: String -> String -> Either ParseError (ModuleSpan, [Token])
-- | Parse one compound statement, or a sequence of simple statements.
-- Generally used for interactive input, such as from the command line of
-- an interpreter. Return comments in addition to the parsed statements.
parseStmt :: String -> String -> Either ParseError ([StatementSpan], [Token])
-- | Parse an expression. Generally used as input for the 'eval' primitive.
-- Return comments in addition to the parsed expression.
parseExpr :: String -> String -> Either ParseError (ExprSpan, [Token])
-- | A convenient re-export of the parser and lexer for version 2.x of
-- Python.
--
-- See:
--
-- <ul>
-- <li><a>http://www.python.org/doc/2.6/reference/index.html</a> for an
-- overview of the language.</li>
-- <li><a>http://www.python.org/doc/2.6/reference/grammar.html</a> for
-- the full grammar.</li>
--
-- <li><a>http://www.python.org/doc/2.6/reference/toplevel_components.html</a>
-- for a description of the various Python top-levels, which correspond
-- to the parsers provided here.</li>
-- </ul>
module Language.Python.Version2
-- | Convenient re-export of common code, which works with both version 2.x
-- and 3.x of Python.
module Language.Python.Common
|