Created
November 18, 2012 15:35
-
-
Save zetachang/4105844 to your computer and use it in GitHub Desktop.
Textmate grammer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bracketed_content = { | |
name = 'meta.bracketed.objc'; | |
begin = '\['; | |
end = '\]'; | |
beginCaptures = { 0 = { name = 'punctuation.section.scope.begin.objc'; }; }; | |
endCaptures = { 0 = { name = 'punctuation.section.scope.end.objc'; }; }; | |
patterns = ( | |
{ name = 'meta.function-call.predicate.objc'; | |
begin = '(?=predicateWithFormat:)(?<=NSPredicate )(predicateWithFormat:)'; | |
end = '(?=\])'; | |
beginCaptures = { | |
1 = { name = 'support.function.any-method.objc'; }; | |
2 = { name = 'punctuation.separator.arguments.objc'; }; | |
}; | |
patterns = ( | |
{ name = 'support.function.any-method.name-of-parameter.objc'; | |
match = '\bargument(Array|s)(:)'; | |
captures = { 1 = { name = 'punctuation.separator.arguments.objc'; }; }; | |
}, | |
{ name = 'invalid.illegal.unknown-method.objc'; | |
match = '\b\w+(:)'; | |
captures = { 1 = { name = 'punctuation.separator.arguments.objc'; }; }; | |
}, | |
{ name = 'string.quoted.double.objc'; | |
begin = '@"'; | |
end = '"'; | |
beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.objc'; }; }; | |
endCaptures = { 0 = { name = 'punctuation.definition.string.end.objc'; }; }; | |
patterns = ( | |
{ name = 'keyword.operator.logical.predicate.cocoa'; | |
match = '\b(AND|OR|NOT|IN)\b'; | |
}, | |
{ name = 'constant.language.predicate.cocoa'; | |
match = '\b(ALL|ANY|SOME|NONE)\b'; | |
}, | |
{ name = 'constant.language.predicate.cocoa'; | |
match = '\b(NULL|NIL|SELF|TRUE|YES|FALSE|NO|FIRST|LAST|SIZE)\b'; | |
}, | |
{ name = 'keyword.operator.comparison.predicate.cocoa'; | |
match = '\b(MATCHES|CONTAINS|BEGINSWITH|ENDSWITH|BETWEEN)\b'; | |
}, | |
{ name = 'keyword.other.modifier.predicate.cocoa'; | |
match = '\bC(ASEINSENSITIVE|I)\b'; | |
}, | |
{ name = 'keyword.other.predicate.cocoa'; | |
match = '\b(ANYKEY|SUBQUERY|CAST|TRUEPREDICATE|FALSEPREDICATE)\b'; | |
}, | |
{ name = 'constant.character.escape.objc'; | |
match = '\\(\\|[abefnrtv''"?]|[0-3]\d{,2}|[4-7]\d?|x[a-zA-Z0-9]+)'; | |
}, | |
{ name = 'invalid.illegal.unknown-escape.objc'; | |
match = '\\.'; | |
}, | |
); | |
}, | |
{ include = '#special_variables'; }, | |
{ include = '#c_functions'; }, | |
{ include = '$base'; }, | |
); | |
}, | |
{ name = 'meta.function-call.objc'; | |
begin = '(?=\w)(?<=[\w\])"] )(\w+(?:(:)|(?=\])))'; | |
end = '(?=\])'; | |
beginCaptures = { | |
1 = { name = 'support.function.any-method.objc'; }; | |
2 = { name = 'punctuation.separator.arguments.objc'; }; | |
}; | |
patterns = ( | |
{ name = 'support.function.any-method.name-of-parameter.objc'; | |
match = '\b\w+(:)'; | |
captures = { 1 = { name = 'punctuation.separator.arguments.objc'; }; }; | |
}, | |
{ include = '#special_variables'; }, | |
{ include = '#c_functions'; }, | |
{ include = '$base'; }, | |
); | |
}, | |
{ include = '#special_variables'; }, | |
{ include = '#c_functions'; }, | |
{ include = '$self'; }, | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment