Added Objective-C highlighting

master
Yevgen Muntyan 2007-06-24 17:02:21 -05:00
parent fc42f17c11
commit 2967410fd9
6 changed files with 167 additions and 19 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<medit-project version="1.0" type="C" name="moo">
<active>mingw</active>
<active>debug</active>
<configurations>
<debug>
<build_dir>build/debug</build_dir>
@ -37,7 +37,7 @@
</configure>
</optimized>
</configurations>
<file_selector_dir>/home/muntyan/projects/moo/moo/moopython/</file_selector_dir>
<file_selector_dir>/home/muntyan/projects/moo/moo/mooedit/gtksourceview/upstream/</file_selector_dir>
<run>
<args>-ns</args>
<exe>medit/medit</exe>

View File

@ -4,6 +4,7 @@ langs2 = \
ada.lang \
changelog.lang \
c.lang \
chdr.lang \
cpp.lang \
csharp.lang \
css.lang \
@ -27,6 +28,7 @@ langs2 = \
m4.lang \
makefile.lang \
ms.lang \
objc.lang \
octave.lang \
pascal.lang \
perl.lang \

View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Authors: Marco Barisione, Emanuele Aina
Copyright (C) 2005-2007 Marco Barisione <barisione@gmail.com>
Copyright (C) 2005-2007 Emanuele Aina
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
-->
<language id="chdr" _name="C/C++/ObjC Header" version="2.0" _section="Sources">
<metadata>
<property name="mimetypes">text/x-chdr;text/x-c++hdr</property>
<property name="globs">*.hh;*.hp;*.hpp;*.h++;*.h</property>
<property name="line-comment-start">//</property>
<property name="block-comment-start">/*</property>
<property name="block-comment-end">*/</property>
</metadata>
<definitions>
<context id="chdr">
<include>
<context ref="objc:objc-header"/>
<context ref="cpp:cpp-proper"/>
<context ref="c:c"/>
</include>
</context>
</definitions>
</language>

View File

@ -3,16 +3,14 @@
# "./check.sh" without arguments will validate lang and styles files
# specified here.
langs="c.lang cpp.lang changelog.lang def.lang
html.lang javascript.lang latex.lang
m4.lang makefile.lang xml.lang yacc.lang
sh.lang python.lang perl.lang ada.lang
csharp.lang css.lang desktop.lang fortran.lang
gtkrc.lang haskell.lang idl.lang ini.lang
java.lang octave.lang pascal.lang php.lang
po.lang ruby.lang scheme.lang sql.lang tcl.lang
texinfo.lang gtk-doc.lang dtd.lang dpatch.lang
libtool.lang pkgconfig.lang"
langs="ada.lang changelog.lang chdr.lang c.lang cpp.lang csharp.lang
css.lang def.lang desktop.lang diff.lang dpatch.lang dtd.lang
fortran.lang gap.lang gtk-doc.lang gtkrc.lang haskell.lang
html.lang idl.lang ini.lang java.lang javascript.lang latex.lang
libtool.lang m4.lang makefile.lang ms.lang objc.lang ocaml.lang
octave.lang pascal.lang perl.lang php.lang pkgconfig.lang po.lang
python.lang ruby.lang scheme.lang sh.lang sql.lang tcl.lang
texinfo.lang verilog.lang xml.lang yacc.lang"
styles="gvim.xml kate.xml testdark.xml"

View File

@ -31,14 +31,16 @@
</metadata>
<styles>
<style id="common-defines" _name="Common defines" map-to="c:common-defines"/>
<style id="keyword" _name="Keyword" map-to="c:keyword"/>
<style id="data-type" _name="Data Type" map-to="c:data-type"/>
<style id="common-defines" _name="Common Defines" map-to="c:common-defines"/>
</styles>
<definitions>
<context id="cpp">
<!-- C++-specific stuff (i.e. stuff which is not C) -->
<context id="cpp-proper">
<include>
<context id="keywords" style-ref="c:keyword">
<context id="keywords" style-ref="keyword">
<keyword>and</keyword>
<keyword>and_eq</keyword>
<keyword>bitand</keyword>
@ -71,17 +73,17 @@
<keyword>xor_eq</keyword>
<keyword>class</keyword>
<keyword>inline</keyword>
<keyword>namespace</keyword>
<keyword>typename</keyword>
<keyword>template</keyword>
<keyword>virtual</keyword>
</context>
<context id="types" style-ref="c:data-type">
<context id="types" style-ref="data-type">
<keyword>bool</keyword>
<keyword>explicit</keyword>
<keyword>export</keyword>
<keyword>inline</keyword>
<keyword>mutable</keyword>
<keyword>wchar_t</keyword>
</context>
@ -90,9 +92,14 @@
<keyword>__STDC__</keyword>
<keyword>__cplusplus</keyword>
</context>
</include>
</context>
<!-- actual language definition: C++-specific stuff plus everything from C -->
<context id="cpp">
<include>
<context ref="cpp-proper"/>
<context ref="c:c"/>
</include>
</context>
</definitions>

View File

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Author: Yevgen Muntyan <muntyan@math.tamu.edu>
Copyright (C) 2007 Yevgen Muntyan <muntyan@math.tamu.edu>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
-->
<language id="objc" _name="Objective-C" version="2.0" _section="Sources">
<metadata>
<property name="mimetypes">text/x-objcsrc</property>
<property name="globs">*.m</property>
<property name="line-comment-start">//</property>
<property name="block-comment-start">/*</property>
<property name="block-comment-end">*/</property>
</metadata>
<styles>
<style id="keyword" _name="Keyword" map-to="c:keyword"/>
<style id="data-type" _name="Data Type" map-to="c:data-type"/>
<style id="common-defines" _name="Common Defines" map-to="c:common-defines"/>
</styles>
<definitions>
<!-- ObjC-specific stuff (i.e. stuff which is not C) -->
<context id="objc-header">
<include>
<context id="keywords" style-ref="keyword">
<keyword>\@interface</keyword>
<keyword>\@protocol</keyword>
<keyword>\@implementation</keyword>
<keyword>\@class</keyword>
<keyword>\@end</keyword>
</context>
<context id="types" style-ref="data-type">
<keyword>BOOL</keyword>
</context>
</include>
</context>
<!-- ObjC-specific stuff (i.e. stuff which is not C), which isn't
good to highlight in C headers -->
<context id="objc-source">
<include>
<context id="keywords" style-ref="keyword">
<keyword>nil</keyword>
<keyword>Nil</keyword>
<keyword>private</keyword>
<keyword>protected</keyword>
<keyword>public</keyword>
</context>
<context id="types" style-ref="data-type">
<keyword>apply_t</keyword>
<keyword>Class</keyword>
<keyword>id</keyword>
<keyword>IMP</keyword>
<keyword>MetaClass</keyword>
<keyword>Object</keyword>
<keyword>Protocol</keyword>
<keyword>retval_t</keyword>
<keyword>SEL</keyword>
<keyword>STR</keyword>
<keyword>TypedStream</keyword>
</context>
<context id="common-defines" style-ref="common-defines">
<keyword>METHOD_NULL</keyword>
<keyword>NO</keyword>
<keyword>YES</keyword>
</context>
</include>
</context>
<!-- actual language definition: ObjC-specific stuff plus everything from C -->
<context id="objc">
<include>
<context ref="objc-source"/>
<context ref="objc-header"/>
<context ref="c:c"/>
</include>
</context>
</definitions>
</language>