mirror of
				https://github.com/KevinMidboe/linguist.git
				synced 2025-10-29 17:50:22 +00:00 
			
		
		
		
	Merge pull request #2533 from github/rrebol
Adding back R/Rebol heuristics
This commit is contained in:
		| @@ -350,5 +350,13 @@ module Linguist | |||||||
|         Language["xBase"] |         Language["xBase"] | ||||||
|       end |       end | ||||||
|     end |     end | ||||||
|  |  | ||||||
|  |     disambiguate ".r", ".R" do |data| | ||||||
|  |       if /\bRebol\b/i.match(data) | ||||||
|  |         Language["Rebol"] | ||||||
|  |       elsif data.include?("<-") | ||||||
|  |         Language["R"] | ||||||
|  |       end | ||||||
|  |     end | ||||||
|   end |   end | ||||||
| end | end | ||||||
|   | |||||||
| @@ -179,4 +179,11 @@ class TestHeuristcs < Minitest::Test | |||||||
|       "xBase" => all_fixtures("xBase", ".ch") |       "xBase" => all_fixtures("xBase", ".ch") | ||||||
|     }) |     }) | ||||||
|   end |   end | ||||||
|  |  | ||||||
|  |   def test_r_by_heuristics | ||||||
|  |     assert_heuristics({ | ||||||
|  |       "R" => all_fixtures("R", "*.r") + all_fixtures("R", "*.R"), | ||||||
|  |       "Rebol" => all_fixtures("Rebol", "*.r") | ||||||
|  |     }) | ||||||
|  |   end | ||||||
| end | end | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user