Skip to content

Commit

Permalink
Add heuristic to distinguish RUNOFF from Roff
Browse files Browse the repository at this point in the history
  • Loading branch information
Alhadis committed Jul 20, 2016
1 parent 93341be commit 22609dc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/linguist/heuristics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,14 @@ def call(data)
end
end

disambiguate ".rno" do |data|
if /^\.!|^\.end lit(?:eral)?\b/i.match(data)
Language["RUNOFF"]
elsif /^\.\\" /.match(data)
Language["Groff"]
end
end

disambiguate ".rpy" do |data|
if /(^(import|from|class|def)\s)/m.match(data)
Language["Python"]
Expand Down

0 comments on commit 22609dc

Please sign in to comment.