34 if text.startswith('vcl 4.0;'): |
34 if text.startswith('vcl 4.0;'): |
35 return 1.0 |
35 return 1.0 |
36 # Skip over comments and blank lines |
36 # Skip over comments and blank lines |
37 # This is accurate enough that returning 0.9 is reasonable. |
37 # This is accurate enough that returning 0.9 is reasonable. |
38 # Almost no VCL files start without some comments. |
38 # Almost no VCL files start without some comments. |
39 elif '\nvcl 4\.0;' in text[:1000]: |
39 elif '\nvcl 4.0;' in text[:1000]: |
40 return 0.9 |
40 return 0.9 |
41 |
41 |
42 tokens = { |
42 tokens = { |
43 'probe': [ |
43 'probe': [ |
44 include('whitespace'), |
44 include('whitespace'), |
118 (r'([a-zA-Z_]\w*)' |
118 (r'([a-zA-Z_]\w*)' |
119 r'(\.)' |
119 r'(\.)' |
120 r'([a-zA-Z_]\w*)' |
120 r'([a-zA-Z_]\w*)' |
121 r'(\s*\(.*\))', |
121 r'(\s*\(.*\))', |
122 bygroups(Name.Function, Punctuation, Name.Function, using(this))), |
122 bygroups(Name.Function, Punctuation, Name.Function, using(this))), |
123 ('[a-zA-Z_]\w*', Name), |
123 (r'[a-zA-Z_]\w*', Name), |
124 ], |
124 ], |
125 'comment': [ |
125 'comment': [ |
126 (r'[^*/]+', Comment.Multiline), |
126 (r'[^*/]+', Comment.Multiline), |
127 (r'/\*', Comment.Multiline, '#push'), |
127 (r'/\*', Comment.Multiline, '#push'), |
128 (r'\*/', Comment.Multiline, '#pop'), |
128 (r'\*/', Comment.Multiline, '#pop'), |