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): |