From 7f5bb25542db166cc8b9232fe0cf18484efd709f Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Thu, 13 Aug 2015 16:56:21 +0200 Subject: [PATCH 1/4] Remove grammar for Prolog from TextMate bundle --- .gitmodules | 3 --- grammars.yml | 2 -- vendor/grammars/prolog.tmbundle | 1 - 3 files changed, 6 deletions(-) delete mode 160000 vendor/grammars/prolog.tmbundle diff --git a/.gitmodules b/.gitmodules index f4238e8b..aff647b7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -397,9 +397,6 @@ [submodule "vendor/grammars/processing.tmbundle"] path = vendor/grammars/processing.tmbundle url = https://github.com/textmate/processing.tmbundle -[submodule "vendor/grammars/prolog.tmbundle"] - path = vendor/grammars/prolog.tmbundle - url = https://github.com/textmate/prolog.tmbundle [submodule "vendor/grammars/python-django.tmbundle"] path = vendor/grammars/python-django.tmbundle url = https://github.com/textmate/python-django.tmbundle diff --git a/grammars.yml b/grammars.yml index 4da6c0e2..33880871 100644 --- a/grammars.yml +++ b/grammars.yml @@ -431,8 +431,6 @@ vendor/grammars/powershell: - source.powershell vendor/grammars/processing.tmbundle: - source.processing -vendor/grammars/prolog.tmbundle: -- source.prolog vendor/grammars/protobuf-tmbundle: - source.protobuf vendor/grammars/puppet-textmate-bundle: diff --git a/vendor/grammars/prolog.tmbundle b/vendor/grammars/prolog.tmbundle deleted file mode 160000 index d955aca3..00000000 --- a/vendor/grammars/prolog.tmbundle +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d955aca38b7aadce76e6815eb09487a370206742 From 8d216f0c43a21e6f5d3d4ac1a45aec40fc19b959 Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Thu, 13 Aug 2015 17:15:04 +0200 Subject: [PATCH 2/4] Grammar for Prolog from Sublime Text package MPLv2 License is currently unrecognized --- .gitmodules | 3 +++ grammars.yml | 3 +++ lib/linguist/languages.yml | 1 + vendor/grammars/sublimeprolog | 1 + 4 files changed, 8 insertions(+) create mode 160000 vendor/grammars/sublimeprolog diff --git a/.gitmodules b/.gitmodules index aff647b7..566254e5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -668,3 +668,6 @@ [submodule "vendor/grammars/st2-zonefile"] path = vendor/grammars/st2-zonefile url = https://github.com/sixty4k/st2-zonefile +[submodule "vendor/grammars/sublimeprolog"] + path = vendor/grammars/sublimeprolog + url = https://github.com/alnkpa/sublimeprolog diff --git a/grammars.yml b/grammars.yml index 33880871..0de7915f 100644 --- a/grammars.yml +++ b/grammars.yml @@ -529,6 +529,9 @@ vendor/grammars/sublime_cobol: vendor/grammars/sublime_man_page_support: - source.man - text.groff +vendor/grammars/sublimeprolog/: +- source.prolog +- source.prolog.eclipse vendor/grammars/sublimetext-cuda-cpp: - source.cuda-c++ vendor/grammars/swift.tmbundle: diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 3ff88a03..54b8ab65 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -2632,6 +2632,7 @@ Prolog: - .prolog interpreters: - swipl + tm_scope: source.prolog ace_mode: prolog Propeller Spin: diff --git a/vendor/grammars/sublimeprolog b/vendor/grammars/sublimeprolog new file mode 160000 index 00000000..465efc54 --- /dev/null +++ b/vendor/grammars/sublimeprolog @@ -0,0 +1 @@ +Subproject commit 465efc540e0e87787226a8563d65b15959e5a065 From 0d7a264981d1bf43a7d13c7e577fd418f1d27aa7 Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Wed, 19 Aug 2015 20:43:16 +0200 Subject: [PATCH 3/4] Update submodule for Prolog grammar --- vendor/grammars/sublimeprolog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/grammars/sublimeprolog b/vendor/grammars/sublimeprolog index 465efc54..9fd46df4 160000 --- a/vendor/grammars/sublimeprolog +++ b/vendor/grammars/sublimeprolog @@ -1 +1 @@ -Subproject commit 465efc540e0e87787226a8563d65b15959e5a065 +Subproject commit 9fd46df4b63479a8672d184cd47374a044a11b11 From 7d91e4959a5efeaedfce4ad9b0c4a42c867327a9 Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Wed, 19 Aug 2015 20:56:14 +0200 Subject: [PATCH 4/4] 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