[geany/geany] 17606d: ruby: Fix scope after anonymous classes

Colomban Wendling git-noreply at xxxxx
Mon Mar 14 18:27:22 UTC 2016


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Mon, 14 Mar 2016 18:27:22 UTC
Commit:      17606d8af7daa7f3a25d1eeae9e925955289e417
             https://github.com/geany/geany/commit/17606d8af7daa7f3a25d1eeae9e925955289e417

Log Message:
-----------
ruby: Fix scope after anonymous classes


Modified Paths:
--------------
    tagmanager/ctags/ruby.c
    tests/ctags/Makefile.am
    tests/ctags/ruby-scope-after-anonymous-class.rb
    tests/ctags/ruby-scope-after-anonymous-class.rb.tags

Modified: tagmanager/ctags/ruby.c
3 lines changed, 3 insertions(+), 0 deletions(-)
===================================================================
@@ -49,6 +49,8 @@ static stringList* nesting = NULL;
 *   FUNCTION DEFINITIONS
 */
 
+static void enterUnnamedScope (void);
+
 /*
 * Returns a string describing the scope in 'list'.
 * We record the current scope as a list of entered scopes.
@@ -341,6 +343,7 @@ static void readAndEmitTag (const unsigned char** cp, rubyKind expected_kind)
 			*
 			* For now, we don't create any.
 			*/
+			enterUnnamedScope ();
 		}
 		else
 		{


Modified: tests/ctags/Makefile.am
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -258,6 +258,7 @@ test_sources = \
 	ruby-block-call.rb				\
 	ruby-doc.rb						\
 	ruby-namespaced-class.rb		\
+	ruby-scope-after-anonymous-class.rb	\
 	ruby-sf-bug-364.rb				\
 	rules.t2t						\
 	sample.t2t						\


Modified: tests/ctags/ruby-scope-after-anonymous-class.rb
10 lines changed, 10 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,10 @@
+class C
+  class << self
+    def foo() end
+  end
+  
+  def bar(); end
+end
+
+puts C.foo
+puts C.new.bar


Modified: tests/ctags/ruby-scope-after-anonymous-class.rb.tags
4 lines changed, 4 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,4 @@
+# format=tagmanager
+C�1�0
+bar�128�C�0
+foo�128�C�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