Branch: refs/heads/master Author: Nick Treleaven nick.treleaven@btinternet.com Committer: Nick Treleaven nick.treleaven@btinternet.com Date: Thu, 15 Nov 2012 13:39:53 UTC Commit: e9e41ee47bb2b53e5a42224477d0ea43471e110f https://github.com/geany/geany/commit/e9e41ee47bb2b53e5a42224477d0ea43471e11...
Log Message: ----------- Move D, Vala unique keyword aliases out of keywordTable
Instead put them in initialize*Parser().
Modified Paths: -------------- tagmanager/ctags/c.c
Modified: tagmanager/ctags/c.c 20 files changed, 12 insertions(+), 8 deletions(-) =================================================================== @@ -383,6 +383,7 @@ { TRUE, 's', "struct", "structure names"}, };
+/* Note: some keyword aliases are added in initializeDParser, initializeValaParser */ static const keywordDesc KeywordTable [] = { /* C++ */ /* ANSI C | C# Java */ @@ -392,7 +393,6 @@ /* keyword keyword ID | | | | | | | */ { "__attribute__", KEYWORD_ATTRIBUTE, { 1, 1, 1, 0, 0, 0, 1 } }, { "abstract", KEYWORD_ABSTRACT, { 0, 0, 1, 1, 0, 1, 1 } }, - { "alias", KEYWORD_TYPEDEF, { 0, 0, 0, 0, 0, 0, 1 } }, /* handle like typedef */ { "bad_state", KEYWORD_BAD_STATE, { 0, 0, 0, 0, 1, 0, 0 } }, { "bad_trans", KEYWORD_BAD_TRANS, { 0, 0, 0, 0, 1, 0, 0 } }, { "bind", KEYWORD_BIND, { 0, 0, 0, 0, 1, 0, 0 } }, @@ -415,9 +415,7 @@ { "delete", KEYWORD_DELETE, { 0, 1, 0, 0, 0, 1, 1 } }, { "double", KEYWORD_DOUBLE, { 1, 1, 1, 1, 0, 1, 1 } }, { "else", KEYWORD_ELSE, { 1, 1, 0, 1, 0, 1, 1 } }, - { "ensures", KEYWORD_ATTRIBUTE, { 0, 0, 0, 0, 0, 1, 0 } }, /* ignore */ { "enum", KEYWORD_ENUM, { 1, 1, 1, 1, 1, 1, 1 } }, - { "errordomain", KEYWORD_ENUM, { 0, 0, 0, 0, 0, 1, 0 } }, /* errordomain behaves like enum */ { "event", KEYWORD_EVENT, { 0, 0, 1, 0, 1, 0, 0 } }, { "explicit", KEYWORD_EXPLICIT, { 0, 1, 1, 0, 0, 0, 1 } }, { "extends", KEYWORD_EXTENDS, { 0, 0, 0, 1, 1, 0, 0 } }, @@ -469,7 +467,6 @@ { "public", KEYWORD_PUBLIC, { 0, 1, 1, 1, 1, 1, 1 } }, { "ref", KEYWORD_REF, { 0, 0, 0, 0, 0, 1, 1 } }, { "register", KEYWORD_REGISTER, { 1, 1, 0, 0, 0, 0, 0 } }, - { "requires", KEYWORD_ATTRIBUTE, { 0, 0, 0, 0, 0, 1, 0 } }, /* ignore */ { "return", KEYWORD_RETURN, { 1, 1, 1, 1, 0, 1, 1 } }, { "set", KEYWORD_SET, { 0, 0, 0, 0, 0, 1, 0 } }, { "shadow", KEYWORD_SHADOW, { 0, 0, 0, 0, 1, 0, 0 } }, @@ -498,11 +495,9 @@ { "uint", KEYWORD_UINT, { 0, 0, 1, 0, 0, 1, 1 } }, { "ulong", KEYWORD_ULONG, { 0, 0, 1, 0, 0, 1, 1 } }, { "union", KEYWORD_UNION, { 1, 1, 0, 0, 0, 0, 1 } }, - { "unittest", KEYWORD_BODY, { 0, 0, 0, 0, 0, 0, 1 } }, /* ignore */ { "unsigned", KEYWORD_UNSIGNED, { 1, 1, 1, 0, 0, 0, 1 } }, { "ushort", KEYWORD_USHORT, { 0, 0, 1, 0, 0, 1, 1 } }, { "using", KEYWORD_USING, { 0, 1, 1, 0, 0, 1, 0 } }, - { "version", KEYWORD_NAMESPACE, { 0, 0, 0, 0, 0, 0, 1 } }, /* parse block */ { "virtual", KEYWORD_VIRTUAL, { 0, 1, 1, 0, 1, 1, 0 } }, { "void", KEYWORD_VOID, { 1, 1, 1, 1, 1, 1, 1 } }, { "volatile", KEYWORD_VOLATILE, { 1, 1, 1, 1, 0, 0, 1 } }, @@ -3146,7 +3141,7 @@ static void initializeJavaParser (const langType language)
static void initializeDParser (const langType language) { - /* keyword aliases - some are for parsing like const(Type), some are just + /* treat these like const - some are for parsing like const(Type), some are just * function attributes */ const char *const_aliases[] = {"immutable", "nothrow", "pure", "shared", NULL}; const char **s; @@ -3158,8 +3153,12 @@ static void initializeDParser (const langType language) { addKeyword (*s, language, KEYWORD_CONST); } - /* skip 'static assert' like 'static if' */ + /* other keyword aliases */ + addKeyword ("alias", language, KEYWORD_TYPEDEF); + /* skip 'static assert(...)' like 'static if (...)' */ addKeyword ("assert", language, KEYWORD_IF); + addKeyword ("unittest", language, KEYWORD_BODY); /* ignore */ + addKeyword ("version", language, KEYWORD_NAMESPACE); /* parse block */ }
static void initializeGLSLParser (const langType language) @@ -3184,6 +3183,11 @@ static void initializeValaParser (const langType language) { Lang_vala = language; buildKeywordHash (language, 5); + + /* keyword aliases */ + addKeyword ("ensures", language, KEYWORD_ATTRIBUTE); /* ignore */ + addKeyword ("errordomain", language, KEYWORD_ENUM); /* looks like enum */ + addKeyword ("requires", language, KEYWORD_ATTRIBUTE); /* ignore */ }
extern parserDefinition* CParser (void)
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: TBD).