Commit Graph

14506 Commits

Author SHA1 Message Date
extempore c8354bb691 Made it possible to supply a custom Global to the core scala runners.
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
2011-09-01 02:31:55 +00:00
Joshua.Suereth 47d321c78e Document the usage and methods of scala.sys.process.
From the first international scaladoc marathon.

   Contributed by: Daniel Sobral

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25599 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-31 19:16:18 +00:00
odersky 0b2544fa4b Small tweak to reflection to make package types same as for SymbolLoaders
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25598 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-31 16:16:39 +00:00
dragos a613ac298a Better handling of presentation compiler shutdown. This fixes a source
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
2011-08-31 10:09:26 +00:00
odersky 5e323a8969 More fixes to reflection and reflective compiler.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25589 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-30 21:04:51 +00:00
odersky a484db70b7 Twist to make crashes more robust :-) (by avoiding exceptions that get raised when printing debug output in erasure).
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25588 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-30 16:43:01 +00:00
odersky 3e8aa495b1 removing more debug output from reflection.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25587 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-30 16:42:15 +00:00
Joshua.Suereth a9b2192b6f Added extraneous test where classes are verified by loading them in non-boot classloaders one at a time. These are not wired into the standard workflow, but available optionally. Review by rytz
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25586 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-29 20:24:39 +00:00
heathermiller 149bcce332 Added copyright notice to all scaladoc pages. No review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25585 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-29 18:11:52 +00:00
odersky a418b2e60c Added package object support to reflection framework. Removed debug output and made some speed improvements.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25584 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-29 17:15:56 +00:00
odersky 92a40f1e57 More changes to get Reflect compiler working.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25583 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-29 12:45:19 +00:00
extempore 6043a4a7ed Gave partial function an empty member. Closes SI-4927, no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25578 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-28 00:13:17 +00:00
extempore ae34b0a00c Another bit of stray debugging output involving good old symbol #431.
Oh, symbol #431, why must you haunt our dreams.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25577 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-27 18:02:32 +00:00
extempore 268cdc3942 Fixing up a few instances of suboptimal reversing, no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25576 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-27 18:02:20 +00:00
extempore e82fd5e80e Replaced various now-unnecessary casts with straight getClass
calls.  Closes SI-4780, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25575 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-27 18:02:01 +00:00
extempore 1ca8734604 Fixed bug in Sorted "to" not using the ordering. Closes SI-4930, no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25574 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-27 18:01:40 +00:00
odersky e77200a9a8 Fixing the build
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25573 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-26 20:24:45 +00:00
odersky a61c42caea Removing debug output that slipped into main compiler and broke the build.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25572 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-26 20:03:30 +00:00
odersky f7e4f28b23 More fixes/debug code for reflection.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25571 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-26 16:56:09 +00:00
grek e2d92fb8b9 Always include `liftcode` phase in a compiler run.
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
2011-08-26 14:37:21 +00:00
extempore 3af67bab1c Some kind of scaladoc quoting fix from the sbt guy, no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25569 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-25 20:58:19 +00:00
extempore 03397dd669 Recent icode checking tests were leaving a bit of a mess in the
filesystem.  Taught them to clean up after themselves.  I knew I'd
pick up a few useful tricks from my kids.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25568 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-25 20:55:00 +00:00
extempore 6a0290fa35 Made -Xprompt more useful, less crashy and more open to showing you
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
2011-08-25 17:33:37 +00:00
odersky f87844aeb5 Fixes and temporary debug scaffolding for reflect code.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25566 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-25 17:17:54 +00:00
extempore 90c256f59c Sorting test output so it passes on java7, no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25565 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-25 05:02:34 +00:00
extempore 99c8042d37 Renamed tests named bugXXX to tXXX, no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25564 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-24 17:11:55 +00:00
odersky ef350c81e6 Fixed build problems
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25563 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-24 17:11:48 +00:00
odersky 59f3ce8902 Class that can be used for memoizing types in reified trees
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25562 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-24 17:06:04 +00:00
odersky 85b31691ce reflection refactoring so that we can now have a compiler that uses reflection instead of class files (ReflectGlobal/ReflectMain). Still needs some debugging to get it to run.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25561 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-24 17:04:34 +00:00
odersky 4e04e7412d Refactored everything that's clean in nsc.Main to nsc.Driver. Left the cruft in Main which now inherits Driver. Makes it simpler to create new compiler variants by subclassing Driver instead of adding yet one more case to the convoluted logic in Main.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25560 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-24 17:02:31 +00:00
extempore 00f8a5baf3 Removed and consolidated several redundant tests which had
filenames "bugXXX" and "tXXX" where XXX == XXX.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25559 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-24 16:49:38 +00:00
extempore a978f24ba3 Some 11th hour modifications with the dual purpose of a smooth
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
2011-08-23 22:57:15 +00:00
extempore c8630fa0da Modified scala.reflect package object not to throw an exception
at initialization time if it can't instantiate the value in question.
Review by odersky.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25546 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-23 21:15:20 +00:00
odersky 8f399614aa New reification code for symbols and types. Temporarily disabled reification-related tests.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25545 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-23 11:58:15 +00:00
rompf 1be75ee289 applying patch provided by Topher, fixes #3501. no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25544 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-23 11:14:53 +00:00
extempore 89f0f8aee2 Created infrastructure for testing icode + settings/partest yak shaving.
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
2011-08-22 19:49:46 +00:00
michelou 482069fc2b corrected misspelled type params (capitalized names 3x)
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25540 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-22 17:58:13 +00:00
extempore 7c625135ca Some cleanups in inline exception handlers. Review by ureche.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25539 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-22 15:18:50 +00:00
extempore 6d31a5bd62 Bug in optimizer eliminated potentially exceptional not-dead code.
Streamlined isSideEffecting logic.  Review by ureche.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25538 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-21 16:05:06 +00:00
extempore 970bf06b85 Set the partest encoding to UTF-8. Review by heathermiller.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25537 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-21 13:46:08 +00:00
heathermiller f91f471533 Improved documentation for scala.collection.immutable.List and scala.collection.immutable.Queue. Contributed by Matthew Pocock during the Monthly Docspree. Review by phaller.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25535 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-21 00:29:10 +00:00
extempore 93d7c3be9b Maybe that last commit was closer than I thought. Don't let
0-arg getClass reach bytecode.  References SI-4931, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25534 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-21 00:26:54 +00:00
extempore 1c824a3fe8 Reverts previous commit. Guess I won't get to skate this one in
a hurry, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25533 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-20 23:37:09 +00:00
extempore d0be5ef5b8 Kludge: don't let getClass make it into bytecode.
References SI-4931, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25531 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-20 23:26:34 +00:00
heathermiller 9df857c88a Improves documentation of scala.Predef. Contributed by Iain McGinniss during the Aug 20 Docspree. Review by phaller.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25530 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-20 19:52:30 +00:00
kzys 51805d5782 Replaced Application with App in ScalaDoc. Contributed by Simon Ochsenreither. No review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25529 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-20 19:41:47 +00:00
kzys 4d6bb7beb9 Shows modifiers before kinds. Fixes #4451. Contributed by Shows modifiers before kinds. Fixes #4451. Review by heathermiller.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25528 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-20 19:38:57 +00:00
extempore f104d80085 Moved files to welcome our ant overlords, no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25527 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-20 15:14:01 +00:00
ureche 7cfdad5457 [recommit] Backend optimization: Inline exception handlers. Review by dragos.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25526 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-19 21:23:21 +00:00
odersky 2c1b532255 Literals now take Any as argument (used to represent free values in reified trees).
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25525 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-08-19 16:27:24 +00:00