55 backslashflag = line.strip().endswith('\\') |
55 backslashflag = line.strip().endswith('\\') |
56 elif self.r_comment.match(line): |
56 elif self.r_comment.match(line): |
57 ins.append((len(done), [(0, Comment, line)])) |
57 ins.append((len(done), [(0, Comment, line)])) |
58 else: |
58 else: |
59 done += line |
59 done += line |
60 for item in do_insertions(ins, lex.get_tokens_unprocessed(done)): |
60 yield from do_insertions(ins, lex.get_tokens_unprocessed(done)) |
61 yield item |
|
62 |
61 |
63 def analyse_text(text): |
62 def analyse_text(text): |
64 # Many makefiles have $(BIG_CAPS) style variables |
63 # Many makefiles have $(BIG_CAPS) style variables |
65 if re.search(r'\$\([A-Z_]+\)', text): |
64 if re.search(r'\$\([A-Z_]+\)', text): |
66 return 0.1 |
65 return 0.1 |
194 (r'#.*\n', Comment), |
193 (r'#.*\n', Comment), |
195 ] |
194 ] |
196 } |
195 } |
197 |
196 |
198 def analyse_text(text): |
197 def analyse_text(text): |
199 exp = r'^ *CMAKE_MINIMUM_REQUIRED *\( *VERSION *\d(\.\d)* *( FATAL_ERROR)? *\) *$' |
198 exp = ( |
|
199 r'^[ \t]*CMAKE_MINIMUM_REQUIRED[ \t]*' |
|
200 r'\([ \t]*VERSION[ \t]*\d+(\.\d+)*[ \t]*' |
|
201 r'([ \t]FATAL_ERROR)?[ \t]*\)[ \t]*' |
|
202 r'(#[^\n]*)?$' |
|
203 ) |
200 if re.search(exp, text, flags=re.MULTILINE | re.IGNORECASE): |
204 if re.search(exp, text, flags=re.MULTILINE | re.IGNORECASE): |
201 return 0.8 |
205 return 0.8 |
202 return 0.0 |
206 return 0.0 |