| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a setting to take a custom Reporter.
Example of reporter that discounts deprecations for purposes of
(not) failing the build:
```
import scala.tools.nsc.Settings
import scala.tools.nsc.reporters.ConsoleReporter
import scala.reflect.internal.util._
class MyReporter(ss: Settings) extends ConsoleReporter(ss) {
var deprecationCount = 0
override def warning(pos: Position, msg: String): Unit = {
if (msg contains "is deprecated") deprecationCount += 1
super.warning(pos, msg)
}
override def hasWarnings: Boolean = count(WARNING) - deprecationCount > 0
override def reset() = { deprecationCount = 0 ; super.reset() }
}
```
Invoked as:
```
$ scalac -toolcp . -Xreporter myrep.MyReporter -Xfatal-warnings -deprecation test.scala
test.scala:8: warning: class C in package tester is deprecated: Don't use me
Console println s"${new C}"
^
one warning found
```
where the reporter class is in the current directory, placed on the tool class path.
Also flush on early-reported errors.
|
|
|
|
|
|
|
|
|
| |
No, this isn't busywork, how dare you suggest
such a thing. I intend my tombstone to say
HERE LIES EXTEMPORE,
WHO ELIMINATED A LOT OF SIP-18 WARNINGS
REST IN PEACE
|
|
|
|
|
|
|
| |
This commit shortens expressions of the form `if (settings.debug.value)` to
`if (settings.debug)` for various settings. Rarely, the setting is supplied
as a method argument. The conversion is not employed in simple definitions
where the Boolean type would have to be specified.
|
|
|
|
|
|
|
| |
This is a stepping stone to having range positions all the
time, as well as to modularizing the presentation compiler.
It does not enable range positions by default, only places
them smoewhere where they can be.
|
|
|
|
| |
With the exception of toString and the odd JavaBean getter.
|
|
|
|
|
|
|
|
|
| |
Deprecated in 2.10.0, out to pasture in 2.11.0.
Users are advised to migrate to:
https://github.com/typesafehub/zinc
http://www.scala-sbt.org/
|
|
|
|
|
|
|
|
| |
It lives on in a branch born from this commit's parent.
It's abrupt; no attempt is made to offer a "smooth transition"
for the serious msil userbase, population zero. If anyone feels
very strongly that such a transition is necessary, I will be
happy to talk you into feeling differently.
|
|
|
|
|
|
|
|
|
| |
A dizzying number of unused imports, limited to files
in src/compiler. I especially like that the unused import
option (not quite ready for checkin itself) finds places
where feature implicits have been imported which are no
longer necessary, e.g. this commit includes half a dozen
removals of "import scala.language.implicitConversions".
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These are the regexp replacements performed:
Sxcala
-> Scala
Copyright (\d*) LAMP/EPFL
-> Copyright $1-2012 LAMP/EPFL
Copyright (\d*)-(\d*)(,?) LAMP/EPFL
-> Copyright $1-2012 LAMP/EPFL
Copyright (\d*)-(\d*) Scala Solutions and LAMP/EPFL
-> Copyright $1-2012 Scala Solutions and LAMP/EPFL
\(C\) (\d*)-(\d*) LAMP/EPFL
-> (C) $1-2012 LAMP/EPFL
Copyright \(c\) (\d*)-(\d*)(.*?)EPFL
-> Copyright (c) $1-2012$3EPFL
The last one was needed for two HTML-ified copyright notices.
Here's the summarized diff:
Created using
```
git diff -w | grep ^- | sort | uniq | mate
git diff -w | grep ^+ | sort | uniq | mate
```
```
- <div id="footer">Scala programming documentation. Copyright (c) 2003-2011 <a href="http://www.epfl.ch" target="_top">EPFL</a>, with contributions from <a href="http://typesafe.com" target="_top">Typesafe</a>.</div>
- copyright.string=Copyright 2002-2011, LAMP/EPFL
- <meta name="Copyright" content="(C) 2002-2011 LAMP/EPFL"/>
- * Copyright 2002-2011 LAMP/EPFL
- * Copyright 2004-2011 LAMP/EPFL
- * Copyright 2005 LAMP/EPFL
- * Copyright 2005-2011 LAMP/EPFL
- * Copyright 2006-2011 LAMP/EPFL
- * Copyright 2007 LAMP/EPFL
- * Copyright 2007-2011 LAMP/EPFL
- * Copyright 2009-2011 Scala Solutions and LAMP/EPFL
- * Copyright 2009-2011 Scxala Solutions and LAMP/EPFL
- * Copyright 2010-2011 LAMP/EPFL
- * Copyright 2012 LAMP/EPFL
-# Copyright 2002-2011, LAMP/EPFL
-* Copyright 2005-2011 LAMP/EPFL
-/* NSC -- new Scala compiler -- Copyright 2007-2011 LAMP/EPFL */
-rem # Copyright 2002-2011, LAMP/EPFL
```
```
+ <div id="footer">Scala programming documentation. Copyright (c) 2003-2012 <a href="http://www.epfl.ch" target="_top">EPFL</a>, with contributions from <a href="http://typesafe.com" target="_top">Typesafe</a>.</div>
+ copyright.string=Copyright 2002-2012 LAMP/EPFL
+ <meta name="Copyright" content="(C) 2002-2012 LAMP/EPFL"/>
+ * Copyright 2002-2012 LAMP/EPFL
+ * Copyright 2004-2012 LAMP/EPFL
+ * Copyright 2005-2012 LAMP/EPFL
+ * Copyright 2006-2012 LAMP/EPFL
+ * Copyright 2007-2012 LAMP/EPFL
+ * Copyright 2009-2012 Scala Solutions and LAMP/EPFL
+ * Copyright 2010-2012 LAMP/EPFL
+ * Copyright 2011-2012 LAMP/EPFL
+# Copyright 2002-2012 LAMP/EPFL
+* Copyright 2005-2012 LAMP/EPFL
+/* NSC -- new Scala compiler -- Copyright 2007-2012 LAMP/EPFL */
+rem # Copyright 2002-2012 LAMP/EPFL
```
|
| |
|
|
|
|
| |
This is the first step of factoring out scala-reflect.jar.
|
|
|
|
|
|
| |
Use normal Global with RangePositions instead of interactive Global when
Yrangepos is on. No review
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
Added a system property which disables stack trace suppression. (At
present it is the very terse -Dscala.control.no-trace-suppression.)
This makes zero-output crashes involving things like MissingType
significantly less maddening. It would behoove us to have a central
naming scheme for such properties. Review by community.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Imported sbt.Process into trunk, in the guise of package
scala.sys.process. It is largely indistinguishable from the version in
sbt, at least from the outside.
Also, I renamed package system to sys. I wanted to do that from the
beginning and the desire has only grown since then. Sometimes a short
identifier is just critical to usability: with a function like error("")
called from hundreds of places, the difference between system.error and
sys.error is too big. sys.error and sys.exit have good vibes (at least
as good as the vibes can be for functions which error and exit.)
Note: this is just the first cut. I need to check this in to finish
fixing partest. I will be going over it with a comb and writing
documentation which will leave you enchanted, as well as removing other
bits which are now redundant or inferior. No review.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mopping up after the deprecation of exit and error. It is decidedly
non-trivial (at least for the IDE-impaired) to be completely sure of
which error function was being called when there were about twenty with
the same signature in trunk and they are being variously inherited,
imported, shadowed, etc. So although I was careful, the possibility
exists that something is now calling a different "error" function than
before. Caveat programmer.
(And let's all make it our policy not to name anything "error" or "exit"
from here on out....) No review.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Another exciting development in the world of -Y options which I and
three other people will use. Today's is -Yrich-exceptions. Use it like
so:
SOURCEPATH=/path/to/src scalac -Yrich-exceptions a.scala
In the repl, -Yrich-exceptions will cause lastException to be bound to
an Exceptional instead of old rusty Throwable. That spins up new powers:
scala> Nil.head
[Nil.head] (List.scala:389)
(access lastException for the full trace)
scala> lastException.show
/* The repl internal portion of the stack trace is elided. */
[Nil.head]
386: override def isEmpty = true
387: override def head: Nothing =
388: throw new NoSuchElementException("head of empty list")
*389: override def tail: List[Nothing] =
390: throw new UnsupportedOperationException("tail of empty list")
391: // Removal of equals method here might lead to an infinite recursion similar to IntMap.equals.
392: override def equals(that: Any) = that match {
[line0.<init>] (<console>:6)
[line0.<clinit>] (<console>:-1)
Also try "lastException.showTable" but this is getting a little long for
more excerpt. No review.
|
| |
|
|
|
|
|
| |
Removed more than 3400 svn '$Id' keywords and related junk.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While working on partest discovered that CompilerCommand ignores half
its constructor arguments and a couple dozen places blithely pass it
those arguments as if they're being used. Then there were setups like
this:
class OfflineCompilerCommand(
arguments: List[String],
settings: Settings,
error: String => Unit,
interactive: Boolean)
extends CompilerCommand(arguments, new Settings(error), error, false)
Hey offline compiler command, why throw away the perfectly good settings
you were given? Ever heard 'reduce, reuse, recycle'? How did you ever
work... or do you? No review.
|
|
|
|
|
|
|
|
|
| |
Some much needed housecleaning regarding system properties. If you can
possibly resist the temptation, it'd be great if people could try to
go through the properties classes to get and set them, and also to set
property values somewhere fixed rather than using strings directly.
Review by community.
|
|
|
|
|
|
| |
In resident mode the reporter should be reset after each compiler Run.
review by odersky.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Added -Ybuilder-debug:[none,simple,refined] option for testing the
interactive build manager; added support for reporting comments during
compilation; unbroke the test.positions build target.
|
|
|
|
|
|
|
| |
Fix and test for #1674; we aren't supposed to be validating positions
if there are syntax errors ... ensure that's so; we are supposed to be
validating positions when -Yide-debug is set ... ensure that's so.
|
| |
|
|
|
|
|
|
|
|
| |
Added notification to BuildManager clients of files as they're compiled
allowing IDEs to clear persistent compilation related state; added a
mechanism to request a type tree corresponding to an entire compilation
unit.
|
|
|
|
|
|
|
|
| |
Fix for another positions issue; added some positions unit tests; added
test.positions target to build.xml which validates positions of all
sources in the Scala tree; cleaned up -Yide-debug output for use in the
previous item.
|
|
|
|
|
|
| |
Fixed a couple of position bugs; made validation output a bit more
informative and readable.
|
|
|
|
|
|
| |
Added -Yide-debug option to exercise the interactive compiler from the
command-line; made validation errors a bit more informative.
|
| |
|
|
|
|
|
|
| |
In "Iterable" and in all its subclasses, "iterator" replaces "elements"
(and assorted changes).
|
|
|
|
|
| |
some documentation; statistics wrt implicits; new presentation compiler
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The handling of informative messages in CompileServer and in Main was
duplicated, and the two copies slowly diverged over time. The code has
now been refactored, cleaned up, and made more general.
The FakePos(fsc) message was due to a missing override def toString.
Both problems are fixed.
|
|
|
|
|
|
|
| |
ScalaDoc now "ignores" -Ydoc, but must still be given it as an argument
so that the Settings class makes the doc dependent command-line options
available.
|
|
|
|
|
|
| |
Split DocDriver into DocDriver and DefaultDocDriver in moving towards
support documentation plugins.
|
|
|
|
|
| |
Added back 'lazy' modifier to generator's global field.
|
|
|
|
|
|
| |
fixed #1281, reverted Sean's lazy generator in Main which broke the
build
|
| |
|
| |
|
|
|
|
|
|
| |
Changed organisation of Scalac's command-line options to split them into
three categories: every-day use, advanced (-X) and private (-Y).
|
| |
|
| |
|