Skip to content

Move dotty compiler code to compiler.internal #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* Copyright 2005-2013 LAMP/EPFL
* @author Martin Odersky
*/
package dotty.tools
package dotc
package dotty.compiler
package internal

import core.Contexts.Context
import reporting.Reporter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package dotty.tools
package dotc
package dotty.compiler
package internal

import util.SourceFile
import ast.{tpd, untpd}
Expand All @@ -13,4 +13,4 @@ class CompilationUnit(val source: SourceFile) {
var tpdTree: tpd.Tree = tpd.EmptyTree

def isJava = source.file.name.endsWith(".java")
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package dotty.tools
package dotc
package dotty.compiler
package internal

import core._
import Contexts._
Expand Down Expand Up @@ -32,4 +32,4 @@ class Compiler {

def newRun(implicit ctx: Context): Run =
new Run(this)(rootContext)
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
package dotty.tools.dotc

package dotty.compiler
package internal

import config.CompilerCommand
import core.Contexts.{Context, ContextBase}
Expand Down Expand Up @@ -44,5 +46,3 @@ abstract class Driver extends DotClass {
sys.exit(if (process(args).hasErrors) 1 else 0)
}

class FatalError(msg: String) extends Exception

6 changes: 6 additions & 0 deletions src/dotty/compiler/internal/FatalError.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

package dotty.compiler
package internal

class FatalError(msg: String) extends Exception

Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* Copyright 2005-2013 LAMP/EPFL
* @author Martin Odersky
*/
package dotty.tools
package dotc
package dotty.compiler
package internal

import core.Contexts.Context
import reporting.Reporter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package dotty.tools
package dotc
package dotty.compiler
package internal

import core._
import Contexts._, Periods._, Symbols._
Expand Down Expand Up @@ -36,4 +36,4 @@ class Run(comp: Compiler)(implicit ctx: Context) {
r.printSummary
r
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package dotty.tools
package dotc
package dotty.compiler
package internal
package ast

import core._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package dotty.tools
package dotc
package dotty.compiler
package internal
package ast

import core._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package dotty.tools.dotc
package dotty.compiler
package internal
package ast


Expand Down Expand Up @@ -102,4 +103,4 @@ class ExampleTransformer extends PluggableTransformer[Type] {
override def transform(tree: tpd.Tree, ctx: Context) =
super.transform(tree, ctx)
*/
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package dotty.tools
package dotc
package dotty.compiler
package internal
package ast

import core._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package dotty.tools.dotc
package dotty.compiler
package internal
package ast

import core._
Expand Down Expand Up @@ -214,7 +215,7 @@ object Trees {
* which implements copy-on-write. Another use-case is in method interpolateAndAdapt in Typer,
* where we overwrite with a simplified version of the type itself.
*/
private[dotc] def overwriteType(tpe: T) = myTpe = tpe
private[compiler] def overwriteType(tpe: T) = myTpe = tpe

/** The type of the tree. In case of an untyped tree,
* an UnAssignedTypeException is thrown. (Overridden by empty trees)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package dotty.tools
package dotc
package dotty.compiler
package internal
package ast

import core._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package dotty.tools
package dotc
package dotty.compiler
package internal
package ast

import core._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

package dotty.tools.dotc
package dotty.compiler
package internal
package config

import java.io.File
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
package dotty.tools.dotc.config
package dotty.compiler
package internal
package config

object Config {

Expand Down Expand Up @@ -27,4 +29,4 @@ object Config {
* Disadvantage: It might hide inconsistencies, so while debugging it's better to turn it off
*/
final val newMatch = false
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package dotty.tools
package dotc
package dotty.compiler
package internal
package config

import io.{AbstractFile,ClassPath,JavaClassPath,MergedClassPath,DeltaClassPath}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package dotty.tools
package dotc
package dotty.compiler
package internal
package config

import io._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package dotty.tools
package dotc
package dotty.compiler
package internal
package config

import java.net.{ URL, MalformedURLException }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* @author Paul Phillips
*/

package dotty.tools
package dotc
package dotty.compiler
package internal
package config

import io.{ClassPath, AbstractFile}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
package dotty.tools.dotc.config
package dotty.compiler
package internal
package config

object Printers {

Expand All @@ -23,4 +25,4 @@ object Printers {
val gadts = noPrinter
val incremental = noPrinter

}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package dotty.tools
package dotc
package dotty.compiler
package internal
package config

import java.io.{ IOException, PrintWriter }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
package dotty.tools.dotc.config
package dotty.compiler
package internal
package config

import PathResolver.Defaults

Expand Down Expand Up @@ -175,4 +177,4 @@ class ScalaSettings extends Settings.SettingGroup {
val YpresentationLog = StringSetting("-Ypresentation-log", "file", "Log presentation compiler events into file", "")
val YpresentationReplay = StringSetting("-Ypresentation-replay", "file", "Replay presentation compiler events from file", "")
val YpresentationDelay = IntSetting("-Ypresentation-delay", "Wait number of ms after typing before starting typechecking", 0, 0 to 999)
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package dotty.tools.dotc
package dotty.compiler
package internal
package config

import collection.mutable.{ ArrayBuffer }
Expand Down Expand Up @@ -248,4 +249,4 @@ object Settings {
def PrefixSetting(name: String, pre: String, descr: String): Setting[List[String]] =
publish(Setting(name, descr, Nil, prefix = pre))
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package dotty.tools
package dotc
package dotty.compiler
package internal
package config

import java.security.AccessControlException
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package dotty.tools.dotc
package dotty.compiler
package internal
package core

import Symbols._, Types._, util.Positions._, Contexts._, Constants._, ast.tpd._
Expand Down Expand Up @@ -65,4 +66,4 @@ object Annotations {
val tref = cls.typeRef
Annotation(defn.ThrowsAnnot.typeRef.appliedTo(tref), Ident(tref))
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package dotty.tools.dotc
package dotty.compiler
package internal
package core

import Types._, Symbols._, Contexts._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package dotty.tools
package dotc
package dotty.compiler
package internal
package core

import Types._, Contexts._, Symbols._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package dotty.tools
package dotc
package dotty.compiler
package internal
package core

import Decorators._
Expand Down Expand Up @@ -28,7 +28,7 @@ import language.implicitConversions

object Contexts {

/** A context is passed basically everywhere in dotc.
/** A context is passed basically everywhere in the compiler.
* This is convenient but carries the risk of captured contexts in
* objects that turn into space leaks. To combat this risk, here are some
* conventions to follow:
Expand Down Expand Up @@ -427,7 +427,7 @@ object Contexts {
}

/** A table for hash consing unique refined types */
private[dotc] val uniqueRefinedTypes = new RefinedUniques
private[compiler] val uniqueRefinedTypes = new RefinedUniques

/** A table for hash consing unique named types */
private[core] val uniqueNamedTypes = new NamedTypeUniques
Expand Down Expand Up @@ -456,15 +456,15 @@ object Contexts {

// Printers state
/** Number of recursive invocations of a show method on cuyrrent stack */
private[dotc] var toTextRecursions = 0
private[compiler] var toTextRecursions = 0

// Reporters state
private[dotc] var indent = 0
private[compiler] var indent = 0

protected[dotc] val indentTab = " "
protected[compiler] val indentTab = " "

/** Should warnings and errors containing non-sensical strings be suppressed? */
private[dotc] var suppressNonSensicalErrors = true
private[compiler] var suppressNonSensicalErrors = true
}

object Context {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package dotty.tools.dotc
package dotty.compiler
package internal
package core

import annotation.tailrec
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package dotty.tools
package dotc
package dotty.compiler
package internal
package core

import Types._, Contexts._, Symbols._, Denotations._, SymDenotations._, StdNames._, Names._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package dotty.tools
package dotc
package dotty.compiler
package internal
package core

import SymDenotations.{ SymDenotation, NoDenotation }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
package dotty.tools.dotc.core
package dotty.compiler
package internal
package core

import language.implicitConversions

Expand Down Expand Up @@ -518,4 +520,4 @@ object Flags {

implicit def conjToFlagSet(conj: FlagConjunction): FlagSet =
FlagSet(conj.bits)
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package dotty.tools.dotc
package dotty.compiler
package internal
package core

import Types._
Expand Down
Loading