aboutsummaryrefslogtreecommitdiff
path: root/grammars/api-notation.cson
diff options
context:
space:
mode:
authorBen Beltran <ben@nsovocal.com>2015-09-05 14:03:32 -0500
committerBen Beltran <ben@nsovocal.com>2015-09-05 14:03:32 -0500
commit4b7b2598e96691530fe31aaf8243a0d0cc1ca9a3 (patch)
treeff01737f7e02b5c2f45249d4a1a00ffca8a7939f /grammars/api-notation.cson
parentcbfc88790b27d31ecd58590db502a09b6f0cac7a (diff)
Adds the API notation grammar
Diffstat (limited to 'grammars/api-notation.cson')
-rw-r--r--grammars/api-notation.cson127
1 files changed, 127 insertions, 0 deletions
diff --git a/grammars/api-notation.cson b/grammars/api-notation.cson
new file mode 100644
index 0000000..8a2b4de
--- /dev/null
+++ b/grammars/api-notation.cson
@@ -0,0 +1,127 @@
+'scopeName': 'source.api-notation'
+'name': 'API Notation'
+'fileTypes': [
+ 'api'
+]
+'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'
+ }