eric6/ThirdParty/Pygments/pygments/lexers/rebol.py

changeset 7547
21b0534faebc
parent 6942
2602857055c5
child 7701
25f42e208e08
equal deleted inserted replaced
7546:bf5f777260a6 7547:21b0534faebc
3 pygments.lexers.rebol 3 pygments.lexers.rebol
4 ~~~~~~~~~~~~~~~~~~~~~ 4 ~~~~~~~~~~~~~~~~~~~~~
5 5
6 Lexers for the REBOL and related languages. 6 Lexers for the REBOL and related languages.
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 13
237 Check if code contains REBOL header and so it probably not R code 237 Check if code contains REBOL header and so it probably not R code
238 """ 238 """
239 if re.match(r'^\s*REBOL\s*\[', text, re.IGNORECASE): 239 if re.match(r'^\s*REBOL\s*\[', text, re.IGNORECASE):
240 # The code starts with REBOL header 240 # The code starts with REBOL header
241 return 1.0 241 return 1.0
242 elif re.search(r'\s*REBOL\s*[', text, re.IGNORECASE): 242 elif re.search(r'\s*REBOL\s*\[', text, re.IGNORECASE):
243 # The code contains REBOL header but also some text before it 243 # The code contains REBOL header but also some text before it
244 return 0.5 244 return 0.5
245 245
246 246
247 class RedLexer(RegexLexer): 247 class RedLexer(RegexLexer):

eric ide

mercurial