mirror of
				https://github.com/KevinMidboe/linguist.git
				synced 2025-10-29 17:50:22 +00:00 
			
		
		
		
	More regex goodness to improve the detection of C++ vs C
This commit is contained in:
		| @@ -39,8 +39,9 @@ module Linguist | |||||||
|       matches = [] |       matches = [] | ||||||
|       if (/@(interface|class|protocol|synchronised|selector|implementation)/.match(data)) |       if (/@(interface|class|protocol|synchronised|selector|implementation)/.match(data)) | ||||||
|         matches << Language["Objective-C"] |         matches << Language["Objective-C"] | ||||||
|       elsif (/^\s*#\s*include <(cstdint|string|vector|map|list|array|bitset|queue|stack|forward_list|unordered_map|unordered_set)>/.match(data) or |       end | ||||||
|           /template\s*</.match(data) or /[^@]class/.match(data)) |       if (/^\s*#\s*include <(cstdint|string|vector|map|list|array|bitset|queue|stack|forward_list|unordered_map|unordered_set)>/.match(data) or | ||||||
|  |           /^\s*template\s*</.match(data) or /[^@]class\s+\w+/.match(data) or /^[^@](private|public|protected):$/.match(data)) | ||||||
|         matches << Language["C++"] |         matches << Language["C++"] | ||||||
|       end |       end | ||||||
|       matches |       matches | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user