diff --git a/.gitmodules b/.gitmodules index b5de73ab..7ad57665 100644 --- a/.gitmodules +++ b/.gitmodules @@ -755,3 +755,6 @@ url = https://github.com/austinwagner/sublime-sourcepawn [submodule "vendor/grammars/language-roff"] path = vendor/grammars/language-roff url = https://github.com/Alhadis/language-roff +[submodule "vendor/grammars/language-asn1"] + path = vendor/grammars/language-asn1 + url = https://github.com/ajLangley12/language-asn1 diff --git a/grammars.yml b/grammars.yml index 0751772f..42a694df 100755 --- a/grammars.yml +++ b/grammars.yml @@ -336,6 +336,8 @@ vendor/grammars/language-agc: - source.agc vendor/grammars/language-apl: - source.apl +vendor/grammars/language-asn1: +- source.asn vendor/grammars/language-babel/: - source.js.jsx - source.regexp.babel diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 25a23dc9..11f7ebc3 100755 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -82,6 +82,15 @@ APL: tm_scope: source.apl ace_mode: text +ASN.1: + type: data + color: "#aeead0" + extensions: + - .asn + - .asn1 + tm_scope: source.asn + ace_mode: text + ASP: type: programming color: "#6a40fd" diff --git a/samples/ASN.1/example.asn b/samples/ASN.1/example.asn new file mode 100644 index 00000000..0631abc9 --- /dev/null +++ b/samples/ASN.1/example.asn @@ -0,0 +1,33 @@ +MyShopPurchaseOrders DEFINITIONS AUTOMATIC TAGS ::= BEGIN + +PurchaseOrder ::= SEQUENCE { +dateOfOrder DATE, +customer CustomerInfo, +items ListOfItems +} + +CustomerInfo ::= SEQUENCE { +companyName VisibleString (SIZE (3..50)), +billingAddress Address, +contactPhone NumericString (SIZE (7..12)) +} + +Address::= SEQUENCE { +street VisibleString (SIZE (5 .. 50)) OPTIONAL, +city VisibleString (SIZE (2..30)), +state VisibleString (SIZE(2) ^ FROM ("A".."Z")), +zipCode NumericString (SIZE(5 | 9)) +} + +ListOfItems ::= SEQUENCE (SIZE (1..100)) OF Item + +Item ::= SEQUENCE { +itemCode INTEGER (1..99999), +color VisibleString ("Black" | "Blue" | "Brown"), +power INTEGER (110 | 220), +deliveryTime INTEGER (8..12 | 14..19), +quantity INTEGER (1..1000), +unitPrice REAL (1.00 .. 9999.00), +isTaxable BOOLEAN +} +END diff --git a/vendor/grammars/language-asn1 b/vendor/grammars/language-asn1 new file mode 160000 index 00000000..d45daeb8 --- /dev/null +++ b/vendor/grammars/language-asn1 @@ -0,0 +1 @@ +Subproject commit d45daeb849f02a79d67585f629bdc83a06cc52e5 diff --git a/vendor/licenses/grammar/language-asn1.txt b/vendor/licenses/grammar/language-asn1.txt new file mode 100644 index 00000000..3f9bfcae --- /dev/null +++ b/vendor/licenses/grammar/language-asn1.txt @@ -0,0 +1,26 @@ +--- +type: grammar +name: language-asn1 +license: mit +--- +The MIT License (MIT) + +Copyright (c) 2016 Alexander Langley + +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.