Skip to content

Commit

Permalink
Add grammars for SVG and Property Lists (github-linguist#4586)
Browse files Browse the repository at this point in the history
* Add grammars for SVG and Property Lists

* Manually fix misidentified grammar license
  • Loading branch information
Alhadis authored Aug 12, 2019
1 parent b1e25d6 commit 80f7aad
Show file tree
Hide file tree
Showing 18 changed files with 571 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,9 @@
[submodule "vendor/grammars/language-povray"]
path = vendor/grammars/language-povray
url = https://github.com/c-lipka/language-povray
[submodule "vendor/grammars/language-property-list"]
path = vendor/grammars/language-property-list
url = https://github.com/atom/language-property-list
[submodule "vendor/grammars/language-reason"]
path = vendor/grammars/language-reason
url = https://github.com/reasonml-editor/language-reason
Expand Down
5 changes: 5 additions & 0 deletions grammars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,9 @@ vendor/grammars/language-etc:
- source.man-conf
- source.nanorc
- source.opts
- source.smpl
- source.ssh-config
- text.xml.svg
vendor/grammars/language-fontforge:
- source.afm
- source.bdf
Expand Down Expand Up @@ -516,6 +518,9 @@ vendor/grammars/language-pcb:
- source.pcb.sexp
vendor/grammars/language-povray:
- source.pov-ray sdl
vendor/grammars/language-property-list:
- source.plist
- text.xml.plist
vendor/grammars/language-reason:
- source.reason
- source.reason.hover.type
Expand Down
5 changes: 5 additions & 0 deletions lib/linguist/heuristics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,11 @@ disambiguations:
named_pattern: perl5
- language: Perl 6
named_pattern: perl6
- extensions: ['.plist']
rules:
- language: XML Property List
pattern: '<!DOCTYPE\s+plist'
- language: OpenStep Property List
- extensions: ['.pm']
rules:
- language: Perl
Expand Down
32 changes: 24 additions & 8 deletions lib/linguist/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3541,6 +3541,13 @@ OpenSCAD:
tm_scope: source.scad
ace_mode: scad
language_id: 266
OpenStep Property List:
type: data
extensions:
- ".plist"
tm_scope: source.plist
ace_mode: text
language_id: 598917541
OpenType Feature File:
type: data
aliases:
Expand Down Expand Up @@ -4665,7 +4672,7 @@ SVG:
type: data
extensions:
- ".svg"
tm_scope: text.xml
tm_scope: text.xml.svg
ace_mode: xml
codemirror_mode: xml
codemirror_mime_type: text/xml
Expand Down Expand Up @@ -5649,7 +5656,6 @@ XML:
- ".odd"
- ".osm"
- ".pkgproj"
- ".plist"
- ".pluginspec"
- ".proj"
- ".props"
Expand All @@ -5665,15 +5671,9 @@ XML:
- ".shproj"
- ".srdf"
- ".storyboard"
- ".stTheme"
- ".sublime-snippet"
- ".targets"
- ".tmCommand"
- ".tml"
- ".tmLanguage"
- ".tmPreferences"
- ".tmSnippet"
- ".tmTheme"
- ".ts"
- ".tsx"
- ".ui"
Expand Down Expand Up @@ -5717,6 +5717,22 @@ XML:
- Web.config
- packages.config
language_id: 399
XML Property List:
type: data
group: XML
extensions:
- ".plist"
- ".stTheme"
- ".tmCommand"
- ".tmLanguage"
- ".tmPreferences"
- ".tmSnippet"
- ".tmTheme"
tm_scope: text.xml.plist
ace_mode: xml
codemirror_mode: xml
codemirror_mime_type: text/xml
language_id: 75622871
XPages:
type: data
extensions:
Expand Down
63 changes: 63 additions & 0 deletions samples/OpenStep Property List/TypewriterInfo.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
ApplicationDescription = "Étoilé text editor";
ApplicationIcon = "Typewriter.tiff";
NSIcon = "Typewriter.tiff";
ApplicationName = Typewriter;
ApplicationRelease = 0.1;
Authors = ("Yen-Ju Chen", "Günther Noack <[email protected]>");
Copyright = "Copyright (C) 2006 by Yen-Ju Chen";
CopyrightDescription = "Released under BSD Licence";
FullVersionID = 0.1;
URL = "";
NSTypes = (
{
NSName = "TWPlainTextType";
NSHumanReadableName = "Plain Text Document";
NSUnixExtensions = ("txt");
NSRole = Editor;
NSIcon = Document-Text.tiff;
NSDocumentClass = TWDocument;
},
{
NSName = "TWRTFTextType";
NSHumanReadableName = "RTF Document";
NSUnixExtensions = ("rtf");
NSRole = Editor;
NSIcon = Document-RichText.tiff;
NSDocumentClass = TWDocument;
},
{
NSName = "TWRTFDTextType";
NSHumanReadableName = "RTFD Document";
NSUnixExtensions = ("rtfd");
NSRole = Editor;
NSIcon = Document-RichText.tiff;
NSDocumentClass = TWDocument;
}
);
NSServices = (
{
NSPortName = Typewriter;
NSMessage = newDocumentWithSelection;
NSSendTypes = (NSStringPboardType);
NSKeyEquivalent = {
default = "";
};
NSMenuItem = {
default = "Typewriter/New document with selection";
};
},
{
NSPortName = Typewriter;
NSMessage = openDocumentWithPath;
NSSendTypes = (NSStringPboardType);
NSKeyEquivalent = {
default = "";
};
NSMenuItem = {
default = "Typewriter/Open selected file";
};
}
);
}

16 changes: 16 additions & 0 deletions samples/XML Property List/And.tmSnippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>.and.</string>
<key>name</key>
<string>And</string>
<key>scope</key>
<string>source.fortran</string>
<key>tabTrigger</key>
<string>and</string>
<key>uuid</key>
<string>3537B123-DB04-475A-8B8A-A5D223872FC1</string>
</dict>
</plist>
22 changes: 22 additions & 0 deletions samples/XML Property List/Completion.tmCommand
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string>"$TM_BUNDLE_SUPPORT/bin/completion.rb"</string>
<key>input</key>
<string>none</string>
<key>keyEquivalent</key>
<string>~</string>
<key>name</key>
<string>Completion</string>
<key>output</key>
<string>afterSelectedText</string>
<key>scope</key>
<string>source.sql</string>
<key>uuid</key>
<string>AFBD4D3D-926A-44B1-91CD-2BF793BCB8FD</string>
</dict>
</plist>
19 changes: 19 additions & 0 deletions samples/XML Property List/Folding.tmPreferences
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Folding</string>
<key>scope</key>
<string>source.sql</string>
<key>settings</key>
<dict>
<key>foldingStartMarker</key>
<string>\s*\(\s*$</string>
<key>foldingStopMarker</key>
<string>^\s*\)</string>
</dict>
<key>uuid</key>
<string>497AB342-09C2-4911-A2A0-24564AFB058C</string>
</dict>
</plist>
43 changes: 43 additions & 0 deletions samples/XML Property List/Man.tmLanguage
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>man</string>
</array>
<key>name</key>
<string>Man</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>^[A-Z](?&gt;\S|\s(?!\s))*$</string>
<key>name</key>
<string>markup.heading.man</string>
</dict>
<dict>
<key>match</key>
<string>((https?|ftp|file|txmt)://|mailto:)[-:@a-zA-Z0-9_.~%+/?=&amp;#]+(?&lt;![.?:])</string>
<key>name</key>
<string>markup.underline.link.man</string>
</dict>
<dict>
<key>match</key>
<string>([\w\.]+\(\d[a-z]?\))</string>
<key>name</key>
<string>markup.underline.link.internal.man</string>
</dict>
<dict>
<key>match</key>
<string>^_{2,}$</string>
<key>name</key>
<string>meta.foldingStopMarker.man</string>
</dict>
</array>
<key>scopeName</key>
<string>text.man</string>
<key>uuid</key>
<string>E8BAC30A-16BF-498D-941D-73FBAED37891</string>
</dict>
</plist>
Loading

0 comments on commit 80f7aad

Please sign in to comment.