|
1749 | 1749 | '''
|
1750 | 1750 | 'name': 'variable.css'
|
1751 | 1751 | }
|
| 1752 | + { |
| 1753 | + 'include': '#selector' |
| 1754 | + } |
1752 | 1755 | {
|
1753 | 1756 | 'begin': '(?<![-a-zA-Z])(?=[-a-zA-Z])'
|
1754 | 1757 | 'end': '$|(?![-a-zA-Z])'
|
|
1784 | 1787 | }
|
1785 | 1788 | ]
|
1786 | 1789 | 'selector':
|
1787 |
| - 'begin': '''(?x) |
| 1790 | + 'begin': '''(?xi) |
| 1791 | + # Match must be preceded by one of the following: |
| 1792 | + (?<= |
| 1793 | + ^ # Start of line |
| 1794 | + | (^|[^\\:])\\s # Whitespace, after the start of a line or any character except a colon (which denotes a property) |
| 1795 | + | ; # Semicolon (condensed property list syntax) |
| 1796 | + | [{}] # Opening or closing brace (condensed property list syntax) |
| 1797 | + | \\*/ # Comment end |
| 1798 | + | \\\\(?:[0-9a-fA-F]{1,6}|.) # Escape sequence |
| 1799 | + ) |
| 1800 | +
|
| 1801 | + # Match may contain any of the following: |
| 1802 | + (?= |
| 1803 | + (?: |
| 1804 | + # Match must start with one of the following: |
| 1805 | + & # Nesting selector |
| 1806 | + | \\* # Universal selector |
| 1807 | + | [>~+] # Selector combinator |
| 1808 | + | \\| # Selector namespace separator |
| 1809 | + | \\[ # Attribute selector opening bracket |
| 1810 | + | [a-zA-Z] # Letter |
| 1811 | + | [^\\x00-\\x7F] # Non-ASCII symbols |
| 1812 | + | \\\\(?:[0-9a-fA-F]{1,6}|.) # Escape sequence |
| 1813 | +
|
| 1814 | + # Or one of the following symbols, followed by a word character, hyphen, or escape sequence: |
| 1815 | + | (?: |
| 1816 | + \\. # Class selector |
| 1817 | + | \\# # ID selector |
| 1818 | + ) |
| 1819 | + (?: |
| 1820 | + [\\w-] # Word character or hyphen |
| 1821 | + | \\\\(?: # Escape sequence |
| 1822 | + [0-9a-fA-F]{1,6} |
| 1823 | + | . |
| 1824 | + ) |
| 1825 | + ) |
| 1826 | +
|
| 1827 | + # Or one of the following symbols, followed a letter or hyphen: |
| 1828 | + | (?: |
| 1829 | + \\: # Pseudo-class |
| 1830 | + | \\:\\: # Pseudo-element |
| 1831 | + ) |
| 1832 | + [a-zA-Z-] # Letter or hyphen |
| 1833 | + ) |
| 1834 | + ) |
| 1835 | +
|
| 1836 | + # Match must NOT contain any of the following: |
| 1837 | + (?! |
| 1838 | + [\\w-]*[\\:]+\\s # One or more colons immediately followed by a whitespace (denotes a property or invalid sequence) |
| 1839 | + | [^{]*; # Any characters and a semicolon before an opening bracket (denotes the end of a property) |
| 1840 | + | [^{]*} # A closing bracket before an opening bracket (denotes a property) |
| 1841 | + | [^\\:]+(\\:\\:):+ # More than two colons (invalid sequence) |
| 1842 | + ) |
| 1843 | + ''' |
| 1844 | + 'end': '''(?x) |
| 1845 | + # Match must end with: |
1788 | 1846 | (?=
|
1789 |
| - (?:\\|)? # Possible anonymous namespace prefix |
| 1847 | + \\s* # Optional whitespace and one of the following: |
1790 | 1848 | (?:
|
1791 |
| - [-\\[:.*&\\#a-zA-Z_] # Valid selector character |
1792 |
| - | |
1793 |
| - [^\\x00-\\x7F] # Which can include non-ASCII symbols |
1794 |
| - | |
1795 |
| - \\\\ # Or an escape sequence |
1796 |
| - (?:[0-9a-fA-F]{1,6}|.) |
| 1849 | + \\/ # Comment |
| 1850 | + | @ # At-rule |
| 1851 | + | { # Opening property list brace |
| 1852 | + | \\) # Closing function brace (for passing test on `some-edgy-new-function(`) |
| 1853 | + | $ # End of line |
1797 | 1854 | )
|
1798 | 1855 | )
|
1799 |
| - ''' |
1800 |
| - 'end': '(?=\\s*[/@{)])' |
| 1856 | + ''' |
1801 | 1857 | 'name': 'meta.selector.css'
|
1802 | 1858 | 'patterns': [
|
1803 | 1859 | {
|
|
0 commit comments