]> git.r.bdr.sh - rbdr/api-notation.tmLanguage/commitdiff
Adds YAML source and tmLanguage result
authorBen Beltran <redacted>
Sat, 5 Sep 2015 20:10:05 +0000 (15:10 -0500)
committerBen Beltran <redacted>
Sat, 5 Sep 2015 20:10:05 +0000 (15:10 -0500)
api-notation.YAML-tmLanguage [new file with mode: 0644]
api-notation.tmLanguage [new file with mode: 0644]

diff --git a/api-notation.YAML-tmLanguage b/api-notation.YAML-tmLanguage
new file mode 100644 (file)
index 0000000..e1f8462
--- /dev/null
@@ -0,0 +1,73 @@
+# [PackageDev] target_format: plist, ext: tmLanguage
+---
+name: API Notation
+scopeName: source.api-notation
+fileTypes: ['api']
+uuid: fc8dc5cf-b7aa-4b64-a665-80e8dc1b2553
+patterns:
+  - begin: '^([a-zA-Z0-9_.]+)'
+    end: '\n'
+    name: constant.language
+    patterns:
+      - include: '#dataTypes'
+      - include: '#comment'
+  - begin: '[ \t]*'
+    end: '\n'
+    patterns:
+      - include: '#apiMember'
+      - include: '#parameterList'
+      - include: '#dataTypes'
+      - include: '#operators'
+      - include: '#parameters'
+      - include: '#comment'
+  - begin: '^.'
+    end: '\n'
+    patterns:
+      - include: '#comment'
+repository:
+  dataTypes:
+    begin: '\\<'
+    end: '\\>'
+    name: 'keyword.operator'
+    patterns:
+      - include: '#dataType'
+      - include: '#separators'
+  parameterList:
+    begin: '\\('
+    end: '\\)'
+    name: 'keyword.operator'
+    patterns:
+      - 'include': '#parameters'
+      - 'include': '#optionalParameters'
+      - 'include': '#dataTypes'
+      - 'include': '#separators'
+  dataType:
+    match: '[a-zA-Z0-9_.]+'
+    name: 'support.function'
+  parameters:
+    match: '[a-zA-Z0-9_.]+'
+    name: 'string.other'
+  optionalParameters:
+    begin: '\\['
+    end: '\\]'
+    patterns:
+      - 'include': '#optionalParameter'
+  optionalParameter:
+    match: '[a-zA-Z0-9_.]+'
+    name: 'meta.separator'
+  separators:
+    match: '\\||,'
+    name: 'comment.line'
+  apiMember:
+    match: '((?:<\\+)|(?:<\\~)|(?:<\\-)|(?:\\+>)|(?:\\~>)|(?:\\->)|\\-|\\+|(?:::)|#)([a-zA-z0-9_]+)'
+    captures:
+      '1':
+        name: 'keyword.control'
+      '2':
+        name: 'variable.language'
+  comment:
+    match: '[ \t]*//[ \t]*.*'
+    name: 'comment.line'
+  operators:
+    match: '(?:\\->)|(?:\\=>)'
+    name: 'keyword.control'
\ No newline at end of file
diff --git a/api-notation.tmLanguage b/api-notation.tmLanguage
new file mode 100644 (file)
index 0000000..a7200de
--- /dev/null
@@ -0,0 +1,209 @@
+<?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>api</string>
+       </array>
+       <key>name</key>
+       <string>API Notation</string>
+       <key>patterns</key>
+       <array>
+               <dict>
+                       <key>begin</key>
+                       <string>^([a-zA-Z0-9_.]+)</string>
+                       <key>end</key>
+                       <string>\n</string>
+                       <key>name</key>
+                       <string>constant.language</string>
+                       <key>patterns</key>
+                       <array>
+                               <dict>
+                                       <key>include</key>
+                                       <string>#dataTypes</string>
+                               </dict>
+                               <dict>
+                                       <key>include</key>
+                                       <string>#comment</string>
+                               </dict>
+                       </array>
+               </dict>
+               <dict>
+                       <key>begin</key>
+                       <string>[ \t]*</string>
+                       <key>end</key>
+                       <string>\n</string>
+                       <key>patterns</key>
+                       <array>
+                               <dict>
+                                       <key>include</key>
+                                       <string>#apiMember</string>
+                               </dict>
+                               <dict>
+                                       <key>include</key>
+                                       <string>#parameterList</string>
+                               </dict>
+                               <dict>
+                                       <key>include</key>
+                                       <string>#dataTypes</string>
+                               </dict>
+                               <dict>
+                                       <key>include</key>
+                                       <string>#operators</string>
+                               </dict>
+                               <dict>
+                                       <key>include</key>
+                                       <string>#parameters</string>
+                               </dict>
+                               <dict>
+                                       <key>include</key>
+                                       <string>#comment</string>
+                               </dict>
+                       </array>
+               </dict>
+               <dict>
+                       <key>begin</key>
+                       <string>^.</string>
+                       <key>end</key>
+                       <string>\n</string>
+                       <key>patterns</key>
+                       <array>
+                               <dict>
+                                       <key>include</key>
+                                       <string>#comment</string>
+                               </dict>
+                       </array>
+               </dict>
+       </array>
+       <key>repository</key>
+       <dict>
+               <key>apiMember</key>
+               <dict>
+                       <key>captures</key>
+                       <dict>
+                               <key>1</key>
+                               <dict>
+                                       <key>name</key>
+                                       <string>keyword.control</string>
+                               </dict>
+                               <key>2</key>
+                               <dict>
+                                       <key>name</key>
+                                       <string>variable.language</string>
+                               </dict>
+                       </dict>
+                       <key>match</key>
+                       <string>((?:&lt;\\+)|(?:&lt;\\~)|(?:&lt;\\-)|(?:\\+&gt;)|(?:\\~&gt;)|(?:\\-&gt;)|\\-|\\+|(?:::)|#)([a-zA-z0-9_]+)</string>
+               </dict>
+               <key>comment</key>
+               <dict>
+                       <key>match</key>
+                       <string>[ \t]*//[ \t]*.*</string>
+                       <key>name</key>
+                       <string>comment.line</string>
+               </dict>
+               <key>dataType</key>
+               <dict>
+                       <key>match</key>
+                       <string>[a-zA-Z0-9_.]+</string>
+                       <key>name</key>
+                       <string>support.function</string>
+               </dict>
+               <key>dataTypes</key>
+               <dict>
+                       <key>begin</key>
+                       <string>\\&lt;</string>
+                       <key>end</key>
+                       <string>\\&gt;</string>
+                       <key>name</key>
+                       <string>keyword.operator</string>
+                       <key>patterns</key>
+                       <array>
+                               <dict>
+                                       <key>include</key>
+                                       <string>#dataType</string>
+                               </dict>
+                               <dict>
+                                       <key>include</key>
+                                       <string>#separators</string>
+                               </dict>
+                       </array>
+               </dict>
+               <key>operators</key>
+               <dict>
+                       <key>match</key>
+                       <string>(?:\\-&gt;)|(?:\\=&gt;)</string>
+                       <key>name</key>
+                       <string>keyword.control</string>
+               </dict>
+               <key>optionalParameter</key>
+               <dict>
+                       <key>match</key>
+                       <string>[a-zA-Z0-9_.]+</string>
+                       <key>name</key>
+                       <string>meta.separator</string>
+               </dict>
+               <key>optionalParameters</key>
+               <dict>
+                       <key>begin</key>
+                       <string>\\[</string>
+                       <key>end</key>
+                       <string>\\]</string>
+                       <key>patterns</key>
+                       <array>
+                               <dict>
+                                       <key>include</key>
+                                       <string>#optionalParameter</string>
+                               </dict>
+                       </array>
+               </dict>
+               <key>parameterList</key>
+               <dict>
+                       <key>begin</key>
+                       <string>\\(</string>
+                       <key>end</key>
+                       <string>\\)</string>
+                       <key>name</key>
+                       <string>keyword.operator</string>
+                       <key>patterns</key>
+                       <array>
+                               <dict>
+                                       <key>include</key>
+                                       <string>#parameters</string>
+                               </dict>
+                               <dict>
+                                       <key>include</key>
+                                       <string>#optionalParameters</string>
+                               </dict>
+                               <dict>
+                                       <key>include</key>
+                                       <string>#dataTypes</string>
+                               </dict>
+                               <dict>
+                                       <key>include</key>
+                                       <string>#separators</string>
+                               </dict>
+                       </array>
+               </dict>
+               <key>parameters</key>
+               <dict>
+                       <key>match</key>
+                       <string>[a-zA-Z0-9_.]+</string>
+                       <key>name</key>
+                       <string>string.other</string>
+               </dict>
+               <key>separators</key>
+               <dict>
+                       <key>match</key>
+                       <string>\\||,</string>
+                       <key>name</key>
+                       <string>comment.line</string>
+               </dict>
+       </dict>
+       <key>scopeName</key>
+       <string>source.api-notation</string>
+       <key>uuid</key>
+       <string>fc8dc5cf-b7aa-4b64-a665-80e8dc1b2553</string>
+</dict>
+</plist>