summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/Main.scala
Commit message (Collapse)AuthorAgeFilesLines
* SI-9350 Command option -XreporterSom Snytt2015-06-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Eliminated the accumulated feature warnings.Paul Phillips2013-04-231-0/+2
| | | | | | | | | 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
* SI-7261 Implicit conversion of BooleanSetting to Boolean and BooleanFlagSom Snytt2013-03-271-1/+1
| | | | | | | 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.
* Disentangled RangePositions from interactive.Paul Phillips2013-03-041-41/+11
| | | | | | | 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.
* Be explicit about empty param list calls.Jason Zaugg2013-02-241-1/+1
| | | | With the exception of toString and the odd JavaBean getter.
* SI-6964 Remove build managers, both simple and refined.Jason Zaugg2013-01-121-18/+0
| | | | | | | | | 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/
* Expunged the .net backend.Paul Phillips2012-12-051-6/+1
| | | | | | | | 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.
* Removed unused imports.Paul Phillips2012-11-061-4/+1
| | | | | | | | | 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".
* Brings all copyrights (in comments) up-to-date, from 2011/12 to 2013Heather Miller2012-11-021-1/+1
|
* update and normalize copyright noticeAdriaan Moors2012-08-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ```
* Attempt #2 to optimize findMemberMartin Odersky2012-07-141-4/+2
|
* moves positions to scala.reflect.internal.utilEugene Burmako2012-06-081-1/+1
| | | | This is the first step of factoring out scala-reflect.jar.
* Use normal Global with RangePositions instead o...Hubert Plociniczak2011-10-051-1/+1
| | | | | | Use normal Global with RangePositions instead of interactive Global when Yrangepos is on. No review
* Made it possible to supply a custom Global to t...Paul Phillips2011-09-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ...Martin Odersky2011-08-241-58/+14
| | | | | | | | 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 tr...Paul Phillips2011-02-091-4/+5
| | | | | | | | | 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.
* Towards better error handling in the IDE.Martin Odersky2011-02-071-2/+2
|
* Updated copyright notices to 2011Antonio Cunei2011-01-201-1/+1
|
* Imported sbt.Process into trunk, in the guise o...Paul Phillips2011-01-121-1/+1
| | | | | | | | | | | | | | | | | | | 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 er...Paul Phillips2010-12-051-4/+4
| | | | | | | | | | | | | | 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...Paul Phillips2010-11-131-38/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* New wider interface of presentation compiler.Martin Odersky2010-08-301-3/+1
|
* Removed more than 3400 svn '$Id' keywords and r...Antonio Cunei2010-05-121-1/+0
| | | | | Removed more than 3400 svn '$Id' keywords and related junk.
* While working on partest discovered that Compil...Paul Phillips2010-03-251-3/+3
| | | | | | | | | | | | | | | | | | | 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...Paul Phillips2010-02-231-9/+8
| | | | | | | | | 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 a...Miles Sabin2009-12-231-0/+1
| | | | | | In resident mode the reporter should be reset after each compiler Run. review by odersky.
* Updated copyright notices to 2010Antonio Cunei2009-12-071-1/+1
|
* added numeric widening and weak conformance.Martin Odersky2009-11-061-3/+2
|
* Added -Ybuilder-debug:[none,simple,refined] opt...Miles Sabin2009-10-301-0/+18
| | | | | | | 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 b...Miles Sabin2009-10-191-0/+1
| | | | | | | 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.
* Deprecation patrol continues patrolling.Paul Phillips2009-08-221-1/+1
|
* Added notification to BuildManager clients of f...Miles Sabin2009-07-311-0/+1
| | | | | | | | 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 pos...Miles Sabin2009-07-271-9/+4
| | | | | | | | 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 validatio...Miles Sabin2009-07-141-10/+11
| | | | | | Fixed a couple of position bugs; made validation output a bit more informative and readable.
* Added -Yide-debug option to exercise the intera...Miles Sabin2009-07-141-1/+20
| | | | | | Added -Yide-debug option to exercise the interactive compiler from the command-line; made validation errors a bit more informative.
* Fixed positionsMartin Odersky2009-07-051-1/+3
|
* In "Iterable" and in all its subclasses, "itera...Gilles Dubochet2009-05-271-1/+1
| | | | | | In "Iterable" and in all its subclasses, "iterator" replaces "elements" (and assorted changes).
* some documentation; statistics wrt implicits; n...Martin Odersky2009-05-221-2/+2
| | | | | some documentation; statistics wrt implicits; new presentation compiler
* massive new collections checkin.Martin Odersky2009-05-081-1/+1
|
* Updated copyright notices to 2009Antonio Cunei2009-01-091-1/+1
|
* Fix for #296Antonio Cunei2008-10-151-15/+4
| | | | | | | | | | | 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.
* Main accepts, but ignores -Ydoc.Geoffrey Washburn2008-03-051-10/+1
| | | | | | | 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 DefaultDocDr...Geoffrey Washburn2008-02-211-3/+3
| | | | | | Split DocDriver into DocDriver and DefaultDocDriver in moving towards support documentation plugins.
* Added back 'lazy' modifier to generator's globa...Iulian Dragos2007-08-221-1/+1
| | | | | Added back 'lazy' modifier to generator's global field.
* fixed #1281, reverted Sean's lazy generator in ...Burak Emir2007-08-211-1/+1
| | | | | | fixed #1281, reverted Sean's lazy generator in Main which broke the build
* Fixing scaladoc bugSean McDirmid2007-08-211-1/+1
|
* updated syntaxmichelou2007-08-201-3/+3
|
* Changed organisation of Scalac's command-line o...Gilles Dubochet2007-07-161-9/+11
| | | | | | Changed organisation of Scalac's command-line options to split them into three categories: every-day use, advanced (-X) and private (-Y).
* added prompt/fileEnding propertiesmichelou2007-06-191-1/+2
|
* removed .NET specifics from Scala commandsmichelou2007-06-181-0/+8
|