summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/settings/MutableSettings.scala
Commit message (Collapse)AuthorAgeFilesLines
* SI-9729 -Xmaxerrs to limit messagesSom Snytt2017-01-311-5/+5
| | | | | Since 2.7.2, console reporter has limited error messages to a fixed 100. Use `-Xmaxerrs -Xmaxwarns` as from `javac` to configure.
* Merge 2.11.x into 2.12.xAdriaan Moors2016-10-181-5/+13
|\ | | | | | | | | | | | | | | Fix conflict in #5453: ``` - def help: String = { + override def help: String = { ```
| * SI-9832 -Xlint:help shows defaultSom Snytt2016-10-111-5/+13
| | | | | | | | | | | | Conclude help method with the default list. Extra words are supplied for underscore.
* | Allow per-choice help in ChoiceSettingLukas Rytz2016-09-021-8/+23
| |
* | Allow all settings to be helpingLukas Rytz2016-09-011-2/+2
| |
* | Require and target Java 8Jason Zaugg2015-05-261-0/+7
|/ | | | | | | | | | | | | | | - Require Java 8 in ant build - use -source 1.8 and -target 1.8 for javac - Default scalac's -target to `jvm-1.8`, ignore and deprecate attempts to use `jvm-1.{6.7}` - Remove fragile javap-app test. The feature itself is slated for removal. - Remove obsolete Java6 checkfile - Adapt DCE tests - Remove deprecated/redundant -target:jvm-1.6 from flags where the intent was to trigger generation of stack map frames. - Remove tests with -target:jvm-1.5 that tested without stack map frames - Ignore OpenJDK JVM warnings (via test/[files|scaladoc]/filters).
* Fix default value for ScalaVersionSettingLukas Rytz2014-11-041-9/+17
| | | | | | | | | | | The default value was NoScalaVersion before, because tryToSet (where the default was supposed to be set) is not called at all if the option is not specified. The initial value of Xmigration is set to NoScalaVersion (which it was before, the AnyScalaVersion argument was ignored). AnyScalaVersion would be wrong, it would give a warning in `Map(1 -> "eis").values` if the option was not specified. See tests.
* SI-6502 Repl reset/replay take settings argsSom Snytt2014-09-221-6/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The reset and replay commands take arbitrary command line args. When settings args are supplied, the compiler is recreated. For uniformity, the settings command performs only the usual arg parsing: use -flag:true instead of +flag, and clearing a setting is promoted to the command line, so that -Xlint: is not an error but clears the flags. ``` scala> maqicode.Test main null <console>:8: error: not found: value maqicode maqicode.Test main null ^ scala> :reset -classpath/a target/scala-2.11/sample_2.11-1.0.jar Resetting interpreter state. Forgetting all expression results and named terms: $intp scala> maqicode.Test main null Hello, world. scala> val i = 42 i: Int = 42 scala> s"$i is the loneliest numbah." res1: String = 42 is the loneliest numbah. scala> :replay -classpath "" Replaying: maqicode.Test main null Hello, world. Replaying: val i = 42 i: Int = 42 Replaying: s"$i is the loneliest numbah." res1: String = 42 is the loneliest numbah. scala> :replay -classpath/a "" Replaying: maqicode.Test main null <console>:8: error: not found: value maqicode maqicode.Test main null ^ Replaying: val i = 42 i: Int = 42 Replaying: s"$i is the loneliest numbah." res1: String = 42 is the loneliest numbah. ``` Clearing a clearable setting: ``` scala> :reset -Xlint:missing-interpolator Resetting interpreter state. scala> { val i = 42 ; "$i is the loneliest numbah." } <console>:8: warning: possible missing interpolator: detected interpolated identifier `$i` { val i = 42 ; "$i is the loneliest numbah." } ^ res0: String = $i is the loneliest numbah. scala> :reset -Xlint: Resetting interpreter state. Forgetting this session history: { val i = 42 ; "$i is the loneliest numbah." } scala> { val i = 42 ; "$i is the loneliest numbah." } res0: String = $i is the loneliest numbah. ```
* Make MultiChoiceSetting.compute easier to understandLukas Rytz2014-09-081-18/+11
|
* Address PR feedback, fix MultiChoiceSetting.containsLukas Rytz2014-09-081-3/+4
|
* Use Enumeration for MultiChoiceSettingSom Snytt2014-09-051-87/+154
| | | | | | | | | | | This is pretty easy, since a ValueSet is a BitSet. When the setting is updated, recompute the current set of values, which is cheap and succinct. Checking a flag is also easy and fast. Choices in MultiChoiceSettings may enable other choices.
* -Ystatistics accepts a list of phases, cleanups in MultiChoiceSettingLukas Rytz2014-09-021-24/+98
| | | | | MultiChoiceSetting and Xlint with its deprecated aliases is now a bit simpler, but there's still room for improvement, as noted in comments.
* SI-8736 Error if no arg and no defaultSom Snytt2014-07-201-6/+9
| | | | | | | | | | Now `-language` with no option will emit an error: ``` $ skalac -feature -language unused.scala scalac error: '-language' requires an option. See '-language:help'. scalac -help gives more information ```
* SI-8736 Restore -language to former glorySom Snytt2014-07-201-6/+13
| | | | | | | | | | | | | | | | | | | | | | MultiChoice allows -language to work like -Xlint. The bug as described was that the setting value was set instead of updated (++=) with additional flags. The unreported bug was that `_` no longer set all settings. The corrected behavior is that "contains" means "it was enabled, or _ was set and it was not disabled explicitly." That is the behavior of `-Xlint` but with a different mechanism, since each lint option is a Setting. A semantic difference is that -Xlint enables all the lint options, but -language does not enable all the language features. `scalac -X` does not explain this additional behavior of the `-Xlint` flag. Also worth noting that `scalac -feature -language unused.scala` failed in 2.11.1 but succeeds silently now.
* SI-8525 MultiChoice takes a helper functionSom Snytt2014-07-181-5/+8
| | | | | | Clean-up code review comments. MultiChoice takes a helper function for outputting help text.
* SI-8525 Multichoice helpSom Snytt2014-07-171-6/+11
| | | | | | Enables -Xlint:help and -language:help. The Settings API makes it difficult to innovate.
* SI-8525 Clarify usage of -Xlint:_,flagSom Snytt2014-07-161-5/+4
| | | | | | | | | | | | | | | | | | | | | Also clarify usage of -Xlint flag. Align more with javac -Xlint:all,-flag,flag where once a flag is explicitly enabled it cannot be disabled, but where the wildcard is a backstop only. (There is no all option yet here.) -Xlint and -Xlint:_ just set a flag which is consulted by any unset lint warning. Xlint warnings consult the state of Xlint when they are unset. Individual -Ywarn-ings do not. Other warnings are explicitly set to false. They can only be enabled programmatically. Some tests are corrected. Also, option order is no longer significant, see the unit test.
* SI-8525 Add -Xlint:-warn-missing-interpolatorSom Snytt2014-07-081-25/+36
| | | | | | | | | | Turn off lint warnings with negating prefix, and add a lint-only warning for the infamously nagging "Did you forget the interpolator?" That message is made more dignified. Without `-Xlint:false`, there is no mechanism to turn off anonymous linters once `-Xlint` is selected.
* SI-8616 Error on -deprecation:true,falseSom Snytt2014-07-081-2/+3
| | | | | | | | This is an error, not a crash. Alternatively, one could define the multivalued colon case as equivalent to specifying the option multiple times. That would be very regular. But sometimes it's nicer just to error out.
* SI-8610 -Xlint is multichoice optionSom Snytt2014-07-081-17/+31
| | | | | | | | | | | | | | | | | | | | | Make -Xlint a "multichoice" option for purposes of option parsing. This allows turning on "lint with these warnings" instead of only "turn off these warnings but enable other lint warnings". ``` $ scalac -Xlint:warn-adapted-args linty.scala # lint plus a warning $ scalac -Xlint warn-adapted-args linty.scala # same $ scalac -Xlint linty.scala # same as now $ scalac -Xlint -- linty.scala # ok, not necessary $ scalac -Xlint _ -- linty.scala # another funky underscore ``` This would also enable Xlint options that are not standalone options, although that is not implemented in this commit. For example, `-Xlint:no-missing-interpolator` could be used to disable that warning. (There is no `-Xoption:flavor=off` syntax.) (`no-` switches would not be enabled by `_`.)
* SI-5905 Restore -language:_Som Snytt2014-03-021-0/+3
| | | | | | | | | | | Underscore means all. -x:c,b,a,_ results in value c,b,a,a,b,c,d,... Currently, -Xprint does not present phases as a closed set of choices; there is ad hoc checking in Global. That would be a nice unification. (You don't know the list of choices until after global is constructed.)
* SI-5905 Sanity check -language optionsSom Snytt2014-02-281-3/+19
| | | | | | | | | | The option names are hardcoded, but checked by a test. There are no hooks to verify options after the compiler is constructed. Introduced a `MultiChoiceSetting` required for the setting creation framework.
* Group settings should honor user-set individual optionsJason Zaugg2014-02-171-0/+10
| | | | | | | | | | | | | | | In the last commit, we added the ability to explicitly disable boolean settings form the command line. This commit changes group settings (like -optimize), to leave them alone if set explicitly. Examples: `scalac -Xlint -Ywarn-unused:false -optimize -Yinline:false` The mechanism for such settings has also been refactored to `MutableSettings`, to let use reuse this for `-Xlint`.
* Expose a means to disable boolean settingsJason Zaugg2014-02-171-0/+11
| | | | | | Enables `-Yboolean-setting:{true,false}`. This will be exploited in the next commit to enable one to turn off a single component of a group setting, such as `-Xlint` or `-optimize`.
* SI-4594 Enable mutating mutable multi settingsSom Snytt2013-07-041-32/+39
| | | | | | Previously, multi-valued settings (String- and Phase- valued) could be augmented but not cleared. Also, phase settings included lazily cached values that were not recomputed when the setting was changed.
* Remove dependency on combinators from CommandLinerParser.Adriaan Moors2013-06-251-1/+1
| | | | | | | tools.cmd.CommandLineParser uses a small hand-rolled parser TODO: replace partest's usage of scala.tools.nsc.util.CommandLine by scala.tools.cmd.CommandLine
* SI-7337 Error out on missing -d directory.Jason Zaugg2013-04-061-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This check was removed without comment in 3a30af154, the addition of JSR-223 support for the interpreter. After this commit, I manually tested that JSR-223 support works. scala> import javax.script._, collection.JavaConverters._; val manager = new ScriptEngineManager; manager.getEngineByName("scala").eval("List(1)") import javax.script._ import collection.JavaConverters._ manager: javax.script.ScriptEngineManager = javax.script.ScriptEngineManager@4418f61b res1: Object = List(1) 3a30af154 did not include a test case, so I don't know whether I've broken some other aspect of it. I tried the above as a `run` test, but hit two problems, one of them seemingly our fault, and the other a MacOS JDK wrinkle. 1. scala.reflect.internal.MissingRequirementError: object scala.runtime in compiler mirror not found. 2. java.lang.UnsatisfiedLinkError: no AppleScriptEngine in java.library.path I can't find my way to fix these, so JSR-223 remains untested. I don't think that commit was really up to standard; it could handle additional review, documentation, and testing. It might even be modularized so as not to pollute the REPL itself.
* Merge pull request #2239 from paulp/pr/warningsAdriaan Moors2013-03-211-5/+3
|\ | | | | Warnings removal and other cleanup.
| * Eliminate a bunch of -Xlint warnings.Paul Phillips2013-03-121-5/+3
| | | | | | | | | | | | Mostly unused private code, unused imports, and points where an extra pair of parentheses is necessary for scalac to have confidence in our intentions.
* | SI-874 actual JSR-223 implementationRaphael Jolly2013-03-111-2/+2
|/
* Name boolean arguments in src/compiler.Jason Zaugg2013-03-051-7/+7
| | | | | | | | | | What would you prefer? adaptToMemberWithArgs(tree, qual, name, mode, false, false) Or: adaptToMemberWithArgs(tree, qual, name, mode, reportAmbiguous = false, saveErrors = false)
* Be explicit about empty param list calls.Jason Zaugg2013-02-241-2/+2
| | | | With the exception of toString and the odd JavaBean getter.
* Merge commit 'b403234a27' into wip/fresh-merge2Paul Phillips2013-02-011-0/+30
|\ | | | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/matching/ParallelMatching.scala src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala test/files/neg/t6963.check
| * SI-6963 Add version to -XmigrationJames Iry2013-01-291-0/+30
| | | | | | | | | | | | | | | | | | Adds an optional version parameter to the -Xmigration compiler setting. Doing -Xmigration without version number behaves as it used to by dumping every possible migration warning. This commit adds a ScalaVersion class (plus ancillary stuff), and a ScalaVersionSetting.
* | Remove code from compiler central.Paul Phillips2012-11-201-5/+5
| | | | | | | | | | All those old-timey methods whose melodies have become unfashionable.
* | Revert "Commenting out unused members."Paul Phillips2012-11-191-5/+5
| | | | | | | | This reverts commit 951fc3a486.
* | Commenting out unused members.Paul Phillips2012-11-191-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I want to get this commit into the history because the tests pass here, which demonstrates that every commented out method is not only unnecessary internally but has zero test coverage. Since I know (based on the occasional source code comment, or more often based on knowing something about other source bases) that some of these can't be removed without breaking other things, I want to at least record a snapshot of the identities of all these unused and untested methods. This commit will be reverted; then there will be another commit which removes the subset of these methods which I believe to be removable. The remainder are in great need of tests which exercise the interfaces upon which other repositories depend.
* | Address obvious bug in MutableSettings.Paul Phillips2012-11-131-21/+14
| | | | | | | | | | | | If x startsWith "-" it seems unlikely that x == "". Free with purchase: test case with 100 argument permutations. That's only a smidgen shy of infinity.
* | Removed unused imports.Paul Phillips2012-11-061-1/+0
|/ | | | | | | | | 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
|
* Fixes SI-6268. Review by @paulp and @lrytz.Josh Suereth2012-09-121-1/+1
| | | | | | | | | | | | | | | This reverts a refactoring from https://github.com/scala/scala/commit/963aabbeb4 MultiString settings would not properly write an unparse string that could be reparsed, leading to failures when forking scalac in ant. Specifically, if a setting was empty, it was getting added to the unparse string and causing scalac to fail. This at least reverts to previous behavior (also more correct for multiple values). Whatever we do here has to work with the @file style argument reading and can't place empty options on the command line. Also, This assumes there are tests around the behvior the REPL needs. Note: The test is not automated yet, so unfortunately, we need to improve ANT testing capabilities to prevent regressons
* Merge pull request #1072 from adriaanm/copyrightJosh Suereth2012-08-071-1/+1
|\ | | | | update and normalize copyright notice
| * 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 ```
* | Fix for SI-4945, repl hang on -i input.Paul Phillips2012-08-061-2/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | Other breakage had accumulated among Settings. I determined that once upon a time, "MultiStringSetting" accepted arguments like this: scala -foo bip bop bar Somewhere this was changed to force a : argument, like scala -foo:bip,bop,bar This incurs breakage. The repl has always advertised its -i option without a colon and it has always been a MultiStringSetting. Forcing everything into the : seemed like the wrong thing, especially because it will stomp on any whitespace containing arguments, whereas in the original form scala -foo bip "bop bar" baz will yield its arguments as given. So lacking any good ideas and knowing something probably depends on each way already, I made it work both ways.
* moves positions to scala.reflect.internal.utilEugene Burmako2012-06-081-3/+4
| | | | This is the first step of factoring out scala-reflect.jar.
* removes tags and their incantations from PredefEugene Burmako2012-06-081-0/+1
| | | | | | All tags and reflection-related stuff requires a prefix, be it scala.reflect for simple tags (ArrayTags and ClassTags), or scala.reflect.basis/scala.reflect.runtime.universe for type tags.
* ClassTag.erasure => ClassTag.runtimeClassEugene Burmako2012-06-081-1/+1
| | | | | This change is made to be consistent with JavaMirrors. And, in my opinion, a technology-neutral term is better here.
* migrates stdlib and compiler to tagsEugene Burmako2012-04-231-2/+2
| | | | | * all usages of ClassManifest and Manifest are replaced with tags * all manifest tests are replaced with tag tests
* Enabling postfix ops feature warning, and working on libs to avoid them.Martin Odersky2012-04-121-1/+1
|
* Next generation of macrosEugene Burmako2012-04-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | Implements SIP 16: Self-cleaning macros: http://bit.ly/wjjXTZ Features: * Macro defs * Reification * Type tags * Manifests aliased to type tags * Extended reflection API * Several hundred tests * 1111 changed files Not yet implemented: * Reification of refined types * Expr.value splicing * Named and default macro expansions * Intricacies of interaction between macros and implicits * Emission of debug information for macros (compliant with JSR-45) Dedicated to Yuri Alekseyevich Gagarin