Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .pod6 filetype to Perl6 #3366

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions lib/linguist/heuristics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def call(data)
Language["ECL"]
end
end

disambiguate ".es" do |data|
if /^\s*(?:%%|main\s*\(.*?\)\s*->)/.match(data)
Language["Erlang"]
Expand Down Expand Up @@ -380,6 +380,22 @@ def call(data)
end
end

disambiguate ".pod" do |data|
if /^\s*=\w+$/.match(data)
if /^=pod|=cut/.match(data)
Language["Pod"]
elsif /^\s*=begin pod/.match(data)
Language["Perl 6"]
else
Language["Pod"]
end
elsif Perl6Regex.match(data)
Language["Perl 6"]
elsif /^\s*\/\* XPM \*\//.match(data)
Language["XPM"]
end
end

disambiguate ".pro" do |data|
if /^[^\[#]+:-/.match(data)
Language["Prolog"]
Expand Down Expand Up @@ -455,13 +471,13 @@ def call(data)
Language["SQL"]
end
end

disambiguate ".srt" do |data|
if /^(\d{2}:\d{2}:\d{2},\d{3})\s*(-->)\s*(\d{2}:\d{2}:\d{2},\d{3})$/.match(data)
Language["SubRip Text"]
end
end

disambiguate ".t" do |data|
if Perl5Regex.match(data)
Language["Perl"]
Expand All @@ -471,7 +487,7 @@ def call(data)
Language["Turing"]
end
end

disambiguate ".toc" do |data|
if /^## |@no-lib-strip@/.match(data)
Language["World of Warcraft Addon Data"]
Expand Down Expand Up @@ -504,15 +520,15 @@ def call(data)
Language["XML"]
end
end

disambiguate ".w" do |data|
if (data.include?("&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS"))
Language["OpenEdge ABL"]
elsif /^@(<|\w+\.)/.match(data)
Language["CWeb"]
end
end

disambiguate ".x" do |data|
if /\b(program|version)\s+\w+\s*{|\bunion\s+\w+\s+switch\s*\(/.match(data)
Language["RPC"]
Expand Down
2 changes: 2 additions & 0 deletions lib/linguist/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3401,6 +3401,8 @@ Perl 6:
- ".pl6"
- ".pm"
- ".pm6"
- ".pod"
- ".pod6"
- ".t"
filenames:
- Rexfile
Expand Down
Loading