diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2017-02-02 15:46:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-02 15:46:39 +0100 |
commit | 3e65cff0caf4c671d3cf98da347792c85a4ac2de (patch) | |
tree | 415cfd9ac0601ceef6856e8873dcb384bb00abc3 /compiler/src/dotty/tools/dotc | |
parent | fc031140ec00f2bfdc79456e1de9e15ae7df8d9a (diff) | |
parent | 6a2d1e0eb1005aa2e3567f256c6e259ede2f6ea7 (diff) | |
download | dotty-3e65cff0caf4c671d3cf98da347792c85a4ac2de.tar.gz dotty-3e65cff0caf4c671d3cf98da347792c85a4ac2de.tar.bz2 dotty-3e65cff0caf4c671d3cf98da347792c85a4ac2de.zip |
Merge pull request #1874 from dotty-staging/topic/dottydoc-markdown
[doctool] Add markdown support && Static site generation
Diffstat (limited to 'compiler/src/dotty/tools/dotc')
4 files changed, 38 insertions, 19 deletions
diff --git a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala index 21a6c1165..e4c90789c 100644 --- a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala +++ b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala @@ -101,6 +101,7 @@ class ScalaSettings extends Settings.SettingGroup { val XoldPatmat = BooleanSetting("-Xoldpatmat", "Use the pre-2.10 pattern matcher. Otherwise, the 'virtualizing' pattern matcher is used in 2.10.") val XnoPatmatAnalysis = BooleanSetting("-Xno-patmat-analysis", "Don't perform exhaustivity/unreachability analysis. Also, ignore @switch annotation.") val XfullLubs = BooleanSetting("-Xfull-lubs", "Retains pre 2.10 behavior of less aggressive truncation of least upper bounds.") + val wikiSyntax = BooleanSetting("-Xwiki-syntax", "Retains the Scala2 behavior of using Wiki Syntax in Scaladoc") /** -Y "Private" settings */ @@ -212,11 +213,18 @@ class ScalaSettings extends Settings.SettingGroup { "A directory containing static resources needed for the API documentation" ) - val DocTitle = StringSetting ( - "-Ydoc-title", - "title", - "The overall name of the Scaladoc site", - "" + val siteRoot = StringSetting( + "-siteroot", + "site root", + "A directory containing static files from which to generate documentation", + sys.props("user.dir") + ) + + val projectName = StringSetting ( + "-project", + "project title", + "The name of the project", + sys.props("user.dir").split(sys.props("file.separator")).last ) val DocVersion = StringSetting ( diff --git a/compiler/src/dotty/tools/dotc/core/Phases.scala b/compiler/src/dotty/tools/dotc/core/Phases.scala index d217afed8..44608296a 100644 --- a/compiler/src/dotty/tools/dotc/core/Phases.scala +++ b/compiler/src/dotty/tools/dotc/core/Phases.scala @@ -263,6 +263,13 @@ object Phases { trait Phase extends DotClass { + /** A name given to the `Phase` that can be used to debug the compiler. For + * instance, it is possible to print trees after a given phase using: + * + * ```bash + * $ ./bin/dotc -Xprint:<phaseNameHere> sourceFile.scala + * ``` + */ def phaseName: String /** List of names of phases that should precede this phase */ diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala index 636204f64..ae9122853 100644 --- a/compiler/src/dotty/tools/dotc/core/Types.scala +++ b/compiler/src/dotty/tools/dotc/core/Types.scala @@ -41,9 +41,11 @@ object Types { implicit def eqType: Eq[Type, Type] = Eq - /** The class of types. + /** Main class representing types. + * * The principal subclasses and sub-objects are as follows: * + * ```none * Type -+- ProxyType --+- NamedType ----+--- TypeRef * | | \ * | +- SingletonType-+-+- TermRef @@ -74,6 +76,7 @@ object Types { * +- NoPrefix * +- ErrorType * +- WildcardType + * ``` * * Note: please keep in sync with copy in `docs/docs/internals/type-system.md`. */ diff --git a/compiler/src/dotty/tools/dotc/transform/IsInstanceOfEvaluator.scala b/compiler/src/dotty/tools/dotc/transform/IsInstanceOfEvaluator.scala index 8bc4a2aa9..ebd2ae436 100644 --- a/compiler/src/dotty/tools/dotc/transform/IsInstanceOfEvaluator.scala +++ b/compiler/src/dotty/tools/dotc/transform/IsInstanceOfEvaluator.scala @@ -7,36 +7,37 @@ import core._ import Contexts.Context, Types._, Constants._, Decorators._, Symbols._ import TypeUtils._, TypeErasure._, Flags._ - /** Implements partial evaluation of `sc.isInstanceOf[Sel]` according to: * - * +-------------+----------------------------+----------------------------+------------------+ * | Sel\sc | trait | class | final class | - * +-------------+----------------------------+----------------------------+------------------+ + * | ----------: | :------------------------: | :------------------------: | :--------------: | * | trait | ? | ? | statically known | * | class | ? | false if classes unrelated | statically known | * | final class | false if classes unrelated | false if classes unrelated | statically known | - * +-------------+----------------------------+----------------------------+------------------+ * * This is a generalized solution to raising an error on unreachable match * cases and warnings on other statically known results of `isInstanceOf`. * * Steps taken: * - * 1. evalTypeApply will establish the matrix and choose the appropriate - * handling for the case: - * 2. a) Sel/sc is a value class or scrutinee is `Any` - * b) handleStaticallyKnown - * c) falseIfUnrelated with `scrutinee <:< selector` - * d) handleFalseUnrelated - * e) leave as is (aka `happens`) - * 3. Rewrite according to step taken in `2` + * 1. `evalTypeApply` will establish the matrix and choose the appropriate + * handling for the case: + * - Sel/sc is a value class or scrutinee is `Any` + * - `handleStaticallyKnown` + * - `falseIfUnrelated` with `scrutinee <:< selector` + * - `handleFalseUnrelated` + * - leave as is (`happens`) + * 2. Rewrite according to steps taken in 1 */ class IsInstanceOfEvaluator extends MiniPhaseTransform { thisTransformer => import dotty.tools.dotc.ast.tpd._ - def phaseName = "isInstanceOfEvaluator" + val phaseName = "isInstanceOfEvaluator" + + /** Transforms a [TypeApply](dotty.tools.dotc.ast.Trees.TypeApply) in order to + * evaluate an `isInstanceOf` check according to the rules defined above. + */ override def transformTypeApply(tree: TypeApply)(implicit ctx: Context, info: TransformerInfo): Tree = { val defn = ctx.definitions |