3 pygments.lexers.textedit |
3 pygments.lexers.textedit |
4 ~~~~~~~~~~~~~~~~~~~~~~~~ |
4 ~~~~~~~~~~~~~~~~~~~~~~~~ |
5 |
5 |
6 Lexers for languages related to text processing. |
6 Lexers for languages related to text processing. |
7 |
7 |
8 :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. |
8 :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. |
9 :license: BSD, see LICENSE for details. |
9 :license: BSD, see LICENSE for details. |
10 """ |
10 """ |
11 |
11 |
12 import re |
12 import re |
13 from bisect import bisect |
13 from bisect import bisect |
100 |
100 |
101 (r'^\s*".*', Comment), |
101 (r'^\s*".*', Comment), |
102 |
102 |
103 (r'[ \t]+', Text), |
103 (r'[ \t]+', Text), |
104 # TODO: regexes can have other delims |
104 # TODO: regexes can have other delims |
105 (r'/(\\\\|\\/|[^\n/])*/', String.Regex), |
105 (r'/[^/\\\n]*(?:\\[\s\S][^/\\\n]*)*/', String.Regex), |
106 (r'"(\\\\|\\"|[^\n"])*"', String.Double), |
106 (r'"[^"\\\n]*(?:\\[\s\S][^"\\\n]*)*"', String.Double), |
107 (r"'(''|[^\n'])*'", String.Single), |
107 (r"'[^\n']*(?:''[^\n']*)*'", String.Single), |
108 |
108 |
109 # Who decided that doublequote was a good comment character?? |
109 # Who decided that doublequote was a good comment character?? |
110 (r'(?<=\s)"[^\-:.%#=*].*', Comment), |
110 (r'(?<=\s)"[^\-:.%#=*].*', Comment), |
111 (r'-?\d+', Number), |
111 (r'-?\d+', Number), |
112 (r'#[0-9a-f]{6}', Number.Hex), |
112 (r'#[0-9a-f]{6}', Number.Hex), |