The absence of "Global pluggability", combined with the fact that most
of the functionality in Global is unnecessarily rigid due to the phases
being implemented as objects, means that it has been close to impossible
to do interesting compiler development in a way which doesn't require
modifying the scalac source tree. This then leaves you continually
subject to punishment by code drift as the various places you were
forced to modify change out from under you.
This is somewhat less true now, thanks to new option: -Yglobal-class
The primary wielders of Global (fsc/scala/scalac) now instantiate
the compiler via a (Settings, Reporter) => Global factory method in
the Global companion. If -Yglobal-class was given, that class (which
must have a (Settings, Reporter) constructor) will be instantiated if
possible, falling back on the standard one. See
test/files/pos/CustomGlobal.scala
for a working example. (It's not in run because I would have to be able
to give partest a different set of flags for successive compiles in the
same test.) Review by odersky.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25600 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
of deadlocks: when the PC was asked to shutdown, all work items in the
work queue would be left pending, and no response would be set.
This commit attempts to clean up a bit better: a shutdown request
clears the work queue and all pending loaded&typed or parsed-entered requests
by setting their responses to 'MissingResponse'. review by odersky.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25596 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
It turns out that `liftcode` phase must be always
executed or other phases will fail. Specifically,
at the moment `explicitouter` seems to depend on
`liftcode`. One can observe compiler crash by
compiling scala/Array.scala file without `liftcode`
included. At `explicitouter` phase compiler will
crash with assertion error saying it cannot
lift some code.
Review by odersky
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25570 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
the stack trace without aborting. For example, the following would
resume compilation after showing the trace.
% scala -deprecation -Xprompt -nc -e 'case class Foo'
foo.scala:1: warning: case classes without a parameter list have been deprecated;
use either case objects or case classes with `()' as parameter list.
case class Foo
^
a)bort, s)tack, r)esume: s
java.lang.Exception
[...]
at scala.tools.nsc.ast.parser.Parsers$UnitParser.deprecationWarning(Parsers.scala:207)
at scala.tools.nsc.ast.parser.Parsers$Parser.paramClauses(Parsers.scala:2058)
at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$classDef$1.apply(Parsers.scala:2557)
at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$classDef$1.apply(Parsers.scala:2545)
No review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25567 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
console life for sbt and so the repl can be used on google app engine.
Although this patch may look largish to be entering at RC4, there
isn't a lot going on. It's trying to make these dangerous things:
- property and environment variable accesses
- thread creation
- signal handler installation
happpen in a sufficiently uniform way that people who don't
want them and places who don't allow them are not left with an
unfixable situation where things blow up inside private methods.
Also, the (ahem) lower than usual elegance levels are due to it
being intended for 2.9.x as well. Review by harrah.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25549 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
See enclosed test files/run/inline-ex-handlers.scala. To
compare optimized and unoptimized icode after a given phase,
all you need in a partest source file is this:
import scala.tools.partest.IcodeTest
object Test extends IcodeTest {
override def printIcodeAfterPhase = "inlineExceptionHandlers"
}
Other things can be done, see IcodeTest.scala. Review by ureche.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25541 5e8d7ff9-d8ef-0310-90f0-a4852d11357a