1481 |
1485 |
1482 # the famous parentheses! |
1486 # the famous parentheses! |
1483 (r'(\(|\))', Punctuation), |
1487 (r'(\(|\))', Punctuation), |
1484 ], |
1488 ], |
1485 } |
1489 } |
|
1490 |
|
1491 |
|
1492 class FactorLexer(RegexLexer): |
|
1493 """ |
|
1494 Lexer for the `Factor <http://factorcode.org>`_ language. |
|
1495 |
|
1496 *New in Pygments 1.4.* |
|
1497 """ |
|
1498 name = 'Factor' |
|
1499 aliases = ['factor'] |
|
1500 filenames = ['*.factor'] |
|
1501 mimetypes = ['text/x-factor'] |
|
1502 |
|
1503 flags = re.MULTILINE | re.UNICODE |
|
1504 |
|
1505 builtin_kernel = ( |
|
1506 r'(?:or|2bi|2tri|while|wrapper|nip|4dip|wrapper\\?|bi\\*|' |
|
1507 r'callstack>array|both\\?|hashcode|die|dupd|callstack|' |
|
1508 r'callstack\\?|3dup|tri@|pick|curry|build|\\?execute|3bi|' |
|
1509 r'prepose|>boolean|\\?if|clone|eq\\?|tri\\*|\\?|=|swapd|' |
|
1510 r'2over|2keep|3keep|clear|2dup|when|not|tuple\\?|dup|2bi\\*|' |
|
1511 r'2tri\\*|call|tri-curry|object|bi@|do|unless\\*|if\\*|loop|' |
|
1512 r'bi-curry\\*|drop|when\\*|assert=|retainstack|assert\\?|-rot|' |
|
1513 r'execute|2bi@|2tri@|boa|with|either\\?|3drop|bi|curry\\?|' |
|
1514 r'datastack|until|3dip|over|3curry|tri-curry\\*|tri-curry@|swap|' |
|
1515 r'and|2nip|throw|bi-curry|\\(clone\\)|hashcode\\*|compose|2dip|if|3tri|' |
|
1516 r'unless|compose\\?|tuple|keep|2curry|equal\\?|assert|tri|2drop|' |
|
1517 r'most|<wrapper>|boolean\\?|identity-hashcode|identity-tuple\\?|' |
|
1518 r'null|new|dip|bi-curry@|rot|xor|identity-tuple|boolean)\s' |
|
1519 ) |
|
1520 |
|
1521 builtin_assocs = ( |
|
1522 r'(?:\\?at|assoc\\?|assoc-clone-like|assoc=|delete-at\\*|' |
|
1523 r'assoc-partition|extract-keys|new-assoc|value\\?|assoc-size|' |
|
1524 r'map>assoc|push-at|assoc-like|key\\?|assoc-intersect|' |
|
1525 r'assoc-refine|update|assoc-union|assoc-combine|at\\*|' |
|
1526 r'assoc-empty\\?|at\\+|set-at|assoc-all\\?|assoc-subset\\?|' |
|
1527 r'assoc-hashcode|change-at|assoc-each|assoc-diff|zip|values|' |
|
1528 r'value-at|rename-at|inc-at|enum\\?|at|cache|assoc>map|<enum>|' |
|
1529 r'assoc|assoc-map|enum|value-at\\*|assoc-map-as|>alist|' |
|
1530 r'assoc-filter-as|clear-assoc|assoc-stack|maybe-set-at|' |
|
1531 r'substitute|assoc-filter|2cache|delete-at|assoc-find|keys|' |
|
1532 r'assoc-any\\?|unzip)\s' |
|
1533 ) |
|
1534 |
|
1535 builtin_combinators = ( |
|
1536 r'(?:case|execute-effect|no-cond|no-case\\?|3cleave>quot|2cleave|' |
|
1537 r'cond>quot|wrong-values\\?|no-cond\\?|cleave>quot|no-case|' |
|
1538 r'case>quot|3cleave|wrong-values|to-fixed-point|alist>quot|' |
|
1539 r'case-find|cond|cleave|call-effect|2cleave>quot|recursive-hashcode|' |
|
1540 r'linear-case-quot|spread|spread>quot)\s' |
|
1541 ) |
|
1542 |
|
1543 builtin_math = ( |
|
1544 r'(?:number=|if-zero|next-power-of-2|each-integer|\\?1\\+|' |
|
1545 r'fp-special\\?|imaginary-part|unless-zero|float>bits|number\\?|' |
|
1546 r'fp-infinity\\?|bignum\\?|fp-snan\\?|denominator|fp-bitwise=|\\*|' |
|
1547 r'\\+|power-of-2\\?|-|u>=|/|>=|bitand|log2-expects-positive|<|' |
|
1548 r'log2|>|integer\\?|number|bits>double|2/|zero\\?|(find-integer)|' |
|
1549 r'bits>float|float\\?|shift|ratio\\?|even\\?|ratio|fp-sign|bitnot|' |
|
1550 r'>fixnum|complex\\?|/i|/f|byte-array>bignum|when-zero|sgn|>bignum|' |
|
1551 r'next-float|u<|u>|mod|recip|rational|find-last-integer|>float|' |
|
1552 r'(all-integers\\?)|2^|times|integer|fixnum\\?|neg|fixnum|sq|' |
|
1553 r'bignum|(each-integer)|bit\\?|fp-qnan\\?|find-integer|complex|' |
|
1554 r'<fp-nan>|real|double>bits|bitor|rem|fp-nan-payload|all-integers\\?|' |
|
1555 r'real-part|log2-expects-positive\\?|prev-float|align|unordered\\?|' |
|
1556 r'float|fp-nan\\?|abs|bitxor|u<=|odd\\?|<=|/mod|rational\\?|>integer|' |
|
1557 r'real\\?|numerator)\s' |
|
1558 ) |
|
1559 |
|
1560 builtin_sequences = ( |
|
1561 r'(?:member-eq\\?|append|assert-sequence=|find-last-from|trim-head-slice|' |
|
1562 r'clone-like|3sequence|assert-sequence\\?|map-as|last-index-from|' |
|
1563 r'reversed|index-from|cut\\*|pad-tail|remove-eq!|concat-as|' |
|
1564 r'but-last|snip|trim-tail|nths|nth|2selector|sequence|slice\\?|' |
|
1565 r'<slice>|partition|remove-nth|tail-slice|empty\\?|tail\\*|' |
|
1566 r'if-empty|find-from|virtual-sequence\\?|member\\?|set-length|' |
|
1567 r'drop-prefix|unclip|unclip-last-slice|iota|map-sum|' |
|
1568 r'bounds-error\\?|sequence-hashcode-step|selector-for|' |
|
1569 r'accumulate-as|map|start|midpoint@|\\(accumulate\\)|rest-slice|' |
|
1570 r'prepend|fourth|sift|accumulate!|new-sequence|follow|map!|' |
|
1571 r'like|first4|1sequence|reverse|slice|unless-empty|padding|' |
|
1572 r'virtual@|repetition\\?|set-last|index|4sequence|max-length|' |
|
1573 r'set-second|immutable-sequence|first2|first3|replicate-as|' |
|
1574 r'reduce-index|unclip-slice|supremum|suffix!|insert-nth|' |
|
1575 r'trim-tail-slice|tail|3append|short|count|suffix|concat|' |
|
1576 r'flip|filter|sum|immutable\\?|reverse!|2sequence|map-integers|' |
|
1577 r'delete-all|start\\*|indices|snip-slice|check-slice|sequence\\?|' |
|
1578 r'head|map-find|filter!|append-as|reduce|sequence=|halves|' |
|
1579 r'collapse-slice|interleave|2map|filter-as|binary-reduce|' |
|
1580 r'slice-error\\?|product|bounds-check\\?|bounds-check|harvest|' |
|
1581 r'immutable|virtual-exemplar|find|produce|remove|pad-head|last|' |
|
1582 r'replicate|set-fourth|remove-eq|shorten|reversed\\?|' |
|
1583 r'map-find-last|3map-as|2unclip-slice|shorter\\?|3map|find-last|' |
|
1584 r'head-slice|pop\\*|2map-as|tail-slice\\*|but-last-slice|' |
|
1585 r'2map-reduce|iota\\?|collector-for|accumulate|each|selector|' |
|
1586 r'append!|new-resizable|cut-slice|each-index|head-slice\\*|' |
|
1587 r'2reverse-each|sequence-hashcode|pop|set-nth|\\?nth|' |
|
1588 r'<flat-slice>|second|join|when-empty|collector|' |
|
1589 r'immutable-sequence\\?|<reversed>|all\\?|3append-as|' |
|
1590 r'virtual-sequence|subseq\\?|remove-nth!|push-either|new-like|' |
|
1591 r'length|last-index|push-if|2all\\?|lengthen|assert-sequence|' |
|
1592 r'copy|map-reduce|move|third|first|3each|tail\\?|set-first|' |
|
1593 r'prefix|bounds-error|any\\?|<repetition>|trim-slice|exchange|' |
|
1594 r'surround|2reduce|cut|change-nth|min-length|set-third|produce-as|' |
|
1595 r'push-all|head\\?|delete-slice|rest|sum-lengths|2each|head\\*|' |
|
1596 r'infimum|remove!|glue|slice-error|subseq|trim|replace-slice|' |
|
1597 r'push|repetition|map-index|trim-head|unclip-last|mismatch)\s' |
|
1598 ) |
|
1599 |
|
1600 builtin_namespaces = ( |
|
1601 r'(?:global|\\+@|change|set-namestack|change-global|init-namespaces|' |
|
1602 r'on|off|set-global|namespace|set|with-scope|bind|with-variable|' |
|
1603 r'inc|dec|counter|initialize|namestack|get|get-global|make-assoc)\s' |
|
1604 ) |
|
1605 |
|
1606 builtin_arrays = ( |
|
1607 r'(?:<array>|2array|3array|pair|>array|1array|4array|pair\\?|' |
|
1608 r'array|resize-array|array\\?)\s' |
|
1609 ) |
|
1610 |
|
1611 builtin_io = ( |
|
1612 r'(?:\\+character\\+|bad-seek-type\\?|readln|each-morsel|stream-seek|' |
|
1613 r'read|print|with-output-stream|contents|write1|stream-write1|' |
|
1614 r'stream-copy|stream-element-type|with-input-stream|' |
|
1615 r'stream-print|stream-read|stream-contents|stream-tell|' |
|
1616 r'tell-output|bl|seek-output|bad-seek-type|nl|stream-nl|write|' |
|
1617 r'flush|stream-lines|\\+byte\\+|stream-flush|read1|' |
|
1618 r'seek-absolute\\?|stream-read1|lines|stream-readln|' |
|
1619 r'stream-read-until|each-line|seek-end|with-output-stream\\*|' |
|
1620 r'seek-absolute|with-streams|seek-input|seek-relative\\?|' |
|
1621 r'input-stream|stream-write|read-partial|seek-end\\?|' |
|
1622 r'seek-relative|error-stream|read-until|with-input-stream\\*|' |
|
1623 r'with-streams\\*|tell-input|each-block|output-stream|' |
|
1624 r'stream-read-partial|each-stream-block|each-stream-line)\s' |
|
1625 ) |
|
1626 |
|
1627 builtin_strings = ( |
|
1628 r'(?:resize-string|>string|<string>|1string|string|string\\?)\s' |
|
1629 ) |
|
1630 |
|
1631 builtin_vectors = ( |
|
1632 r'(?:vector\\?|<vector>|\\?push|vector|>vector|1vector)\s' |
|
1633 ) |
|
1634 |
|
1635 builtin_continuations = ( |
|
1636 r'(?:with-return|restarts|return-continuation|with-datastack|' |
|
1637 r'recover|rethrow-restarts|<restart>|ifcc|set-catchstack|' |
|
1638 r'>continuation<|cleanup|ignore-errors|restart\\?|' |
|
1639 r'compute-restarts|attempt-all-error|error-thread|continue|' |
|
1640 r'<continuation>|attempt-all-error\\?|condition\\?|' |
|
1641 r'<condition>|throw-restarts|error|catchstack|continue-with|' |
|
1642 r'thread-error-hook|continuation|rethrow|callcc1|' |
|
1643 r'error-continuation|callcc0|attempt-all|condition|' |
|
1644 r'continuation\\?|restart|return)\s' |
|
1645 ) |
|
1646 |
|
1647 tokens = { |
|
1648 'root': [ |
|
1649 # TODO: (( inputs -- outputs )) |
|
1650 # TODO: << ... >> |
|
1651 |
|
1652 # defining words |
|
1653 (r'(\s*)(:|::|MACRO:|MEMO:)(\s+)(\S+)', |
|
1654 bygroups(Text, Keyword, Text, Name.Function)), |
|
1655 (r'(\s*)(M:)(\s+)(\S+)(\s+)(\S+)', |
|
1656 bygroups(Text, Keyword, Text, Name.Class, Text, Name.Function)), |
|
1657 (r'(\s*)(GENERIC:)(\s+)(\S+)', |
|
1658 bygroups(Text, Keyword, Text, Name.Function)), |
|
1659 (r'(\s*)(HOOK:|GENERIC#)(\s+)(\S+)(\s+)(\S+)', |
|
1660 bygroups(Text, Keyword, Text, Name.Function, Text, Name.Function)), |
|
1661 (r'(\()(\s+)', bygroups(Name.Function, Text), 'stackeffect'), |
|
1662 (r'\;\s', Keyword), |
|
1663 |
|
1664 # imports and namespaces |
|
1665 (r'(USING:)((?:\s|\\\s)+)', bygroups(Keyword.Namespace, Text), 'import'), |
|
1666 (r'(USE:)(\s+)(\S+)', bygroups(Keyword.Namespace, Text, Name.Namespace)), |
|
1667 (r'(UNUSE:)(\s+)(\S+)', bygroups(Keyword.Namespace, Text, Name.Namespace)), |
|
1668 (r'(QUALIFIED:)(\s+)(\S+)', |
|
1669 bygroups(Keyword.Namespace, Text, Name.Namespace)), |
|
1670 (r'(QUALIFIED-WITH:)(\s+)(\S+)', |
|
1671 bygroups(Keyword.Namespace, Text, Name.Namespace)), |
|
1672 (r'(FROM:|EXCLUDE:)(\s+)(\S+)(\s+)(=>)', |
|
1673 bygroups(Keyword.Namespace, Text, Name.Namespace, Text, Text)), |
|
1674 (r'(IN:)(\s+)(\S+)', bygroups(Keyword.Namespace, Text, Name.Namespace)), |
|
1675 (r'(?:ALIAS|DEFER|FORGET|POSTPONE):', Keyword.Namespace), |
|
1676 |
|
1677 # tuples and classes |
|
1678 (r'(TUPLE:)(\s+)(\S+)(\s+<\s+)(\S+)', |
|
1679 bygroups(Keyword, Text, Name.Class, Text, Name.Class), 'slots'), |
|
1680 (r'(TUPLE:)(\s+)(\S+)', bygroups(Keyword, Text, Name.Class), 'slots'), |
|
1681 (r'(UNION:)(\s+)(\S+)', bygroups(Keyword, Text, Name.Class)), |
|
1682 (r'(INTERSECTION:)(\s+)(\S+)', bygroups(Keyword, Text, Name.Class)), |
|
1683 (r'(PREDICATE:)(\s+)(\S+)(\s+<\s+)(\S+)', |
|
1684 bygroups(Keyword, Text, Name.Class, Text, Name.Class)), |
|
1685 (r'(C:)(\s+)(\S+)(\s+)(\S+)', |
|
1686 bygroups(Keyword, Text, Name.Function, Text, Name.Class)), |
|
1687 (r'INSTANCE:', Keyword), |
|
1688 (r'SLOT:', Keyword), |
|
1689 (r'MIXIN:', Keyword), |
|
1690 (r'(?:SINGLETON|SINGLETONS):', Keyword), |
|
1691 |
|
1692 # other syntax |
|
1693 (r'CONSTANT:', Keyword), |
|
1694 (r'(?:SYMBOL|SYMBOLS):', Keyword), |
|
1695 (r'ERROR:', Keyword), |
|
1696 (r'SYNTAX:', Keyword), |
|
1697 (r'(HELP:)(\s+)(\S+)', bygroups(Keyword, Text, Name.Function)), |
|
1698 (r'(MAIN:)(\s+)(\S+)', bygroups(Keyword.Namespace, Text, Name.Function)), |
|
1699 (r'(?:ALIEN|TYPEDEF|FUNCTION|STRUCT):', Keyword), |
|
1700 |
|
1701 # vocab.private |
|
1702 # TODO: words inside vocab.private should have red names? |
|
1703 (r'(?:<PRIVATE|PRIVATE>)', Keyword.Namespace), |
|
1704 |
|
1705 # strings |
|
1706 (r'"""\s+(?:.|\n)*?\s+"""', String), |
|
1707 (r'"(?:\\\\|\\"|[^"])*"', String), |
|
1708 (r'CHAR:\s+(\\[\\abfnrstv]*|\S)\s', String.Char), |
|
1709 |
|
1710 # comments |
|
1711 (r'\!\s+.*$', Comment), |
|
1712 (r'#\!\s+.*$', Comment), |
|
1713 |
|
1714 # boolean constants |
|
1715 (r'(t|f)\s', Name.Constant), |
|
1716 |
|
1717 # numbers |
|
1718 (r'-?\d+\.\d+\s', Number.Float), |
|
1719 (r'-?\d+\s', Number.Integer), |
|
1720 (r'HEX:\s+[a-fA-F\d]+\s', Number.Hex), |
|
1721 (r'BIN:\s+[01]+\s', Number.Integer), |
|
1722 (r'OCT:\s+[0-7]+\s', Number.Oct), |
|
1723 |
|
1724 # operators |
|
1725 (r'[-+/*=<>^]\s', Operator), |
|
1726 |
|
1727 # keywords |
|
1728 (r'(?:deprecated|final|foldable|flushable|inline|recursive)\s', Keyword), |
|
1729 |
|
1730 # builtins |
|
1731 (builtin_kernel, Name.Builtin), |
|
1732 (builtin_assocs, Name.Builtin), |
|
1733 (builtin_combinators, Name.Builtin), |
|
1734 (builtin_math, Name.Builtin), |
|
1735 (builtin_sequences, Name.Builtin), |
|
1736 (builtin_namespaces, Name.Builtin), |
|
1737 (builtin_arrays, Name.Builtin), |
|
1738 (builtin_io, Name.Builtin), |
|
1739 (builtin_strings, Name.Builtin), |
|
1740 (builtin_vectors, Name.Builtin), |
|
1741 (builtin_continuations, Name.Builtin), |
|
1742 |
|
1743 # whitespaces - usually not relevant |
|
1744 (r'\s+', Text), |
|
1745 |
|
1746 # everything else is text |
|
1747 (r'\S+', Text), |
|
1748 ], |
|
1749 |
|
1750 'stackeffect': [ |
|
1751 (r'\s*\(', Name.Function, 'stackeffect'), |
|
1752 (r'\)', Name.Function, '#pop'), |
|
1753 (r'\-\-', Name.Function), |
|
1754 (r'\s+', Text), |
|
1755 (r'\S+', Name.Variable), |
|
1756 ], |
|
1757 |
|
1758 'slots': [ |
|
1759 (r'\s+', Text), |
|
1760 (r';\s', Keyword, '#pop'), |
|
1761 (r'\S+', Name.Variable), |
|
1762 ], |
|
1763 |
|
1764 'import': [ |
|
1765 (r';', Keyword, '#pop'), |
|
1766 (r'\S+', Name.Namespace), |
|
1767 (r'\s+', Text), |
|
1768 ], |
|
1769 } |
|
1770 |
|
1771 |
|
1772 class IokeLexer(RegexLexer): |
|
1773 """ |
|
1774 For `Ioke <http://ioke.org/>`_ (a strongly typed, dynamic, |
|
1775 prototype based programming language) source. |
|
1776 |
|
1777 *New in Pygments 1.4.* |
|
1778 """ |
|
1779 name = 'Ioke' |
|
1780 filenames = ['*.ik'] |
|
1781 aliases = ['ioke', 'ik'] |
|
1782 mimetypes = ['text/x-iokesrc'] |
|
1783 tokens = { |
|
1784 'interpolatableText': [ |
|
1785 (r'(\\b|\\e|\\t|\\n|\\f|\\r|\\"|\\\\|\\#|\\\Z|\\u[0-9a-fA-F]{1,4}' |
|
1786 r'|\\[0-3]?[0-7]?[0-7])', String.Escape), |
|
1787 (r'#{', Punctuation, 'textInterpolationRoot') |
|
1788 ], |
|
1789 |
|
1790 'text': [ |
|
1791 (r'(?<!\\)"', String, '#pop'), |
|
1792 include('interpolatableText'), |
|
1793 (r'[^"]', String) |
|
1794 ], |
|
1795 |
|
1796 'documentation': [ |
|
1797 (r'(?<!\\)"', String.Doc, '#pop'), |
|
1798 include('interpolatableText'), |
|
1799 (r'[^"]', String.Doc) |
|
1800 ], |
|
1801 |
|
1802 'textInterpolationRoot': [ |
|
1803 (r'}', Punctuation, '#pop'), |
|
1804 include('root') |
|
1805 ], |
|
1806 |
|
1807 'slashRegexp': [ |
|
1808 (r'(?<!\\)/[oxpniums]*', String.Regex, '#pop'), |
|
1809 include('interpolatableText'), |
|
1810 (r'\\/', String.Regex), |
|
1811 (r'[^/]', String.Regex) |
|
1812 ], |
|
1813 |
|
1814 'squareRegexp': [ |
|
1815 (r'(?<!\\)][oxpniums]*', String.Regex, '#pop'), |
|
1816 include('interpolatableText'), |
|
1817 (r'\\]', String.Regex), |
|
1818 (r'[^\]]', String.Regex) |
|
1819 ], |
|
1820 |
|
1821 'squareText': [ |
|
1822 (r'(?<!\\)]', String, '#pop'), |
|
1823 include('interpolatableText'), |
|
1824 (r'[^\]]', String) |
|
1825 ], |
|
1826 |
|
1827 'root': [ |
|
1828 (r'\n', Text), |
|
1829 (r'\s+', Text), |
|
1830 |
|
1831 # Comments |
|
1832 (r';(.*?)\n', Comment), |
|
1833 (r'\A#!(.*?)\n', Comment), |
|
1834 |
|
1835 #Regexps |
|
1836 (r'#/', String.Regex, 'slashRegexp'), |
|
1837 (r'#r\[', String.Regex, 'squareRegexp'), |
|
1838 |
|
1839 #Symbols |
|
1840 (r':[a-zA-Z0-9_!:?]+', String.Symbol), |
|
1841 (r'[a-zA-Z0-9_!:?]+:(?![a-zA-Z0-9_!?])', String.Other), |
|
1842 (r':"(\\\\|\\"|[^"])*"', String.Symbol), |
|
1843 |
|
1844 #Documentation |
|
1845 (r'((?<=fn\()|(?<=fnx\()|(?<=method\()|(?<=macro\()|(?<=lecro\()' |
|
1846 r'|(?<=syntax\()|(?<=dmacro\()|(?<=dlecro\()|(?<=dlecrox\()' |
|
1847 r'|(?<=dsyntax\())[\s\n\r]*"', String.Doc, 'documentation'), |
|
1848 |
|
1849 #Text |
|
1850 (r'"', String, 'text'), |
|
1851 (r'#\[', String, 'squareText'), |
|
1852 |
|
1853 #Mimic |
|
1854 (r'[a-zA-Z0-9_][a-zA-Z0-9!?_:]+(?=\s*=.*mimic\s)', Name.Entity), |
|
1855 |
|
1856 #Assignment |
|
1857 (r'[a-zA-Z_][a-zA-Z0-9_!:?]*(?=[\s]*[+*/-]?=[^=].*($|\.))', Name.Variable), |
|
1858 |
|
1859 # keywords |
|
1860 (r'(break|cond|continue|do|ensure|for|for:dict|for:set|if|let|' |
|
1861 r'loop|p:for|p:for:dict|p:for:set|return|unless|until|while|' |
|
1862 r'with)(?![a-zA-Z0-9!:_?])', Keyword.Reserved), |
|
1863 |
|
1864 # Origin |
|
1865 (r'(eval|mimic|print|println)(?![a-zA-Z0-9!:_?])', Keyword), |
|
1866 |
|
1867 # Base |
|
1868 (r'(cell\?|cellNames|cellOwner\?|cellOwner|cells|cell|' |
|
1869 r'documentation|hash|identity|mimic|removeCell\!|undefineCell\!)' |
|
1870 r'(?![a-zA-Z0-9!:_?])', Keyword), |
|
1871 |
|
1872 # Ground |
|
1873 (r'(stackTraceAsText)(?![a-zA-Z0-9!:_?])', Keyword), |
|
1874 |
|
1875 #DefaultBehaviour Literals |
|
1876 (r'(dict|list|message|set)(?![a-zA-Z0-9!:_?])', Keyword.Reserved), |
|
1877 |
|
1878 #DefaultBehaviour Case |
|
1879 (r'(case|case:and|case:else|case:nand|case:nor|case:not|case:or|' |
|
1880 r'case:otherwise|case:xor)(?![a-zA-Z0-9!:_?])', Keyword.Reserved), |
|
1881 |
|
1882 #DefaultBehaviour Reflection |
|
1883 (r'(asText|become\!|derive|freeze\!|frozen\?|in\?|is\?|kind\?|' |
|
1884 r'mimic\!|mimics|mimics\?|prependMimic\!|removeAllMimics\!|' |
|
1885 r'removeMimic\!|same\?|send|thaw\!|uniqueHexId)' |
|
1886 r'(?![a-zA-Z0-9!:_?])', Keyword), |
|
1887 |
|
1888 #DefaultBehaviour Aspects |
|
1889 (r'(after|around|before)(?![a-zA-Z0-9!:_?])', Keyword.Reserved), |
|
1890 |
|
1891 # DefaultBehaviour |
|
1892 (r'(kind|cellDescriptionDict|cellSummary|genSym|inspect|notice)' |
|
1893 r'(?![a-zA-Z0-9!:_?])', Keyword), |
|
1894 (r'(use|destructuring)', Keyword.Reserved), |
|
1895 |
|
1896 #DefaultBehavior BaseBehavior |
|
1897 (r'(cell\?|cellOwner\?|cellOwner|cellNames|cells|cell|' |
|
1898 r'documentation|identity|removeCell!|undefineCell)' |
|
1899 r'(?![a-zA-Z0-9!:_?])', Keyword), |
|
1900 |
|
1901 #DefaultBehavior Internal |
|
1902 (r'(internal:compositeRegexp|internal:concatenateText|' |
|
1903 r'internal:createDecimal|internal:createNumber|' |
|
1904 r'internal:createRegexp|internal:createText)' |
|
1905 r'(?![a-zA-Z0-9!:_?])', Keyword.Reserved), |
|
1906 |
|
1907 #DefaultBehaviour Conditions |
|
1908 (r'(availableRestarts|bind|error\!|findRestart|handle|' |
|
1909 r'invokeRestart|rescue|restart|signal\!|warn\!)' |
|
1910 r'(?![a-zA-Z0-9!:_?])', Keyword.Reserved), |
|
1911 |
|
1912 # constants |
|
1913 (r'(nil|false|true)(?![a-zA-Z0-9!:_?])', Name.Constant), |
|
1914 |
|
1915 # names |
|
1916 (r'(Arity|Base|Call|Condition|DateTime|Aspects|Pointcut|' |
|
1917 r'Assignment|BaseBehavior|Boolean|Case|AndCombiner|Else|' |
|
1918 r'NAndCombiner|NOrCombiner|NotCombiner|OrCombiner|XOrCombiner|' |
|
1919 r'Conditions|Definitions|FlowControl|Internal|Literals|' |
|
1920 r'Reflection|DefaultMacro|DefaultMethod|DefaultSyntax|Dict|' |
|
1921 r'FileSystem|Ground|Handler|Hook|IO|IokeGround|Struct|' |
|
1922 r'LexicalBlock|LexicalMacro|List|Message|Method|Mixins|' |
|
1923 r'NativeMethod|Number|Origin|Pair|Range|Reflector|Regexp Match|' |
|
1924 r'Regexp|Rescue|Restart|Runtime|Sequence|Set|Symbol|' |
|
1925 r'System|Text|Tuple)(?![a-zA-Z0-9!:_?])', Name.Builtin), |
|
1926 |
|
1927 # functions |
|
1928 (r'(generateMatchMethod|aliasMethod|\u03bb|\u028E|fnx|fn|method|' |
|
1929 r'dmacro|dlecro|syntax|macro|dlecrox|lecrox|lecro|syntax)' |
|
1930 r'(?![a-zA-Z0-9!:_?])', Name.Function), |
|
1931 |
|
1932 # Numbers |
|
1933 (r'-?0[xX][0-9a-fA-F]+', Number.Hex), |
|
1934 (r'-?(\d+\.?\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float), |
|
1935 (r'-?\d+', Number.Integer), |
|
1936 |
|
1937 (r'#\(', Punctuation), |
|
1938 |
|
1939 # Operators |
|
1940 (r'(&&>>|\|\|>>|\*\*>>|:::|::|\.\.\.|===|\*\*>|\*\*=|&&>|&&=|' |
|
1941 r'\|\|>|\|\|=|\->>|\+>>|!>>|<>>>|<>>|&>>|%>>|#>>|@>>|/>>|\*>>|' |
|
1942 r'\?>>|\|>>|\^>>|~>>|\$>>|=>>|<<=|>>=|<=>|<\->|=~|!~|=>|\+\+|' |
|
1943 r'\-\-|<=|>=|==|!=|&&|\.\.|\+=|\-=|\*=|\/=|%=|&=|\^=|\|=|<\-|' |
|
1944 r'\+>|!>|<>|&>|%>|#>|\@>|\/>|\*>|\?>|\|>|\^>|~>|\$>|<\->|\->|' |
|
1945 r'<<|>>|\*\*|\?\||\?&|\|\||>|<|\*|\/|%|\+|\-|&|\^|\||=|\$|!|~|' |
|
1946 r'\?|#|\u2260|\u2218|\u2208|\u2209)', Operator), |
|
1947 (r'(and|nand|or|xor|nor|return|import)(?![a-zA-Z0-9_!?])', |
|
1948 Operator), |
|
1949 |
|
1950 # Punctuation |
|
1951 (r'(\`\`|\`|\'\'|\'|\.|\,|@|@@|\[|\]|\(|\)|{|})', Punctuation), |
|
1952 |
|
1953 #kinds |
|
1954 (r'[A-Z][a-zA-Z0-9_!:?]*', Name.Class), |
|
1955 |
|
1956 #default cellnames |
|
1957 (r'[a-z_][a-zA-Z0-9_!:?]*', Name) |
|
1958 ] |
|
1959 } |