From: Ben Beltran Date: Sat, 5 Sep 2015 20:10:05 +0000 (-0500) Subject: Adds YAML source and tmLanguage result X-Git-Url: https://git.r.bdr.sh/rbdr/api-notation.tmLanguage/commitdiff_plain/28681b371a111611fef6dac6581d86af45cba0c7?ds=inline Adds YAML source and tmLanguage result --- diff --git a/api-notation.YAML-tmLanguage b/api-notation.YAML-tmLanguage new file mode 100644 index 0000000..e1f8462 --- /dev/null +++ b/api-notation.YAML-tmLanguage @@ -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 index 0000000..a7200de --- /dev/null +++ b/api-notation.tmLanguage @@ -0,0 +1,209 @@ + + + + + fileTypes + + api + + name + API Notation + 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 + + apiMember + + captures + + 1 + + name + keyword.control + + 2 + + name + variable.language + + + match + ((?:<\\+)|(?:<\\~)|(?:<\\-)|(?:\\+>)|(?:\\~>)|(?:\\->)|\\-|\\+|(?:::)|#)([a-zA-z0-9_]+) + + comment + + match + [ \t]*//[ \t]*.* + name + comment.line + + dataType + + match + [a-zA-Z0-9_.]+ + name + support.function + + dataTypes + + begin + \\< + end + \\> + name + keyword.operator + patterns + + + include + #dataType + + + include + #separators + + + + operators + + match + (?:\\->)|(?:\\=>) + name + keyword.control + + optionalParameter + + match + [a-zA-Z0-9_.]+ + name + meta.separator + + optionalParameters + + begin + \\[ + end + \\] + patterns + + + include + #optionalParameter + + + + parameterList + + begin + \\( + end + \\) + name + keyword.operator + patterns + + + include + #parameters + + + include + #optionalParameters + + + include + #dataTypes + + + include + #separators + + + + parameters + + match + [a-zA-Z0-9_.]+ + name + string.other + + separators + + match + \\||, + name + comment.line + + + scopeName + source.api-notation + uuid + fc8dc5cf-b7aa-4b64-a665-80e8dc1b2553 + +