Skip to content

Instantly share code, notes, and snippets.

@fcy
Created December 2, 2010 14:01
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • 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 <fmcypriano@gmail.com>
# 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

Nice work!

@erikvanzijst
Copy link

Looks like there's a issue with some boundary matches. See the "enumerate" and "caseInsensitiveCompare":

Alt text

@fcy
Copy link
Author

fcy commented Dec 3, 2010

Thanks erikvanzijst! It's now fixed :)

@gitkinjal
Copy link

Is this gist can be used for any git server's SSL authenication with Fisheye and Crucible or only for github? Reply soon.

@fcy
Copy link
Author

fcy commented Jul 27, 2011

This gist can be used to syntax highlight any objective-c file in Fisheye/Crucible no matter what is the origin.

And as far as I know this is already shipped with newer versions of Fisheye/Crucible.

@gitkinjal
Copy link

Ok, That's I can be seen in FishEye version 2.5 and 2.6...There is topic called "FishEye SSL Configuration". Is this the same which you are telling about?

@fcy
Copy link
Author

fcy commented Jul 27, 2011

Probably not, this file is about syntax highlighting not SSL.

@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