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 |