1. Oldes
  2. pygments-main

Commits

Oldes  committed 6a09eac

REBOL lexer - added detection if code contains REBOL header and so R lexer is not used instead (proper fix)

  • Participants
  • Parent commits c293adf
  • Branches default

Comments (0)

Files changed (1)

File pygments/lexers/other.py

View file
         """
         Check if code contains REBOL header and so it probably not R code
         """
-        if text.startswith('\sREBOL\s\['):
+        if re.match(r'^\s*REBOL\s*\[', text, re.IGNORECASE):
             # The code starts with REBOL header
             return 1.0
-        elif re.search(r'\sREBOL\s[', text, re.IGNORECASE):
+        elif re.search(r'\s*REBOL\s*[', text, re.IGNORECASE):
             # The code contains REBOL header but also some text before it
-            return 0.9
+            return 0.5
 
 
 class ABAPLexer(RegexLexer):