comparison MoinMoin/support/pygments/lexers/functional.py @ 5614:f76914e77229

upgrade pygments to 1.3.1
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 07 Mar 2010 21:36:31 +0100
parents 74fa6f714526
children 6446873d152f
comparison
equal deleted inserted replaced
5613:ee3540cf6d49 5614:f76914e77229
8 :copyright: Copyright 2006-2010 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
472 def get_tokens_unprocessed(self, text): 468 def get_tokens_unprocessed(self, text):
473 hslexer = HaskellLexer(**self.options) 469 hslexer = HaskellLexer(**self.options)
474 470
475 style = self.options.get('litstyle') 471 style = self.options.get('litstyle')
476 if style is None: 472 if style is None:
477 style = (text.lstrip()[0] in '%\\') and 'latex' or 'bird' 473 style = (text.lstrip()[0:1] in '%\\') and 'latex' or 'bird'
478 474
479 code = '' 475 code = ''
480 insertions = [] 476 insertions = []
481 if style == 'bird': 477 if style == 'bird':
482 # bird-style 478 # bird-style