diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2016-09-21 15:02:30 +0200 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2016-10-06 17:45:39 +0200 |
commit | 92536168e9fda4005a8eff54e5ca72cc70fb32e4 (patch) | |
tree | 285d92137cc5c33a0dba3b352b6fa252ed57ce13 /src/dotty/tools/dotc/core/Contexts.scala | |
parent | 208232aba52903ae090711589e9c572dc5347651 (diff) | |
download | dotty-92536168e9fda4005a8eff54e5ca72cc70fb32e4.tar.gz dotty-92536168e9fda4005a8eff54e5ca72cc70fb32e4.tar.bz2 dotty-92536168e9fda4005a8eff54e5ca72cc70fb32e4.zip |
Separate `ContextDocstrings` from `Context` and make it pluggable
Diffstat (limited to 'src/dotty/tools/dotc/core/Contexts.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Contexts.scala | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/dotty/tools/dotc/core/Contexts.scala b/src/dotty/tools/dotc/core/Contexts.scala index bf171bf60..5c9fdaf88 100644 --- a/src/dotty/tools/dotc/core/Contexts.scala +++ b/src/dotty/tools/dotc/core/Contexts.scala @@ -69,9 +69,6 @@ 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 @@ -578,37 +575,6 @@ object Contexts { } } - val DocContext = new Key[DocBase] - class DocBase { - private[this] val _docstrings: mutable.Map[Symbol, Comment] = - mutable.Map.empty - - val templateExpander = new CommentExpander - - def docstrings: Map[Symbol, Comment] = _docstrings.toMap - - def docstring(sym: Symbol): Option[Comment] = _docstrings.get(sym) - - def addDocstring(sym: Symbol, doc: Option[Comment]): Unit = - doc.map(d => _docstrings += (sym -> d)) - - /* - * Dottydoc places instances of `Package` in this map - but we do not want - * to depend on `dottydoc` for the compiler, as such this is defined as a - * map of `String -> AnyRef` - */ - private[this] val _packages: mutable.Map[String, AnyRef] = mutable.Map.empty - 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 - def defs(sym: Symbol): Set[Symbol] = _defs.get(sym).getOrElse(Set.empty) - - def addDef(s: Symbol, d: Symbol): Unit = _defs = (_defs + { - s -> _defs.get(s).map(xs => xs + d).getOrElse(Set(d)) - }) - } - /** The essential mutable state of a context base, collected into a common class */ class ContextState { // Symbols state |