mirror of
				https://github.com/KevinMidboe/linguist.git
				synced 2025-10-29 17:50:22 +00:00 
			
		
		
		
	Merge pull request #2782 from pchaigno/perl-heuristic-order
Reorder Perl heuristic rules
This commit is contained in:
		| @@ -276,20 +276,20 @@ module Linguist | |||||||
|     end |     end | ||||||
|  |  | ||||||
|     disambiguate ".pl" do |data| |     disambiguate ".pl" do |data| | ||||||
|       if /^(use v6|(my )?class|module)/.match(data) |       if /^[^#]+:-/.match(data) | ||||||
|         Language["Perl6"] |         Language["Prolog"] | ||||||
|       elsif /use strict|use\s+v?5\./.match(data) |       elsif /use strict|use\s+v?5\./.match(data) | ||||||
|         Language["Perl"] |         Language["Perl"] | ||||||
|       elsif /^[^#]+:-/.match(data) |       elsif /^(use v6|(my )?class|module)/.match(data) | ||||||
|         Language["Prolog"] |         Language["Perl6"] | ||||||
|       end |       end | ||||||
|     end |     end | ||||||
|  |  | ||||||
|     disambiguate ".pm", ".t" do |data| |     disambiguate ".pm", ".t" do |data| | ||||||
|       if /^(use v6|(my )?class|module)/.match(data) |       if /use strict|use\s+v?5\./.match(data) | ||||||
|         Language["Perl6"] |  | ||||||
|       elsif /use strict|use\s+v?5\./.match(data) |  | ||||||
|         Language["Perl"] |         Language["Perl"] | ||||||
|  |       elsif /^(use v6|(my )?class|module)/.match(data) | ||||||
|  |         Language["Perl6"] | ||||||
|       end |       end | ||||||
|     end |     end | ||||||
|  |  | ||||||
|   | |||||||
| @@ -12,7 +12,6 @@ unless EVAL 'EVAL("1", :lang<perl5>)' { | |||||||
| die unless | die unless | ||||||
| EVAL(q/ | EVAL(q/ | ||||||
| package My::Hash; | package My::Hash; | ||||||
| use strict; |  | ||||||
|  |  | ||||||
| sub new { | sub new { | ||||||
|     my ($class, $ref) = @_; |     my ($class, $ref) = @_; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user