SF.net SVN: geany: [2078] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Thu Nov 29 18:24:09 UTC 2007


Revision: 2078
          http://geany.svn.sourceforge.net/geany/?rev=2078&view=rev
Author:   eht16
Date:     2007-11-29 10:24:06 -0800 (Thu, 29 Nov 2007)

Log Message:
-----------
Use Ruby parser from CTags SVN and add/fix symbol list sections.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/symbols.c
    trunk/tagmanager/ruby.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-11-29 18:21:12 UTC (rev 2077)
+++ trunk/ChangeLog	2007-11-29 18:24:06 UTC (rev 2078)
@@ -12,6 +12,8 @@
    Add line and column number in charset conversion error dialog when
    saving a file and improve display of the failed character.
  * src/build.c: Fix broken Run command on Java files on Windows.
+ * src/symbols.c, tagmanager/ruby.c:
+   Use Ruby parser from CTags SVN and add/fix symbol list sections.
 
 
 2007-11-27  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>

Modified: trunk/src/symbols.c
===================================================================
--- trunk/src/symbols.c	2007-11-29 18:21:12 UTC (rev 2077)
+++ trunk/src/symbols.c	2007-11-29 18:24:06 UTC (rev 2078)
@@ -199,6 +199,7 @@
 	{
 		case GEANY_FILETYPES_C:	// for C++ .h headers or C structs
 		case GEANY_FILETYPES_CPP:
+		//~ case GEANY_FILETYPES_RUBY: // not sure what to use atm
 		{
 			static gchar cc[] = "::";
 
@@ -597,12 +598,10 @@
 		case GEANY_FILETYPES_RUBY:
 		{
 			tag_list_add_groups(tag_store,
+				&(tv_iters.tag_namespace), _("Modules"), NULL,
 				&(tv_iters.tag_class), _("Classes"), "classviewer-class",
-				&(tv_iters.tag_member), _("Singletons"), NULL,
-				&(tv_iters.tag_macro), _("Mixins"), NULL,
+				&(tv_iters.tag_member), _("Singletons"), "classviewer-struct",
 				&(tv_iters.tag_function), _("Methods"), "classviewer-method",
-				&(tv_iters.tag_struct), _("Members"), "classviewer-member",
-				&(tv_iters.tag_variable), _("Variables"), "classviewer-var",
 				NULL);
 				//&(tv_iters.tag_namespace), _("Begin"),
 				//&(tv_iters.tag_other), _("Other"), NULL);

Modified: trunk/tagmanager/ruby.c
===================================================================
--- trunk/tagmanager/ruby.c	2007-11-29 18:21:12 UTC (rev 2077)
+++ trunk/tagmanager/ruby.c	2007-11-29 18:24:06 UTC (rev 2078)
@@ -1,5 +1,5 @@
 /*
-*   $Id$
+*   $Id: ruby.c 571 2007-06-24 23:32:14Z elliotth $
 *
 *   Copyright (c) 2000-2001, Thaddeus Covert <sahuagin at mediaone.net>
 *   Copyright (c) 2002 Matthias Veit <matthias_veit at yahoo.de>
@@ -37,8 +37,8 @@
 static kindOption RubyKinds [] = {
 	{ TRUE, 'c', "class",  "classes" },
 	{ TRUE, 'f', "method", "methods" },
-	{ TRUE, 'm', "module", "modules" },
-	{ TRUE, 'F', "singleton method", "singleton methods" }
+	{ TRUE, 'm', "namespace", "modules" },
+	{ TRUE, 'F', "member", "singleton methods" }
 };
 
 static stringList* nesting = 0;
@@ -346,7 +346,7 @@
 
 		while (*cp != '\0')
 		{
-			/* FIXME: we don't cope with here documents, or string literals,
+			/* FIXME: we don't cope with here documents,
 			* or regular expression literals, or ... you get the idea.
 			* Hopefully, the restriction above that insists on seeing
 			* definitions at the starts of lines should keep us out of
@@ -372,8 +372,17 @@
 			{
 				/* Leave the most recent scope. */
 				vStringDelete (stringListLast (nesting));
-			stringListRemoveLast (nesting);
+				stringListRemoveLast (nesting);
 			}
+			else if (*cp == '"')
+			{
+				/* Skip string literals.
+				 * FIXME: should cope with escapes and interpolation.
+				 */
+				do {
+					++cp;
+				} while (*cp != 0 && *cp != '"');
+			}
 			else if (*cp != '\0')
 			{
 				do
@@ -387,7 +396,7 @@
 
 extern parserDefinition* RubyParser (void)
 {
-	static const char *const extensions [] = { "rb", "ruby", "rhtml", NULL };
+	static const char *const extensions [] = { "rb", "ruby", NULL };
 	parserDefinition* def = parserNew ("Ruby");
 	def->kinds      = RubyKinds;
 	def->kindCount  = KIND_COUNT (RubyKinds);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list