Better C++ regex

This commit is contained in:
Arfon Smith
2014-12-11 21:06:35 -06:00
parent 79243b77fd
commit a323eb43ed

View File

@@ -73,7 +73,7 @@ module Linguist
if (/@(interface|class|protocol|property|end|synchronised|selector|implementation)\b/.match(data))
Language["Objective-C"]
elsif (/^\s*#\s*include <(cstdint|string|vector|map|list|array|bitset|queue|stack|forward_list|unordered_map|unordered_set|(i|o|io)stream)>/.match(data) ||
/^\s*template\s*</.match(data) || /^[^@]class\s+\w+/.match(data) || /^[^@](private|public|protected):$/.match(data) || /std::.+$/.match(data))
/^\s*template\s*</.match(data) || /^[:blank:]*try/.match(data) || /^[:blank:]*catch\s*\(/.match(data) || /^[:blank:]*(class|namespace)\s+\w+/.match(data) || /^[:blank:]*(private|public|protected):$/.match(data) || /std::\w+/.match(data))
Language["C++"]
end
end