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

changeset 7983
54c5cfbb1e29
parent 7701
25f42e208e08
equal deleted inserted replaced
7982:48d210e41c65 7983:54c5cfbb1e29
3 pygments.lexers.oberon 3 pygments.lexers.oberon
4 ~~~~~~~~~~~~~~~~~~~~~~ 4 ~~~~~~~~~~~~~~~~~~~~~~
5 5
6 Lexers for Oberon family languages. 6 Lexers for Oberon family languages.
7 7
8 :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. 8 :copyright: Copyright 2006-2021 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
101 'VAR', 'WHILE', 'WITH' 101 'VAR', 'WHILE', 'WITH'
102 ), suffix=r'\b'), Keyword.Reserved), 102 ), suffix=r'\b'), Keyword.Reserved),
103 (r'(TRUE|FALSE|NIL|INF)\b', Keyword.Constant), 103 (r'(TRUE|FALSE|NIL|INF)\b', Keyword.Constant),
104 ] 104 ]
105 } 105 }
106
107 def analyse_text(text):
108 """The only other lexer using .cp is the C++ one, so we check if for
109 a few common Pascal keywords here. Those are unfortunately quite
110 common across various business languages as well."""
111 result = 0
112 if 'BEGIN' in text:
113 result += 0.01
114 if 'END' in text:
115 result += 0.01
116 if 'PROCEDURE' in text:
117 result += 0.01
118 if 'END' in text:
119 result += 0.01
120
121 return result

eric ide

mercurial