From 3086326d12b007265027348d8715ef40dce1ef5d Mon Sep 17 00:00:00 2001 From: Lars Brinkhoff Date: Thu, 26 Mar 2015 20:14:08 +0100 Subject: [PATCH] Tighten up OCaml heuristic: only match at start of line. --- lib/linguist/heuristics.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linguist/heuristics.rb b/lib/linguist/heuristics.rb index f8a6320e..e196e8bf 100644 --- a/lib/linguist/heuristics.rb +++ b/lib/linguist/heuristics.rb @@ -267,7 +267,7 @@ module Linguist end disambiguate "OCaml", "Standard ML" do |data| - if /module|let rec |match\s+(\S+\s)+with/.match(data) + if /(^\s*module)|let rec |match\s+(\S+\s)+with/.match(data) Language["OCaml"] elsif /=> |case\s+(\S+\s)+of/.match(data) Language["Standard ML"]