lib/rouge/namespace.rb in rouge-lang-0.0.6 vs lib/rouge/namespace.rb in rouge-lang-0.0.7
- old
+ new
@@ -26,10 +26,11 @@
if ns.name == @name
raise RecursiveNamespaceError, "#@name will not refer #{ns.name}"
end
@refers << ns if not @refers.include? ns
+ self
end
def [](key)
if @table.include? key
return @table[key]
@@ -75,9 +76,13 @@
r = @namespaces[ns]
return r if r
self[ns] = new(ns)
@namespaces[ns] = new(ns)
+ end
+
+ def get(ns)
+ @namespaces[ns]
end
def []=(ns, value)
@namespaces[ns] = value
end