Add support for World of Warcraft .toc files

* Add language rule and heuristic for WoW Addon data

* Add test fixtures for the .toc extension

* Add grammar for syntax highlighting

* Define colour of WoW .toc files

* Refine heuristic to include a commonly-used keyword

* Check whitespace in WoW-token heuristic

* Include additional TeX keywords in .toc heuristic

* Update grammar submodules

* Cache license for WoW-toc grammar

* Reverting sourcepawn update
This commit is contained in:
John Gardner
2016-05-05 07:07:01 +10:00
committed by Arfon Smith
parent 8cf3b7ad51
commit 9ae19a1f94
16 changed files with 121 additions and 6 deletions

3
.gitmodules vendored
View File

@@ -710,6 +710,9 @@
[submodule "vendor/grammars/language-graphql"]
path = vendor/grammars/language-graphql
url = https://github.com/rmosolgo/language-graphql
[submodule "vendor/grammars/language-toc-wow"]
path = vendor/grammars/language-toc-wow
url = https://github.com/nebularg/language-toc-wow
[submodule "vendor/grammars/sublime-autoit"]
path = vendor/grammars/sublime-autoit
url = https://github.com/AutoIt/SublimeAutoItScript

View File

@@ -124,7 +124,6 @@ vendor/grammars/SublimeBrainfuck:
vendor/grammars/SublimeClarion/:
- source.clarion
vendor/grammars/SublimePapyrus/:
- source.papyrus.fallout4
- source.papyrus.skyrim
vendor/grammars/SublimePuppet/:
- source.puppet
@@ -372,6 +371,8 @@ vendor/grammars/language-shellscript:
- text.shell-session
vendor/grammars/language-supercollider:
- source.supercollider
vendor/grammars/language-toc-wow:
- source.toc
vendor/grammars/language-xbase:
- source.harbour
vendor/grammars/language-yaml:

View File

@@ -390,6 +390,14 @@ module Linguist
Language["SQL"]
end
end
disambiguate ".toc" do |data|
if /^## |@no-lib-strip@/.match(data)
Language["World of Warcraft Addon Data"]
elsif /^\\(contentsline|defcounter|beamer|boolfalse)/.match(data)
Language["TeX"]
end
end
disambiguate ".ts" do |data|
if data.include?("<TS ")

View File

@@ -3830,6 +3830,14 @@ WebIDL:
tm_scope: source.webidl
ace_mode: text
World of Warcraft Addon Data:
type: data
color: "#e0b330"
extensions:
- .toc
tm_scope: source.toc
ace_mode: text
X10:
type: programming
aliases:

9
samples/TeX/beispiel.toc Normal file
View File

@@ -0,0 +1,9 @@
\beamer@endinputifotherversion {3.07pt}
\select@language {german}
\beamer@sectionintoc {1}{Geschichte}{3}{0}{1}
\beamer@sectionintoc {2}{Merkmale}{4}{0}{2}
\beamer@sectionintoc {3}{Kritikpunkte}{5}{0}{3}
\beamer@sectionintoc {4}{Perl-Kultur und Spa{\ss}}{6}{0}{4}
\beamer@sectionintoc {5}{Siehe auch}{7}{0}{5}
\beamer@sectionintoc {6}{Einzelnachweise}{8}{0}{6}
\beamer@sectionintoc {7}{Bedingte Ausf\"{u}hrung}{12}{0}{7}

19
samples/TeX/perl.toc Normal file
View File

@@ -0,0 +1,19 @@
\contentsline {section}{\numberline {1}History}{3}
\contentsline {subsection}{\numberline {1.1}Early versions}{3}
\contentsline {subsection}{\numberline {1.2}Early Perl 5}{3}
\contentsline {subsection}{\numberline {1.3}2000-present}{3}
\contentsline {subsection}{\numberline {1.4}Name}{3}
\contentsline {subsection}{\numberline {1.5}Camel symbol}{3}
\contentsline {subsection}{\numberline {1.6}Onion symbol}{3}
\contentsline {section}{\numberline {2}Overview}{3}
\contentsline {subsection}{\numberline {2.1}Features}{3}
\contentsline {subsection}{\numberline {2.2}Design}{3}
\contentsline {subsection}{\numberline {2.3}Applications}{3}
\contentsline {subsection}{\numberline {2.4}Implementation}{3}
\contentsline {section}{\numberline {3}Database interfaces}{3}
\contentsline {section}{\numberline {4}Distribution}{4}
\contentsline {subsection}{\numberline {4.1}Availability}{4}
\contentsline {subsubsection}{\numberline {4.3.1}Windows}{5}
\contentsline {subsubsection}{\numberline {4.3.2}Mac OS X}{6}
\contentsline {subsubsection}{\numberline {4.3.3}OpenBSD}{6}
\contentsline {subsubsection}{\numberline {4.3.4}FreeBSD}{6}

View File

@@ -0,0 +1,6 @@
## Interface: 60200
## Title: Vahevian Lotus Vane
## Notes: "Critical Threat Range"
## Version: 4.2
Vahevia.xml
Lotus_Vane.lua

View File

@@ -0,0 +1,11 @@
# Internationalisation example
## Title: Test
## Title-esES: Pruebas
## Title-huHU: Próba
## Notes: "Testing this shit"
## Notes-esES: "Probando la mierda esta"
## Notes-huHU: "Kipróbálom ezt a szart"
Tests.xml
Elk.lua

View File

@@ -0,0 +1,24 @@
# Addon manifest file
## Interface: 60200
## Title: Linguist
## Notes: "Language savant"
## RequiredDeps: charlockHolmes, escapeUtils, mimeTypes, rugged
## LoadOnDemand: 1
## Version: 4.9
# This is a comment
## SavedVariables: foo, bar
## SavedVariablesPerCharacter: fewburt
Languages.xml
Heuristics.xml
h-counter.lua
ruby-isnt.lua
#
# It is possible for addons to query values of any tags with a "X-" prefix.
# Some possibilities include:
#
## X-Date: "2016-04-28"
## X-Website: "https://github.com/"

View File

@@ -0,0 +1,25 @@
---
type: grammar
name: language-toc-wow
license: mit
---
Copyright (c) 2016 Kyle Buller
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.