Kaydet (Commit) 967dc341 authored tarafından Nick Treleaven's avatar Nick Treleaven

Merged tagmanager/d.c with tagmanager/c.c, which also adds user function calltips support for D

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@741 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 0f82b3d4
...@@ -13,8 +13,11 @@ ...@@ -13,8 +13,11 @@
Add dialogs_show_question_full for custom buttons and extra text. Add dialogs_show_question_full for custom buttons and extra text.
Don't show message dialogs in the window manager taskbar. Don't show message dialogs in the window manager taskbar.
* src/utils.c: Use Reload button for utils_check_disk_status dialog. * src/utils.c: Use Reload button for utils_check_disk_status dialog.
* src/callbacks.c: Use Reload button for reload dialog. * src/callbacks.c: Improve Reload and Quit dialog.
Share on_reload_as_activate code for reloading. Share on_reload_as_activate code for reloading.
* tagmanager/d.c, tagmanager/c.c, tagmanager/Makefile.am:
Merged tagmanager/d.c with tagmanager/c.c, which also adds user
function calltips support for D.
2006-08-17 Nick Treleaven <nick.treleaven@btinternet.com> 2006-08-17 Nick Treleaven <nick.treleaven@btinternet.com>
......
...@@ -27,7 +27,6 @@ libtagmanager_a_SOURCES =\ ...@@ -27,7 +27,6 @@ libtagmanager_a_SOURCES =\
args.c\ args.c\
args.h\ args.h\
c.c\ c.c\
d.c\
conf.c\ conf.c\
css.c\ css.c\
docbook.c\ docbook.c\
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* This source code is released for free distribution under the terms of the * This source code is released for free distribution under the terms of the
* GNU General Public License. * GNU General Public License.
* *
* This module contains functions for parsing and scanning C, C++ and Java * This module contains functions for parsing and scanning C, C++, D and Java
* source files. * source files.
*/ */
...@@ -233,6 +233,7 @@ static jmp_buf Exception; ...@@ -233,6 +233,7 @@ static jmp_buf Exception;
static langType Lang_c; static langType Lang_c;
static langType Lang_cpp; static langType Lang_cpp;
static langType Lang_java; static langType Lang_java;
static langType Lang_d;
/* Used to index into the CKinds table. */ /* Used to index into the CKinds table. */
typedef enum { typedef enum {
...@@ -819,7 +820,7 @@ static tagType declToTagType (const declType declaration) ...@@ -819,7 +820,7 @@ static tagType declToTagType (const declType declaration)
static const char* accessField (const statementInfo *const st) static const char* accessField (const statementInfo *const st)
{ {
const char* result = NULL; const char* result = NULL;
if (isLanguage (Lang_cpp) && st->scope == SCOPE_FRIEND) if ((isLanguage (Lang_cpp) || isLanguage (Lang_d)) && st->scope == SCOPE_FRIEND)
result = "friend"; result = "friend";
else if (st->member.access != ACCESS_UNDEFINED) else if (st->member.access != ACCESS_UNDEFINED)
result = accessString (st->member.access); result = accessString (st->member.access);
...@@ -866,7 +867,7 @@ static void addOtherFields (tagEntryInfo* const tag, const tagType type, ...@@ -866,7 +867,7 @@ static void addOtherFields (tagEntryInfo* const tag, const tagType type,
vStringValue (st->parentClasses); vStringValue (st->parentClasses);
} }
if (st->implementation != IMP_DEFAULT && if (st->implementation != IMP_DEFAULT &&
(isLanguage (Lang_cpp) || isLanguage (Lang_java))) (isLanguage (Lang_cpp) || isLanguage (Lang_java) || isLanguage (Lang_d)))
{ {
tag->extensionFields.implementation = tag->extensionFields.implementation =
implementationString (st->implementation); implementationString (st->implementation);
...@@ -900,7 +901,7 @@ static void addOtherFields (tagEntryInfo* const tag, const tagType type, ...@@ -900,7 +901,7 @@ static void addOtherFields (tagEntryInfo* const tag, const tagType type,
static void addContextSeparator (vString *const scope) static void addContextSeparator (vString *const scope)
{ {
if (isLanguage (Lang_c) || isLanguage (Lang_cpp)) if (isLanguage (Lang_c) || isLanguage (Lang_cpp) || isLanguage (Lang_d))
vStringCatS (scope, "::"); vStringCatS (scope, "::");
else if (isLanguage (Lang_java)) else if (isLanguage (Lang_java))
vStringCatS (scope, "."); vStringCatS (scope, ".");
...@@ -1426,7 +1427,7 @@ static void setAccess (statementInfo *const st, const accessType access) ...@@ -1426,7 +1427,7 @@ static void setAccess (statementInfo *const st, const accessType access)
{ {
if (isMember (st)) if (isMember (st))
{ {
if (isLanguage (Lang_cpp)) if (isLanguage (Lang_cpp) || isLanguage (Lang_d))
{ {
int c = skipToNonWhite (); int c = skipToNonWhite ();
...@@ -1981,7 +1982,7 @@ static void addContext (statementInfo *const st, const tokenInfo* const token) ...@@ -1981,7 +1982,7 @@ static void addContext (statementInfo *const st, const tokenInfo* const token)
{ {
if (vStringLength (st->context->name) > 0) if (vStringLength (st->context->name) > 0)
{ {
if (isLanguage (Lang_c) || isLanguage (Lang_cpp)) if (isLanguage (Lang_c) || isLanguage (Lang_cpp) || isLanguage (Lang_d))
vStringCatS (st->context->name, "::"); vStringCatS (st->context->name, "::");
else if (isLanguage (Lang_java)) else if (isLanguage (Lang_java))
vStringCatS (st->context->name, "."); vStringCatS (st->context->name, ".");
...@@ -2004,7 +2005,7 @@ static void processColon (statementInfo *const st) ...@@ -2004,7 +2005,7 @@ static void processColon (statementInfo *const st)
else else
{ {
cppUngetc (c); cppUngetc (c);
if (isLanguage (Lang_cpp) && ( if ((isLanguage (Lang_cpp) || isLanguage (Lang_d)) && (
st->declaration == DECL_CLASS || st->declaration == DECL_STRUCT)) st->declaration == DECL_CLASS || st->declaration == DECL_STRUCT))
{ {
readParents (st, ':'); readParents (st, ':');
...@@ -2403,6 +2404,12 @@ static void initializeJavaParser (const langType language) ...@@ -2403,6 +2404,12 @@ static void initializeJavaParser (const langType language)
buildKeywordHash (language, 2); buildKeywordHash (language, 2);
} }
static void initializeDParser (const langType language)
{
Lang_d = language;
buildKeywordHash (language, 17);
}
extern parserDefinition* CParser (void) extern parserDefinition* CParser (void)
{ {
static const char *const extensions [] = { "c", "pc", "sc", NULL }; static const char *const extensions [] = { "c", "pc", "sc", NULL };
...@@ -2446,4 +2453,17 @@ extern parserDefinition* JavaParser (void) ...@@ -2446,4 +2453,17 @@ extern parserDefinition* JavaParser (void)
return def; return def;
} }
extern parserDefinition* DParser (void)
{
static const char *const extensions [] = { "d", "di", NULL };
parserDefinition* def = parserNew ("D");
def->kinds = CKinds;
def->kindCount = KIND_COUNT (CKinds);
def->extensions = extensions;
def->parser2 = findCTags;
def->initialize = initializeDParser;
return def;
}
/* vi:set tabstop=8 shiftwidth=4: */ /* vi:set tabstop=8 shiftwidth=4: */
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment