syntax highlite stuff



moin,

here's two patches:

the first makes mcedit recognize certain languages when the interpreter
is invoked with /usr/bin/env. please commit.

the idea for the second patch was already suggested ... the split off
of c from c++. the difference is only the list of keywords. copy the old
c.syntax to cxx.syntax and apply the patch to get the desired effect.
unfortunately header files are always declared c++ files. not doing so
would require integration with the editor's search function and looking
for something like '^\s*class\s'.

-- 
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
--
Chaos, panic, and disorder - my work here is done.
Index: Syntax
===================================================================
RCS file: /cvsroot/mc/mc/syntax/Syntax,v
retrieving revision 1.27
diff -U2 -r1.27 Syntax
--- Syntax	3 Nov 2004 20:16:48 -0000	1.27
+++ Syntax	20 Feb 2005 09:42:01 -0000
@@ -30,14 +30,14 @@
 include lsm.syntax
 
-file ..\*\\.sh$ Shell\sScript ^#!\s\*/.\*/([a-z]?|ba|pdk)sh
+file ..\*\\.sh$ Shell\sScript ^#!\s\*/(.\*/|usr/bin/env\s)([a-z]?|ba|pdk)sh
 include sh.syntax
 
-file ..\*\\.(pl|PL|pm|PM)$ Perl\sProgram ^#!\s\*(/.\*/perl|@PERL@)
+file ..\*\\.(pl|PL|pm|PM)$ Perl\sProgram ^#!\s\*(/(.\*/|usr/bin/env\s)perl|@PERL@)
 include perl.syntax
 
-file ..\*\\.(py|PY)$ Python\sProgram ^#!\s\*/.\*/python
+file ..\*\\.(py|PY)$ Python\sProgram ^#!\s\*/(.\*/|usr/bin/env\s)python
 include python.syntax
 
-file ..\*\\.(rb|RB)$ Ruby\sProgram ^#!\s\*/.\*/ruby
+file ..\*\\.(rb|RB)$ Ruby\sProgram ^#!\s\*/(.\*/|usr/bin/env\s)ruby
 include ruby.syntax
 
Index: Makefile.am
===================================================================
RCS file: /cvsroot/mc/mc/syntax/Makefile.am,v
retrieving revision 1.22
diff -U2 -r1.22 Makefile.am
--- Makefile.am	6 Dec 2004 23:14:43 -0000	1.22
+++ Makefile.am	20 Feb 2005 09:42:01 -0000
@@ -4,4 +4,5 @@
 	aspx.syntax		\
 	c.syntax		\
+	cxx.syntax		\
 	cs.syntax		\
 	changelog.syntax	\
Index: Syntax
===================================================================
RCS file: /cvsroot/mc/mc/syntax/Syntax,v
retrieving revision 1.27
diff -U2 -r1.27 Syntax
--- Syntax	3 Nov 2004 20:16:48 -0000	1.27
+++ Syntax	20 Feb 2005 09:42:01 -0000
@@ -69,7 +69,10 @@
 include texinfo.syntax
 
-file ..\*\\.([chC]|CC|cxx|cc|cpp|CPP|CXX|hxx|h\.in)$ C/C\+\+\sProgram
+file ..\*\\.c$ C\sProgram
 include c.syntax
 
+file ..\*\\.([hC]|CC|cxx|cc|cpp|CPP|CXX|hxx|h\.in)$ C/C\+\+\sProgram
+include cxx.syntax
+
 file ..\*\\.[fF]$ Fortran\sProgram
 include fortran.syntax
Index: c.syntax
===================================================================
RCS file: /cvsroot/mc/mc/syntax/c.syntax,v
retrieving revision 1.15
diff -U2 -r1.15 c.syntax
--- c.syntax	15 Mar 2003 04:41:20 -0000	1.15
+++ c.syntax	20 Feb 2005 09:42:01 -0000
@@ -33,32 +33,5 @@
     keyword whole while yellow
     keyword whole asm yellow
-    keyword whole catch yellow
-    keyword whole class yellow
-    keyword whole friend yellow
-    keyword whole delete yellow
     keyword whole inline yellow
-    keyword whole new yellow
-    keyword whole operator yellow
-    keyword whole private yellow
-    keyword whole protected yellow
-    keyword whole public yellow
-    keyword whole this yellow
-    keyword whole throw yellow
-    keyword whole template yellow
-    keyword whole try yellow
-    keyword whole virtual yellow
-    keyword whole bool yellow
-    keyword whole const_cast yellow
-    keyword whole dynamic_cast yellow
-    keyword whole explicit yellow
-    keyword whole false yellow
-    keyword whole mutable yellow
-    keyword whole namespace yellow
-    keyword whole reinterpret_cast yellow
-    keyword whole static_cast yellow
-    keyword whole true yellow
-    keyword whole typeid yellow
-    keyword whole typename yellow
-    keyword whole using yellow
     keyword whole wchar_t yellow
     keyword whole ... yellow


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]