3 pygments.lexers.functional |
3 pygments.lexers.functional |
4 ~~~~~~~~~~~~~~~~~~~~~~~~~~ |
4 ~~~~~~~~~~~~~~~~~~~~~~~~~~ |
5 |
5 |
6 Lexers for functional languages. |
6 Lexers for functional languages. |
7 |
7 |
8 :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS. |
8 :copyright: Copyright 2006-2010 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 try: |
|
14 set |
|
15 except NameError: |
|
16 from sets import Set as set |
|
17 |
13 |
18 from pygments.lexer import Lexer, RegexLexer, bygroups, include, do_insertions |
14 from pygments.lexer import Lexer, RegexLexer, bygroups, include, do_insertions |
19 from pygments.token import Text, Comment, Operator, Keyword, Name, \ |
15 from pygments.token import Text, Comment, Operator, Keyword, Name, \ |
20 String, Number, Punctuation, Literal, Generic |
16 String, Number, Punctuation, Literal, Generic |
21 |
17 |
243 |
239 |
244 # encoding comment (?) |
240 # encoding comment (?) |
245 (r'#\d*Y.*$', Comment.Special), |
241 (r'#\d*Y.*$', Comment.Special), |
246 |
242 |
247 # strings and characters |
243 # strings and characters |
248 (r'"(\\.|[^"])*"', String), |
244 (r'"(\\.|[^"\\])*"', String), |
249 # quoting |
245 # quoting |
250 (r":" + symbol, String.Symbol), |
246 (r":" + symbol, String.Symbol), |
251 (r"'" + symbol, String.Symbol), |
247 (r"'" + symbol, String.Symbol), |
252 (r"'", Operator), |
248 (r"'", Operator), |
253 (r"`", Operator), |
249 (r"`", Operator), |
441 (r'\^[][A-Z@\^_]', String.Escape, '#pop'), |
437 (r'\^[][A-Z@\^_]', String.Escape, '#pop'), |
442 ('|'.join(ascii), String.Escape, '#pop'), |
438 ('|'.join(ascii), String.Escape, '#pop'), |
443 (r'o[0-7]+', String.Escape, '#pop'), |
439 (r'o[0-7]+', String.Escape, '#pop'), |
444 (r'x[\da-fA-F]+', String.Escape, '#pop'), |
440 (r'x[\da-fA-F]+', String.Escape, '#pop'), |
445 (r'\d+', String.Escape, '#pop'), |
441 (r'\d+', String.Escape, '#pop'), |
446 (r'\n\s+\\', String.Escape, '#pop'), |
442 (r'\s+\\', String.Escape, '#pop'), |
447 ], |
443 ], |
448 } |
444 } |
449 |
445 |
450 |
446 |
451 line_re = re.compile('.*?\n') |
447 line_re = re.compile('.*?\n') |