From 7d91e4959a5efeaedfce4ad9b0c4a42c867327a9 Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Wed, 19 Aug 2015 20:56:14 +0200 Subject: [PATCH] Dissociate ECLiPSe from Prolog ECLiPSe syntax is slightly different from Prolog syntax ECLiPSe is in the Prolog group so it will only be highlighted differently --- lib/linguist/heuristics.rb | 2 +- lib/linguist/languages.yml | 9 ++++++++- samples/{Prolog => ECLiPSe}/or-constraint.ecl | 0 test/test_heuristics.rb | 6 +++--- 4 files changed, 12 insertions(+), 5 deletions(-) rename samples/{Prolog => ECLiPSe}/or-constraint.ecl (100%) diff --git a/lib/linguist/heuristics.rb b/lib/linguist/heuristics.rb index fc8699c5..12104ee6 100644 --- a/lib/linguist/heuristics.rb +++ b/lib/linguist/heuristics.rb @@ -112,7 +112,7 @@ module Linguist disambiguate ".ecl" do |data| if /^[^#]+:-/.match(data) - Language["Prolog"] + Language["ECLiPSe"] elsif data.include?(":=") Language["ECL"] end diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 6ff194c9..fe37aacb 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -843,6 +843,14 @@ ECL: tm_scope: none ace_mode: text +ECLiPSe: + type: programming + group: prolog + extensions: + - .ecl + tm_scope: source.prolog.eclipse + ace_mode: prolog + Eagle: type: markup color: "#814C05" @@ -2628,7 +2636,6 @@ Prolog: color: "#74283c" extensions: - .pl - - .ecl - .pro - .prolog interpreters: diff --git a/samples/Prolog/or-constraint.ecl b/samples/ECLiPSe/or-constraint.ecl similarity index 100% rename from samples/Prolog/or-constraint.ecl rename to samples/ECLiPSe/or-constraint.ecl diff --git a/test/test_heuristics.rb b/test/test_heuristics.rb index 59041e7b..3448235b 100644 --- a/test/test_heuristics.rb +++ b/test/test_heuristics.rb @@ -66,11 +66,11 @@ class TestHeuristcs < Minitest::Test }) end - # Candidate languages = ["ECL", "Prolog"] - def test_ecl_prolog_by_heuristics + # Candidate languages = ["ECL", "ECLiPSe"] + def test_ecl_by_heuristics assert_heuristics({ "ECL" => all_fixtures("ECL", "*.ecl"), - "Prolog" => all_fixtures("Prolog", "*.ecl") + "ECLiPSe" => all_fixtures("ECLiPSe", "*.ecl") }) end