alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Scala example source code file (AestheticSettings.scala)

This example Scala source code file (AestheticSettings.scala) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Scala tags/keywords

aestheticsettings, aestheticsettings, none, none, option, option, setting, settings, settings

The Scala AestheticSettings.scala source code

/* NSC -- new Scala compiler
 * Copyright 2005-2011 LAMP/EPFL
 * @author  Paul Phillips
 */

package scala.tools.nsc
package settings

/** Taking flag checking to a somewhat higher level. */
trait AestheticSettings {
  def settings: Settings
  
  // Some(value) if setting has been set by user, None otherwise.
  def optSetting[T](s: Settings#Setting): Option[T] =
    if (s.isDefault) None else Some(s.value.asInstanceOf[T])
  
  def script       = optSetting[String](settings.script)
  def encoding     = optSetting[String](settings.encoding)
  def sourceReader = optSetting[String](settings.sourceReader)
  
  def debug           = settings.debug.value
  def declsOnly       = false
  def deprecation     = settings.deprecation.value
  def experimental    = settings.Xexperimental.value
  def fatalWarnings   = settings.fatalWarnings.value
  def logClasspath    = settings.Ylogcp.value
  def printStats      = settings.Ystatistics.value
  def richExes        = settings.YrichExes.value || sys.props.traceSourcePath.isSet
  def target          = settings.target.value
  def unchecked       = settings.unchecked.value
  def verbose         = settings.verbose.value

  /** Derived values */
  def jvm           = target startsWith "jvm"
  def msil          = target == "msil"
  def verboseDebug  = debug && verbose
}

Other Scala examples (source code examples)

Here is a short list of links related to this Scala AestheticSettings.scala source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.