115 (r'"', String.Double, "string.double"), |
115 (r'"', String.Double, "string.double"), |
116 (r"'", String.Single, "string.single"), |
116 (r"'", String.Single, "string.single"), |
117 ], |
117 ], |
118 'string.double': [ |
118 'string.double': [ |
119 (r'((?:\\\\|\\"|[^"])*?)(\\B\((\d+)\)\()', blob_callback), |
119 (r'((?:\\\\|\\"|[^"])*?)(\\B\((\d+)\)\()', blob_callback), |
120 (r'(\\\\|\\"|[^"])*?"', String.Double, '#pop'), |
120 (r'(\\\\|\\[^\\]|[^"\\])*?"', String.Double, '#pop'), |
121 ], |
121 ], |
122 'string.single': [ |
122 'string.single': [ |
123 (r"((?:\\\\|\\'|[^'])*?)(\\B\((\d+)\)\()", blob_callback), |
123 (r"((?:\\\\|\\'|[^'])*?)(\\B\((\d+)\)\()", blob_callback), |
124 (r"(\\\\|\\'|[^'])*?'", String.Single, '#pop'), |
124 (r"(\\\\|\\[^\\]|[^'\\])*?'", String.Single, '#pop'), |
125 ], |
125 ], |
126 # from http://pygments.org/docs/lexerdevelopment/#changing-states |
126 # from http://pygments.org/docs/lexerdevelopment/#changing-states |
127 'comment': [ |
127 'comment': [ |
128 (r'[^*/]', Comment.Multiline), |
128 (r'[^*/]', Comment.Multiline), |
129 (r'/\*', Comment.Multiline, '#push'), |
129 (r'/\*', Comment.Multiline, '#push'), |
130 (r'\*/', Comment.Multiline, '#pop'), |
130 (r'\*/', Comment.Multiline, '#pop'), |
131 (r'[*/]', Comment.Multiline), |
131 (r'[*/]', Comment.Multiline), |
132 ] |
132 ] |
133 } |
133 } |
|
134 |
|
135 def analyse_text(text): |
|
136 """This is fairly similar to C and others, but freezeif and |
|
137 waituntil are unique keywords.""" |
|
138 result = 0 |
|
139 |
|
140 if 'freezeif' in text: |
|
141 result += 0.05 |
|
142 |
|
143 if 'waituntil' in text: |
|
144 result += 0.05 |
|
145 |
|
146 return result |