[geany/geany] 8c0bfb: Add parserNewFull() and use it for selected parsers

Jiří Techet git-noreply at xxxxx
Sat Sep 10 07:26:11 UTC 2016


Branch:      refs/heads/master
Author:      Jiří Techet <techet at gmail.com>
Committer:   Jiří Techet <techet at gmail.com>
Date:        Mon, 01 Aug 2016 16:33:21 UTC
Commit:      8c0bfbb0f388124f601049301e2742bb1d7ccf1b
             https://github.com/geany/geany/commit/8c0bfbb0f388124f601049301e2742bb1d7ccf1b

Log Message:
-----------
Add parserNewFull() and use it for selected parsers

For now just to eliminate diff from parsers, the actual custom file tag
isn't supported (unused by Geany anyway).


Modified Paths:
--------------
    ctags/main/kind.h
    ctags/main/parse.c
    ctags/main/parse.h
    ctags/parsers/objc.c
    ctags/parsers/ruby.c
    ctags/parsers/rust.c
    ctags/parsers/sql.c

Modified: ctags/main/kind.h
2 lines changed, 2 insertions(+), 0 deletions(-)
===================================================================
@@ -12,6 +12,8 @@
 
 #define KIND_NULL    '\0'
 
+#define KIND_FILE_ALT '!'
+
 #define KIND_FILE_DEFAULT 'F'
 #define KIND_FILE_DEFAULT_LONG "file"
 


Modified: ctags/main/parse.c
9 lines changed, 9 insertions(+), 0 deletions(-)
===================================================================
@@ -91,9 +91,18 @@ extern void makeSimpleScopedTag (const vString* const name,
 
 extern parserDefinition* parserNew (const char* name)
 {
+	return parserNewFull (name, 0);
+}
+
+extern parserDefinition* parserNewFull (const char* name, char fileKind)
+{
 	parserDefinition* result = xCalloc (1, parserDefinition);
 	result->name = eStrdup (name);
+
+	/* TODO: implement custom file kind */
 	result->fileKind = &defaultFileKind;
+
+	result->enabled = TRUE;
 	return result;
 }
 


Modified: ctags/main/parse.h
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -95,6 +95,7 @@ extern void makeSimpleTag (const vString* const name, kindOption* const kinds, c
 extern void makeSimpleScopedTag (const vString* const name, kindOption* const kinds, const int kind, const char* scope, const char* scope2, const char *access);
 
 extern parserDefinition* parserNew (const char* name);
+extern parserDefinition* parserNewFull (const char* name, char fileKind);
 extern const char *getLanguageName (const langType language);
 extern kindOption* getLanguageFileKind (const langType language);
 extern langType getNamedLanguage (const char *const name);


Modified: ctags/parsers/objc.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -1124,7 +1124,7 @@ static void objcInitialize (const langType language)
 extern parserDefinition *ObjcParser (void)
 {
 	static const char *const extensions[] = { "m", "h", NULL };
-	parserDefinition *def = parserNew ("ObjectiveC");
+	parserDefinition *def = parserNewFull ("ObjectiveC", KIND_FILE_ALT);
 	def->kinds = ObjcKinds;
 	def->kindCount = ARRAY_SIZE (ObjcKinds);
 	def->extensions = extensions;


Modified: ctags/parsers/ruby.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -545,7 +545,7 @@ static void findRubyTags (void)
 extern parserDefinition* RubyParser (void)
 {
 	static const char *const extensions [] = { "rb", "ruby", NULL };
-	parserDefinition* def = parserNew ("Ruby");
+	parserDefinition* def = parserNewFull ("Ruby", KIND_FILE_ALT);
 	def->kinds      = RubyKinds;
 	def->kindCount  = ARRAY_SIZE (RubyKinds);
 	def->extensions = extensions;


Modified: ctags/parsers/rust.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -973,7 +973,7 @@ static void findRustTags (void)
 extern parserDefinition *RustParser (void)
 {
 	static const char *const extensions[] = { "rs", NULL };
-	parserDefinition *def = parserNew ("Rust");
+	parserDefinition *def = parserNewFull ("Rust", KIND_FILE_ALT);
 	def->kinds = rustKinds;
 	def->kindCount = ARRAY_SIZE (rustKinds);
 	def->extensions = extensions;


Modified: ctags/parsers/sql.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -2339,7 +2339,7 @@ static void findSqlTags (void)
 extern parserDefinition* SqlParser (void)
 {
 	static const char *const extensions [] = { "sql", NULL };
-	parserDefinition* def = parserNew ("SQL");
+	parserDefinition* def = parserNewFull ("SQL", KIND_FILE_ALT);
 	def->kinds		= SqlKinds;
 	def->kindCount	= ARRAY_SIZE (SqlKinds);
 	def->extensions = extensions;



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list