Share

A curses debugger

Tracker: Bugs

5 Support .cp .m .M and .mm extensions in tokenizer - ID: 2806868
Last Update: Attachment added ( mackyle )

.cp is a common C++ source file extension.

.m, .M and .mm are Objective-C/Objective-C++ extensions.

All of these colorized very well by the C tokenizer and should be included
in the c_extensions array in tokenizer.c.

Here is the patch to tokenizer.c (also attached) to add these:

Index: tokenizer.c
===================================================================
--- tokenizer.c (revision 1176)
+++ tokenizer.c (working copy)
@@ -4,7 +4,7 @@
#include <string.h>

/* Some default file extensions */
-char *c_extensions[] = { ".c", ".C", ".cc", ".cpp", ".cxx", ".h", ".hpp"
};
+char *c_extensions[] = { ".c", ".C", ".cc", ".cpp", ".cxx", ".cp", ".h",
".hpp", ".m", ".M", ".mm" };
char *ada_extensions[] = { ".adb", ".ads", ".ada",".ADB", ".ADS", ".ADA"
};

extern int c_lex ( void );


Kyle ( mackyle ) - 2009-06-15 23:04

5

Open

None

Robert Rossi

CGDB

None

Public


Comment ( 1 )




Date: 2009-07-26 04:51
Sender: mackyle

On Jul 21, 2009, at 18:36, Bob Rossi wrote:
> I'd prefer not to do a solution like this. However, if you want to
write
> the entire scanner for the Objective-C++ language, I'll accept it.

An alternative patch (lexer-patch.gz) is attached that provides an
Objective-C/C++ scanner.

It can be applied against revision 929 of
http://cgdb.svn.sourceforge.net/svnroot/cgdb/cgdb/trunk with:

# Set current directory to trunk checkout dir
gunzip -c lexer-patch.gz | patch -p1



Log in to comment.

Attached Files ( 2 )

Filename Description Download
tokenizer.c-patch Add .cp .m .M and .mm extensions to c tokenizer Download
lexer-patch.gz Objective-C/C++ lexer patch Download

Changes ( 3 )

Field Old Value Date By
File Added 336619: lexer-patch.gz 2009-07-26 04:52 mackyle
assigned_to nobody 2009-06-15 23:05 mackyle
File Added 331124: tokenizer.c-patch 2009-06-15 23:04 mackyle