Commit 4b7b2598 authored by Rubén Beltran del Río's avatar Rubén Beltran del Río 🐝

Adds the API notation grammar

parent cbfc8879
'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'
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment