summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2012-07-24 12:34:18 +0200
committerEugene Burmako <xeno.by@gmail.com>2012-08-02 15:51:12 +0200
commit9892f52adf76c1e39c6d129f8b35ee98802de188 (patch)
tree64525f8ab63b921717e4ef2c4dbbb5f3005eb8b1 /src/compiler
parent5e1a0052523349775be1cc98b4094c44804f1240 (diff)
downloadscala-9892f52adf76c1e39c6d129f8b35ee98802de188.tar.gz
scala-9892f52adf76c1e39c6d129f8b35ee98802de188.tar.bz2
scala-9892f52adf76c1e39c6d129f8b35ee98802de188.zip
reflect.makro => reflect.macros (Step I)
Builds a starr that uses stuff from scala.reflect.macros for macro activities. Crucial makro thingies (such as makro.Context or makro.internal.macroImpl) are temporarily left in place, because they are necessary for previous starr. Macro tests will be fixed in a dedicated commit, so that they don't pollute meaningful commits, making the life easy for reviewers and spelunkers.
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/reflect/macros/runtime/AbortMacroException.scala (renamed from src/compiler/scala/reflect/makro/runtime/AbortMacroException.scala)2
-rw-r--r--src/compiler/scala/reflect/macros/runtime/Aliases.scala (renamed from src/compiler/scala/reflect/makro/runtime/Aliases.scala)2
-rw-r--r--src/compiler/scala/reflect/macros/runtime/CapturedVariables.scala (renamed from src/compiler/scala/reflect/makro/runtime/CapturedVariables.scala)2
-rw-r--r--src/compiler/scala/reflect/macros/runtime/Context.scala (renamed from src/compiler/scala/reflect/makro/runtime/Context.scala)4
-rw-r--r--src/compiler/scala/reflect/macros/runtime/Enclosures.scala (renamed from src/compiler/scala/reflect/makro/runtime/Enclosures.scala)2
-rw-r--r--src/compiler/scala/reflect/macros/runtime/Evals.scala (renamed from src/compiler/scala/reflect/makro/runtime/Evals.scala)2
-rw-r--r--src/compiler/scala/reflect/macros/runtime/ExprUtils.scala (renamed from src/compiler/scala/reflect/makro/runtime/ExprUtils.scala)2
-rw-r--r--src/compiler/scala/reflect/macros/runtime/Exprs.scala (renamed from src/compiler/scala/reflect/makro/runtime/Exprs.scala)2
-rw-r--r--src/compiler/scala/reflect/macros/runtime/FrontEnds.scala (renamed from src/compiler/scala/reflect/makro/runtime/FrontEnds.scala)2
-rw-r--r--src/compiler/scala/reflect/macros/runtime/Infrastructure.scala (renamed from src/compiler/scala/reflect/makro/runtime/Infrastructure.scala)2
-rw-r--r--src/compiler/scala/reflect/macros/runtime/Names.scala (renamed from src/compiler/scala/reflect/makro/runtime/Names.scala)2
-rw-r--r--src/compiler/scala/reflect/macros/runtime/Parsers.scala (renamed from src/compiler/scala/reflect/makro/runtime/Parsers.scala)2
-rw-r--r--src/compiler/scala/reflect/macros/runtime/Reifiers.scala (renamed from src/compiler/scala/reflect/makro/runtime/Reifiers.scala)2
-rw-r--r--src/compiler/scala/reflect/macros/runtime/Settings.scala (renamed from src/compiler/scala/reflect/makro/runtime/Settings.scala)2
-rw-r--r--src/compiler/scala/reflect/macros/runtime/Traces.scala (renamed from src/compiler/scala/reflect/makro/runtime/Traces.scala)2
-rw-r--r--src/compiler/scala/reflect/macros/runtime/TypeTags.scala (renamed from src/compiler/scala/reflect/makro/runtime/TypeTags.scala)2
-rw-r--r--src/compiler/scala/reflect/macros/runtime/Typers.scala (renamed from src/compiler/scala/reflect/makro/runtime/Typers.scala)2
-rw-r--r--src/compiler/scala/reflect/macros/util/Traces.scala (renamed from src/compiler/scala/reflect/makro/util/Traces.scala)2
-rw-r--r--src/compiler/scala/reflect/reify/Errors.scala4
-rw-r--r--src/compiler/scala/reflect/reify/Reifier.scala4
-rw-r--r--src/compiler/scala/reflect/reify/Taggers.scala4
-rw-r--r--src/compiler/scala/reflect/reify/package.scala2
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Implicits.scala2
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Macros.scala10
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/StdAttachments.scala2
-rw-r--r--src/compiler/scala/tools/reflect/MacroImplementations.scala8
-rw-r--r--src/compiler/scala/tools/reflect/StdTags.scala2
-rw-r--r--src/compiler/scala/tools/util/PathResolver.scala2
28 files changed, 39 insertions, 39 deletions
diff --git a/src/compiler/scala/reflect/makro/runtime/AbortMacroException.scala b/src/compiler/scala/reflect/macros/runtime/AbortMacroException.scala
index a68910859d..f45dde8a85 100644
--- a/src/compiler/scala/reflect/makro/runtime/AbortMacroException.scala
+++ b/src/compiler/scala/reflect/macros/runtime/AbortMacroException.scala
@@ -1,4 +1,4 @@
-package scala.reflect.makro
+package scala.reflect.macros
package runtime
import scala.reflect.internal.util.Position
diff --git a/src/compiler/scala/reflect/makro/runtime/Aliases.scala b/src/compiler/scala/reflect/macros/runtime/Aliases.scala
index 760f7fc54d..8b742755cd 100644
--- a/src/compiler/scala/reflect/makro/runtime/Aliases.scala
+++ b/src/compiler/scala/reflect/macros/runtime/Aliases.scala
@@ -1,4 +1,4 @@
-package scala.reflect.makro
+package scala.reflect.macros
package runtime
trait Aliases {
diff --git a/src/compiler/scala/reflect/makro/runtime/CapturedVariables.scala b/src/compiler/scala/reflect/macros/runtime/CapturedVariables.scala
index 021b93ceee..78fb7100b0 100644
--- a/src/compiler/scala/reflect/makro/runtime/CapturedVariables.scala
+++ b/src/compiler/scala/reflect/macros/runtime/CapturedVariables.scala
@@ -1,4 +1,4 @@
-package scala.reflect.makro
+package scala.reflect.macros
package runtime
trait CapturedVariables {
diff --git a/src/compiler/scala/reflect/makro/runtime/Context.scala b/src/compiler/scala/reflect/macros/runtime/Context.scala
index 68964b7abb..8bbfef44a3 100644
--- a/src/compiler/scala/reflect/makro/runtime/Context.scala
+++ b/src/compiler/scala/reflect/macros/runtime/Context.scala
@@ -1,9 +1,9 @@
-package scala.reflect.makro
+package scala.reflect.macros
package runtime
import scala.tools.nsc.Global
-abstract class Context extends scala.reflect.makro.Context
+abstract class Context extends scala.reflect.macros.Context
with Aliases
with CapturedVariables
with Infrastructure
diff --git a/src/compiler/scala/reflect/makro/runtime/Enclosures.scala b/src/compiler/scala/reflect/macros/runtime/Enclosures.scala
index 360a4b8e8a..ebde4447d7 100644
--- a/src/compiler/scala/reflect/makro/runtime/Enclosures.scala
+++ b/src/compiler/scala/reflect/macros/runtime/Enclosures.scala
@@ -1,4 +1,4 @@
-package scala.reflect.makro
+package scala.reflect.macros
package runtime
trait Enclosures {
diff --git a/src/compiler/scala/reflect/makro/runtime/Evals.scala b/src/compiler/scala/reflect/macros/runtime/Evals.scala
index 0574359a19..348e29cdd7 100644
--- a/src/compiler/scala/reflect/makro/runtime/Evals.scala
+++ b/src/compiler/scala/reflect/macros/runtime/Evals.scala
@@ -1,4 +1,4 @@
-package scala.reflect.makro
+package scala.reflect.macros
package runtime
import scala.reflect.runtime.{universe => ru}
diff --git a/src/compiler/scala/reflect/makro/runtime/ExprUtils.scala b/src/compiler/scala/reflect/macros/runtime/ExprUtils.scala
index c89606289f..672699f00e 100644
--- a/src/compiler/scala/reflect/makro/runtime/ExprUtils.scala
+++ b/src/compiler/scala/reflect/macros/runtime/ExprUtils.scala
@@ -1,4 +1,4 @@
-package scala.reflect.makro
+package scala.reflect.macros
package runtime
trait ExprUtils {
diff --git a/src/compiler/scala/reflect/makro/runtime/Exprs.scala b/src/compiler/scala/reflect/macros/runtime/Exprs.scala
index b680b56bab..4217a6a404 100644
--- a/src/compiler/scala/reflect/makro/runtime/Exprs.scala
+++ b/src/compiler/scala/reflect/macros/runtime/Exprs.scala
@@ -1,4 +1,4 @@
-package scala.reflect.makro
+package scala.reflect.macros
package runtime
trait Exprs {
diff --git a/src/compiler/scala/reflect/makro/runtime/FrontEnds.scala b/src/compiler/scala/reflect/macros/runtime/FrontEnds.scala
index 6644c579ac..69fa416f8f 100644
--- a/src/compiler/scala/reflect/makro/runtime/FrontEnds.scala
+++ b/src/compiler/scala/reflect/macros/runtime/FrontEnds.scala
@@ -1,4 +1,4 @@
-package scala.reflect.makro
+package scala.reflect.macros
package runtime
trait FrontEnds extends scala.tools.reflect.FrontEnds {
diff --git a/src/compiler/scala/reflect/makro/runtime/Infrastructure.scala b/src/compiler/scala/reflect/macros/runtime/Infrastructure.scala
index 76c4b21731..19fb03364e 100644
--- a/src/compiler/scala/reflect/makro/runtime/Infrastructure.scala
+++ b/src/compiler/scala/reflect/macros/runtime/Infrastructure.scala
@@ -1,4 +1,4 @@
-package scala.reflect.makro
+package scala.reflect.macros
package runtime
import scala.tools.nsc.util.ScalaClassLoader
diff --git a/src/compiler/scala/reflect/makro/runtime/Names.scala b/src/compiler/scala/reflect/macros/runtime/Names.scala
index 3f43b15d90..ee9f3a56d3 100644
--- a/src/compiler/scala/reflect/makro/runtime/Names.scala
+++ b/src/compiler/scala/reflect/macros/runtime/Names.scala
@@ -1,4 +1,4 @@
-package scala.reflect.makro
+package scala.reflect.macros
package runtime
trait Names {
diff --git a/src/compiler/scala/reflect/makro/runtime/Parsers.scala b/src/compiler/scala/reflect/macros/runtime/Parsers.scala
index ac8d09f592..6d89b71f39 100644
--- a/src/compiler/scala/reflect/makro/runtime/Parsers.scala
+++ b/src/compiler/scala/reflect/macros/runtime/Parsers.scala
@@ -1,4 +1,4 @@
-package scala.reflect.makro
+package scala.reflect.macros
package runtime
import language.existentials
diff --git a/src/compiler/scala/reflect/makro/runtime/Reifiers.scala b/src/compiler/scala/reflect/macros/runtime/Reifiers.scala
index 10b5ae5f42..056549578a 100644
--- a/src/compiler/scala/reflect/makro/runtime/Reifiers.scala
+++ b/src/compiler/scala/reflect/macros/runtime/Reifiers.scala
@@ -3,7 +3,7 @@
* @author Gilles Dubochet
*/
-package scala.reflect.makro
+package scala.reflect.macros
package runtime
trait Reifiers {
diff --git a/src/compiler/scala/reflect/makro/runtime/Settings.scala b/src/compiler/scala/reflect/macros/runtime/Settings.scala
index 8288180b8d..b7dba665fa 100644
--- a/src/compiler/scala/reflect/makro/runtime/Settings.scala
+++ b/src/compiler/scala/reflect/macros/runtime/Settings.scala
@@ -1,4 +1,4 @@
-package scala.reflect.makro
+package scala.reflect.macros
package runtime
trait Settings {
diff --git a/src/compiler/scala/reflect/makro/runtime/Traces.scala b/src/compiler/scala/reflect/macros/runtime/Traces.scala
index 225ee1f62b..0238e9f84e 100644
--- a/src/compiler/scala/reflect/makro/runtime/Traces.scala
+++ b/src/compiler/scala/reflect/macros/runtime/Traces.scala
@@ -1,4 +1,4 @@
-package scala.reflect.makro
+package scala.reflect.macros
package runtime
trait Traces extends util.Traces {
diff --git a/src/compiler/scala/reflect/makro/runtime/TypeTags.scala b/src/compiler/scala/reflect/macros/runtime/TypeTags.scala
index 4f9b287674..2bc2fe6384 100644
--- a/src/compiler/scala/reflect/makro/runtime/TypeTags.scala
+++ b/src/compiler/scala/reflect/macros/runtime/TypeTags.scala
@@ -1,4 +1,4 @@
-package scala.reflect.makro
+package scala.reflect.macros
package runtime
trait TypeTags {
diff --git a/src/compiler/scala/reflect/makro/runtime/Typers.scala b/src/compiler/scala/reflect/macros/runtime/Typers.scala
index 7e92c1e9ca..9fa8567ada 100644
--- a/src/compiler/scala/reflect/makro/runtime/Typers.scala
+++ b/src/compiler/scala/reflect/macros/runtime/Typers.scala
@@ -1,4 +1,4 @@
-package scala.reflect.makro
+package scala.reflect.macros
package runtime
trait Typers {
diff --git a/src/compiler/scala/reflect/makro/util/Traces.scala b/src/compiler/scala/reflect/macros/util/Traces.scala
index 2363cc4bac..6c2f115994 100644
--- a/src/compiler/scala/reflect/makro/util/Traces.scala
+++ b/src/compiler/scala/reflect/macros/util/Traces.scala
@@ -1,4 +1,4 @@
-package scala.reflect.makro
+package scala.reflect.macros
package util
trait Traces {
diff --git a/src/compiler/scala/reflect/reify/Errors.scala b/src/compiler/scala/reflect/reify/Errors.scala
index 1b72b3075b..5e15c5ad3a 100644
--- a/src/compiler/scala/reflect/reify/Errors.scala
+++ b/src/compiler/scala/reflect/reify/Errors.scala
@@ -1,7 +1,7 @@
package scala.reflect.reify
-import scala.reflect.makro.ReificationError
-import scala.reflect.makro.UnexpectedReificationError
+import scala.reflect.macros.ReificationError
+import scala.reflect.macros.UnexpectedReificationError
trait Errors {
self: Reifier =>
diff --git a/src/compiler/scala/reflect/reify/Reifier.scala b/src/compiler/scala/reflect/reify/Reifier.scala
index 8fba7274be..5503ff2977 100644
--- a/src/compiler/scala/reflect/reify/Reifier.scala
+++ b/src/compiler/scala/reflect/reify/Reifier.scala
@@ -1,8 +1,8 @@
package scala.reflect.reify
import scala.tools.nsc.Global
-import scala.reflect.makro.ReificationError
-import scala.reflect.makro.UnexpectedReificationError
+import scala.reflect.macros.ReificationError
+import scala.reflect.macros.UnexpectedReificationError
import scala.reflect.reify.utils.Utils
/** Given a tree or a type, generate a tree that when executed at runtime produces the original tree or type.
diff --git a/src/compiler/scala/reflect/reify/Taggers.scala b/src/compiler/scala/reflect/reify/Taggers.scala
index 4e30d0acf8..a8523fe686 100644
--- a/src/compiler/scala/reflect/reify/Taggers.scala
+++ b/src/compiler/scala/reflect/reify/Taggers.scala
@@ -1,7 +1,7 @@
package scala.reflect.reify
-import scala.reflect.makro.{ReificationError, UnexpectedReificationError}
-import scala.reflect.makro.runtime.Context
+import scala.reflect.macros.{ReificationError, UnexpectedReificationError}
+import scala.reflect.macros.runtime.Context
abstract class Taggers {
val c: Context
diff --git a/src/compiler/scala/reflect/reify/package.scala b/src/compiler/scala/reflect/reify/package.scala
index bd17b2d5df..a253effc1c 100644
--- a/src/compiler/scala/reflect/reify/package.scala
+++ b/src/compiler/scala/reflect/reify/package.scala
@@ -2,7 +2,7 @@ package scala.reflect
import language.implicitConversions
import scala.reflect.base.{Universe => BaseUniverse}
-import scala.reflect.makro.{Context, ReificationError, UnexpectedReificationError}
+import scala.reflect.macros.{Context, ReificationError, UnexpectedReificationError}
import scala.tools.nsc.Global
package object reify {
diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
index 529f5408a2..b442d16b1c 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
@@ -1196,7 +1196,7 @@ trait Implicits {
gen.mkAttributedThis(thisSym)
case _ =>
// if ``pre'' is not a PDT, e.g. if someone wrote
- // implicitly[scala.reflect.makro.Context#TypeTag[Int]]
+ // implicitly[scala.reflect.macros.Context#TypeTag[Int]]
// then we need to fail, because we don't know the prefix to use during type reification
// upd. we also need to fail silently, because this is a very common situation
// e.g. quite often we're searching for BaseUniverse#TypeTag, e.g. for a type tag in any universe
diff --git a/src/compiler/scala/tools/nsc/typechecker/Macros.scala b/src/compiler/scala/tools/nsc/typechecker/Macros.scala
index 71176d6247..1381450970 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Macros.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Macros.scala
@@ -8,7 +8,7 @@ import scala.reflect.runtime.ReflectionUtils
import scala.collection.mutable.ListBuffer
import scala.compat.Platform.EOL
import reflect.internal.util.Statistics
-import scala.reflect.makro.util._
+import scala.reflect.macros.util._
import java.lang.{Class => jClass}
import java.lang.reflect.{Array => jArray, Method => jMethod}
@@ -24,7 +24,7 @@ import java.lang.reflect.{Array => jArray, Method => jMethod}
* Then fooBar needs to point to a static method of the following form:
*
* def fooBar[T: c.TypeTag]
- * (c: scala.reflect.makro.Context)
+ * (c: scala.reflect.macros.Context)
* (xs: c.Expr[List[T]])
* : c.Expr[T] = {
* ...
@@ -51,7 +51,7 @@ trait Macros extends scala.tools.reflect.FastTrack with Traces {
/** A list of compatible macro implementation signatures.
*
* In the example above:
- * (c: scala.reflect.makro.Context)(xs: c.Expr[List[T]]): c.Expr[T]
+ * (c: scala.reflect.macros.Context)(xs: c.Expr[List[T]]): c.Expr[T]
*
* @param macroDef The macro definition symbol
* @param tparams The type parameters of the macro definition
@@ -879,7 +879,7 @@ trait Macros extends scala.tools.reflect.FastTrack with Traces {
}
/** Keeps track of macros in-flight.
- * See more informations in comments to ``openMacros'' in ``scala.reflect.makro.Context''.
+ * See more informations in comments to ``openMacros'' in ``scala.reflect.macros.Context''.
*/
var openMacros = List[MacroContext]()
def enclosingMacroPosition = openMacros map (_.macroApplication.pos) find (_ ne NoPosition) getOrElse NoPosition
@@ -1155,7 +1155,7 @@ trait Macros extends scala.tools.reflect.FastTrack with Traces {
// [Eugene] any ideas about how to improve this one?
val realex = ReflectionUtils.unwrapThrowable(ex)
realex match {
- case realex: reflect.makro.runtime.AbortMacroException =>
+ case realex: reflect.macros.runtime.AbortMacroException =>
macroLogVerbose("macro expansion has failed: %s".format(realex.msg))
fail(typer, expandee) // error has been reported by abort
case err: TypeError =>
diff --git a/src/compiler/scala/tools/nsc/typechecker/StdAttachments.scala b/src/compiler/scala/tools/nsc/typechecker/StdAttachments.scala
index 190b18711c..64c5b41638 100644
--- a/src/compiler/scala/tools/nsc/typechecker/StdAttachments.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/StdAttachments.scala
@@ -4,7 +4,7 @@ package typechecker
trait StdAttachments {
self: Analyzer =>
- type UnaffiliatedMacroContext = scala.reflect.makro.runtime.Context
+ type UnaffiliatedMacroContext = scala.reflect.macros.runtime.Context
type MacroContext = UnaffiliatedMacroContext { val universe: self.global.type }
case class MacroRuntimeAttachment(delayed: Boolean, typerContext: Context, macroContext: Option[MacroContext])
} \ No newline at end of file
diff --git a/src/compiler/scala/tools/reflect/MacroImplementations.scala b/src/compiler/scala/tools/reflect/MacroImplementations.scala
index e1b959cefa..40ceefcc70 100644
--- a/src/compiler/scala/tools/reflect/MacroImplementations.scala
+++ b/src/compiler/scala/tools/reflect/MacroImplementations.scala
@@ -1,7 +1,7 @@
package scala.tools.reflect
-import scala.reflect.makro.{ReificationError, UnexpectedReificationError}
-import scala.reflect.makro.runtime.Context
+import scala.reflect.macros.{ReificationError, UnexpectedReificationError}
+import scala.reflect.macros.runtime.Context
import scala.collection.mutable.ListBuffer
import scala.collection.mutable.Stack
@@ -25,9 +25,9 @@ abstract class MacroImplementations {
c.abort(args(parts.length-1).pos,
"too many arguments for interpolated string")
}
- val stringParts = parts map {
+ val stringParts = parts map {
case Literal(Constant(s: String)) => s;
- case _ => throw new IllegalArgumentException("argument parts must be a list of string literals")
+ case _ => throw new IllegalArgumentException("argument parts must be a list of string literals")
}
val pi = stringParts.iterator
diff --git a/src/compiler/scala/tools/reflect/StdTags.scala b/src/compiler/scala/tools/reflect/StdTags.scala
index 30bded4f86..0704189ddc 100644
--- a/src/compiler/scala/tools/reflect/StdTags.scala
+++ b/src/compiler/scala/tools/reflect/StdTags.scala
@@ -52,7 +52,7 @@ object StdRuntimeTags extends StdTags {
}
abstract class StdContextTags extends StdTags {
- val tc: scala.reflect.makro.Context
+ val tc: scala.reflect.macros.Context
val u: tc.universe.type = tc.universe
val m = tc.mirror
}
diff --git a/src/compiler/scala/tools/util/PathResolver.scala b/src/compiler/scala/tools/util/PathResolver.scala
index 5f4e6d58c3..d89ebcb2a3 100644
--- a/src/compiler/scala/tools/util/PathResolver.scala
+++ b/src/compiler/scala/tools/util/PathResolver.scala
@@ -194,7 +194,7 @@ class PathResolver(settings: Settings, context: JavaContext) {
def scalaBootClassPath = cmdLineOrElse("bootclasspath", Defaults.scalaBootClassPath)
def scalaExtDirs = cmdLineOrElse("extdirs", Defaults.scalaExtDirs)
/** Scaladoc doesn't need any bootstrapping, otherwise will create errors such as:
- * [scaladoc] ../scala-trunk/src/reflect/scala/reflect/makro/Reifiers.scala:89: error: object api is not a member of package reflect
+ * [scaladoc] ../scala-trunk/src/reflect/scala/reflect/macros/Reifiers.scala:89: error: object api is not a member of package reflect
* [scaladoc] case class ReificationError(val pos: reflect.api.PositionApi, val msg: String) extends Throwable(msg)
* [scaladoc] ^
* because the bootstrapping will look at the sourcepath and create package "reflect" in "<root>"