diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2016-09-08 20:25:51 +0200 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2016-10-06 17:45:39 +0200 |
commit | 208232aba52903ae090711589e9c572dc5347651 (patch) | |
tree | 886a60bfa36e690ee81c947bc7d50331affc1bf8 /src/dotty/tools/dotc/core/Contexts.scala | |
parent | af27562040631d0bea38ec3ff8912fda9939f34e (diff) | |
download | dotty-208232aba52903ae090711589e9c572dc5347651.tar.gz dotty-208232aba52903ae090711589e9c572dc5347651.tar.bz2 dotty-208232aba52903ae090711589e9c572dc5347651.zip |
Implement docbase as property
Diffstat (limited to 'src/dotty/tools/dotc/core/Contexts.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Contexts.scala | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/core/Contexts.scala b/src/dotty/tools/dotc/core/Contexts.scala index 3378f0790..bf171bf60 100644 --- a/src/dotty/tools/dotc/core/Contexts.scala +++ b/src/dotty/tools/dotc/core/Contexts.scala @@ -69,6 +69,9 @@ object Contexts { /** The context base at the root */ val base: ContextBase + /** Documentation base */ + def getDocbase = property(DocContext) + /** All outer contexts, ending in `base.initialCtx` and then `NoContext` */ def outersIterator = new Iterator[Context] { var current = thiscontext @@ -537,9 +540,6 @@ object Contexts { /** The symbol loaders */ val loaders = new SymbolLoaders - /** Documentation base */ - val docbase = new DocBase - /** The platform, initialized by `initPlatform()`. */ private var _platform: Platform = _ @@ -578,6 +578,7 @@ object Contexts { } } + val DocContext = new Key[DocBase] class DocBase { private[this] val _docstrings: mutable.Map[Symbol, Comment] = mutable.Map.empty @@ -597,7 +598,7 @@ object Contexts { * map of `String -> AnyRef` */ private[this] val _packages: mutable.Map[String, AnyRef] = mutable.Map.empty - def packages[A]: mutable.Map[String, A] = _packages.asInstanceOf[mutable.Map[String, A]] + def packagesAs[A]: mutable.Map[String, A] = _packages.asInstanceOf[mutable.Map[String, A]] /** Should perhaps factorize this into caches that get flushed */ private var _defs: Map[Symbol, Set[Symbol]] = Map.empty |