aboutsummaryrefslogtreecommitdiff
path: root/doc-tool/src/dotty/tools/dottydoc/DocCompiler.scala
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2017-01-03 10:47:59 +0100
committerFelix Mulder <felix.mulder@gmail.com>2017-01-31 14:28:08 +0100
commit198464a0ef18b3d394a2fd456b98f53c3e95d2e1 (patch)
treef165ec3010e4c71f8e0df1a288af2d95b8fc3582 /doc-tool/src/dotty/tools/dottydoc/DocCompiler.scala
parent25fde7896d27f31d2c1c0adfbff8e2b3e390ceaa (diff)
downloaddotty-198464a0ef18b3d394a2fd456b98f53c3e95d2e1.tar.gz
dotty-198464a0ef18b3d394a2fd456b98f53c3e95d2e1.tar.bz2
dotty-198464a0ef18b3d394a2fd456b98f53c3e95d2e1.zip
Split Dottydoc.scala into separate files
Diffstat (limited to 'doc-tool/src/dotty/tools/dottydoc/DocCompiler.scala')
-rw-r--r--doc-tool/src/dotty/tools/dottydoc/DocCompiler.scala35
1 files changed, 35 insertions, 0 deletions
diff --git a/doc-tool/src/dotty/tools/dottydoc/DocCompiler.scala b/doc-tool/src/dotty/tools/dottydoc/DocCompiler.scala
new file mode 100644
index 000000000..af4aaae4f
--- /dev/null
+++ b/doc-tool/src/dotty/tools/dottydoc/DocCompiler.scala
@@ -0,0 +1,35 @@
+package dotty.tools
+package dottydoc
+
+import core._
+import core.transform._
+import dotc.core.Phases.Phase
+import dotc.Compiler
+
+/** Custom Compiler with phases for the documentation tool
+ *
+ * The idea here is to structure `dottydoc` around the new infrastructure. As
+ * such, dottydoc will itself be a compiler. It will, however, produce a format
+ * that can be used by other tools or web-browsers.
+ *
+ * Example:
+ * 1. Use the existing FrontEnd to typecheck the code being fed to dottydoc,
+ * wihtout discarding AnyVal interfaces
+ * 2. Create an AST that is serializable
+ * 3. Serialize to JS object
+ */
+class DocCompiler extends Compiler {
+ override def phases: List[List[Phase]] = List(
+ List(new DocFrontEnd),
+ List(new DocImplicitsPhase),
+ List(new DocASTPhase),
+ List(DocMiniTransformations(new UsecasePhase,
+ new DocstringPhase,
+ new LinkReturnTypes,
+ new LinkParamListTypes,
+ new LinkImplicitlyAddedTypes,
+ new LinkSuperTypes,
+ new AlternateConstructors,
+ new SortMembers))
+ )
+}