Skip to content

Instantly share code, notes, and snippets.

@fcy
Created December 2, 2010 14:01
Show Gist options
  • Save fcy/725333 to your computer and use it in GitHub Desktop.
Save fcy/725333 to your computer and use it in GitHub Desktop.
Syntax highlight definition for Atlassian Fisheye and Crucible. Save the file in <FISHEYE_INST>/syntax and update <FISHEYE_INST>/syntax/filemap to objective-c file extensions.
# Objective-C Syntax Highliht for Atlassian Fisheye and Crucible
# Based on Atlassian's C syntax highlight
# Author: Felipe Cypriano <[email protected]>
# Copyright 2010 Felipe Cypriano
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
syntaxdef objectivec {
/\s+/m : ;
# keywords
/(@(c(atch|lass)|dynamic|en(code|d)|finally|i(mplementation|nterface)|p(r(ivate|otected)|ublic)|s(elector|ynthesize)|t(hrow|ry))|\
auto|break|c(a(se|tch)|har|lass|o(py|n(st|tinue)))|d(efault|o(|uble))|\
e(lse|num|xtern)|f(loat|or)|goto|i(f|nt)|long|n(il|onatomic)|re(adonly|adwrite|gister|turn)|\
s(elf|hort|i(gned|zeof)|t(atic|ruct)|uper|witch)|t(rue|ypedef)|un(ion|signed|til)|\
vo(id|latile)|while|\
BOOL|FALSE|IB(Action|Outlet)|N(O|ULL)|SEL|TRUE|YES)\b/ : {
region {
type=keyword;
index=word;
}
}
# preprocessor line
/^#.*$/m : {
region {
type=keyword;
}
}
# char literal
/L?'(\\.|\\[0-7]{3}|\\x[0-9a-fA-F]{2}|.)'/ : {
region {
type=char_literal;
}
}
# string literal
/L?"/ : {
context {
/\\./: ;
/$/m : exit;
"\"" : exit;
}
region ${ALL} {
type=string;
}
}
#numeric literal
/(0x[0-9a-f]+(lu|ul|[ul])?)|((([0-9]+\.?)|([0-9]*\.[0-9]+))(e(\+|-)?[0-9]+)?(fl|lf|[lf])?)/i : {
region {
type=numeric;
}
}
# identifier
/[a-zA-Z_][a-zA-Z_0-9]*/ : {
region {
type=identifier;
index=word;
}
}
# comment
/\/\*.*?\*\//s : {
region {
type=comment;
index=prose;
findlinks=true;
}
}
# inline comment
/\/\/.*$/m : {
region {
type=comment;
index=prose;
findlinks=true;
}
}
}
@erikvanzijst
Copy link

Indeed, this is a syntax definition. Nothing else. Also, this gist was already pulled into FishEye.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment