Merge pull request #2782 from pchaigno/perl-heuristic-order

Reorder Perl heuristic rules
This commit is contained in:
Arfon Smith
2016-01-03 07:44:54 -05:00
2 changed files with 7 additions and 8 deletions

View File

@@ -276,20 +276,20 @@ module Linguist
end
disambiguate ".pl" do |data|
if /^(use v6|(my )?class|module)/.match(data)
Language["Perl6"]
if /^[^#]+:-/.match(data)
Language["Prolog"]
elsif /use strict|use\s+v?5\./.match(data)
Language["Perl"]
elsif /^[^#]+:-/.match(data)
Language["Prolog"]
elsif /^(use v6|(my )?class|module)/.match(data)
Language["Perl6"]
end
end
disambiguate ".pm", ".t" do |data|
if /^(use v6|(my )?class|module)/.match(data)
Language["Perl6"]
elsif /use strict|use\s+v?5\./.match(data)
if /use strict|use\s+v?5\./.match(data)
Language["Perl"]
elsif /^(use v6|(my )?class|module)/.match(data)
Language["Perl6"]
end
end

View File

@@ -12,7 +12,6 @@ unless EVAL 'EVAL("1", :lang<perl5>)' {
die unless
EVAL(q/
package My::Hash;
use strict;
sub new {
my ($class, $ref) = @_;