ruby: Fix scope after anonymous classes

This commit is contained in:
Colomban Wendling 2015-07-24 01:24:45 +02:00
parent 1ed29f1d7b
commit 17606d8af7
4 changed files with 18 additions and 0 deletions

View File

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

View File

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

View File

@ -0,0 +1,10 @@
class C
class << self
def foo() end
end
def bar(); end
end
puts C.foo
puts C.new.bar

View File

@ -0,0 +1,4 @@
# format=tagmanager
CÌ1Ö0
barÌ128ÎCÖ0
fooÌ128ÎCÖ0