mirror of
				https://github.com/KevinMidboe/linguist.git
				synced 2025-10-29 17:50:22 +00:00 
			
		
		
		
	Fix heuristic for Unix Assembly with .ms extension (#3550)
This commit is contained in:
		
				
					committed by
					
						 John Gardner
						John Gardner
					
				
			
			
				
	
			
			
			
						parent
						
							fa6ae1116f
						
					
				
				
					commit
					e80b92e407
				
			| @@ -298,7 +298,7 @@ module Linguist | ||||
|       if /^[.'][a-z][a-z](\s|$)/i.match(data) | ||||
|         Language["Groff"] | ||||
|       elsif /(?<!\S)\.(include|globa?l)\s/.match(data) || /(?<!\/\*)(\A|\n)\s*\.[A-Za-z]/.match(data.gsub(/"([^\\"]|\\.)*"|'([^\\']|\\.)*'|\\\s*(?:--.*)?\n/, "")) | ||||
|         Language["GAS"] | ||||
|         Language["Unix Assembly"] | ||||
|       else | ||||
|         Language["MAXScript"] | ||||
|       end | ||||
|   | ||||
| @@ -178,6 +178,13 @@ class TestHeuristcs < Minitest::Test | ||||
|     }) | ||||
|   end | ||||
|  | ||||
|   def test_ms_by_heuristics | ||||
|     assert_heuristics({ | ||||
|       "Unix Assembly" => all_fixtures("Unix Assembly", "*.ms"), | ||||
|       "MAXScript" => all_fixtures("MAXScript", "*.ms") | ||||
|     }) | ||||
|   end | ||||
|  | ||||
|   # Candidate languages = ["C++", "Objective-C"] | ||||
|   def test_obj_c_by_heuristics | ||||
|     # Only calling out '.h' filenames as these are the ones causing issues | ||||
|   | ||||
		Reference in New Issue
	
	Block a user