diff options
author | Som Snytt <som.snytt@gmail.com> | 2013-07-03 02:06:25 -0700 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2013-07-04 07:55:15 -0700 |
commit | 596b85373b0203e7557f71e1bced980e277ec751 (patch) | |
tree | b379fbd87975937dd2d750bc276e2c65ec333d65 /src/compiler | |
parent | 4222849b14e64f668e7250bc2decef15eea5822a (diff) | |
download | scala-596b85373b0203e7557f71e1bced980e277ec751.tar.gz scala-596b85373b0203e7557f71e1bced980e277ec751.tar.bz2 scala-596b85373b0203e7557f71e1bced980e277ec751.zip |
SI-4594 Repl settings command
A settings command for the rest of us.
The usual command line options are used, except that boolean flags
are enabled with +flag and disabled with -flag.
```
scala> :settings +deprecation
scala> new BigInt(java.math.BigInteger.TEN) { }
<console>:8: warning: inheritance from class BigInt in package math is deprecated: This class will me made final.
new BigInt(java.math.BigInteger.TEN) { }
^
res0: BigInt = 10
scala> :settings -deprecation
scala> new BigInt(java.math.BigInteger.TEN) { }
res1: BigInt = 10
```
Multivalue "colon" options can be reset by supplying no values
after the colon. This behavior is different from the command line.
```
scala> 1 toString
warning: there were 1 feature warning(s); re-run with -feature for details
res0: String = 1
scala> :settings -language:postfixOps
scala> 1 toString
res1: String = 1
scala> :settings
-d = .
-encoding = UTF-8
-explaintypes = false
-language = List(postfixOps)
-nowarn = false
scala> :settings -language:
scala> :settings
-d = .
-encoding = UTF-8
-explaintypes = false
-language = List()
-nowarn = false
```
Diffstat (limited to 'src/compiler')
0 files changed, 0 insertions, 0 deletions