[geany/geany] e46093: Ruby: delete rspec related kinds

Masatake YAMATO git-noreply at xxxxx
Mon Mar 14 18:49:47 UTC 2016


Branch:      refs/heads/master
Author:      Masatake YAMATO <yamato at redhat.com>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Mon, 14 Mar 2016 18:49:47 UTC
Commit:      e46093d1fcd4209f509314aaeb9ff8ebea1f4651
             https://github.com/geany/geany/commit/e46093d1fcd4209f509314aaeb9ff8ebea1f4651

Log Message:
-----------
Ruby: delete rspec related kinds

Close universal-ctags/ctags#453.

(This is about a bug spotted in universal-ctags/ctags#453 by @mislav and
 in universal-ctags/ctags#11 by @NewAlexandria.)

Kinds C and d are for Rspec.

Parts of code related to above kinds assume a ruby string
comes after Rspec keywords (describe or context).

This is a wrong assumption. A class name can be used there.

It is nice if ctags can handle these rspec code well, but we
don't have enough resource to make it now.

So in this commit I delete rspec related code temporary. I
just reserve a kind letter 'd' for rspec for the future. 'C'
is completely deleted because (1) describe and context have
the same meaning in rspec, and (2) we would like to assign
'C' for Ruby constant as ripper-tags does.

Signed-off-by: Masatake YAMATO <yamato at redhat.com>


Modified Paths:
--------------
    tagmanager/ctags/ruby.c

Modified: tagmanager/ctags/ruby.c
21 lines changed, 6 insertions(+), 15 deletions(-)
===================================================================
@@ -27,7 +27,7 @@
 *   DATA DECLARATIONS
 */
 typedef enum {
-	K_UNDEFINED = -1, K_CLASS, K_METHOD, K_MODULE, K_SINGLETON, K_DESCRIBE, K_CONTEXT
+	K_UNDEFINED = -1, K_CLASS, K_METHOD, K_MODULE, K_SINGLETON,
 } rubyKind;
 
 /*
@@ -38,8 +38,11 @@ static kindOption RubyKinds [] = {
 	{ TRUE, 'f', "method", "methods" },
 	{ TRUE, 'm', "namespace", "modules" },
 	{ TRUE, 'F', "member", "singleton methods" },
-	{ TRUE, 'd', "describe", "describes" },
-	{ TRUE, 'C', "context", "contexts" }
+#if 0
+	/* Following two kinds are reserved. */
+	{ TRUE, 'd', "describe", "describes and contexts for Rspec" },
+	{ TRUE, 'C', "constant", "constants" },
+#endif
 };
 
 static NestingLevels* nesting = NULL;
@@ -263,10 +266,6 @@ static rubyKind parseIdentifier (
 	{
 		also_ok = "?!=";
 	}
-	else if (kind == K_DESCRIBE || kind == K_CONTEXT)
-	{
-		also_ok = " ,\".#?!='/-";
-	}
 	else
 	{
 		also_ok = "";
@@ -479,14 +478,6 @@ static void findRubyTags (void)
 
 			readAndEmitTag (&cp, kind);
 		}
-		else if (canMatchKeyword (&cp, "describe"))
-		{
-			readAndEmitTag (&cp, K_DESCRIBE);
-		}
-		else if (canMatchKeyword (&cp, "context"))
-		{
-			readAndEmitTag (&cp, K_CONTEXT);
-		}
 
 		while (*cp != '\0')
 		{



--------------
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