~ubuntu-branches/debian/sid/scala/sid

« back to all changes in this revision

Viewing changes to src/compiler/scala/tools/nsc/reporters/Reporter.scala

  • Committer: Package Import Robot
  • Author(s): Emmanuel Bourg, Mehdi Dogguy, Lucas Satabin, Frank S. Thomas, Emmanuel Bourg
  • Date: 2015-06-05 23:52:59 UTC
  • mfrom: (1.2.11)
  • Revision ID: package-import@ubuntu.com-20150605235259-wk00vgk83dh8o19g
Tags: 2.10.5-1
* Team upload.

[ Mehdi Dogguy ]
* New upstream release (Closes: #744278).

[ Lucas Satabin ]
* Update patches
* Update the clean target
* Update paths of elements to install
* Update watch file

[ Frank S. Thomas ]
* Remove myself from Uploaders.

[ Emmanuel Bourg ]
* The package has been adopted by the Java Team (Closes: #754935)
* Patched the build to avoid downloading libraries from the Internet
* Replaced the minified JavaScript files with unobfuscated ones
* No longer build scala-partest.jar until diffutils is packaged or replaced
* debian/watch: Fixed the versions matched (x.y.z instead of x.y.z..z)
* debian/rules:
  - Added the missing get-orig-source target (Closes: #724704)
  - Improved the clean target
* debian/control:
  - Build depend on scala (>= 2.10) and bnd
  - Use canonical URLs for the Vcs-* fields
  - Standards-Version updated to 3.9.6 (no changes)
* Switch to debhelper level 9

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* NSC -- new Scala compiler
2
 
 * Copyright 2002-2011 LAMP/EPFL
 
2
 * Copyright 2002-2013 LAMP/EPFL
3
3
 * @author Martin Odersky
4
4
 */
5
5
 
6
6
package scala.tools.nsc
7
7
package reporters
8
8
 
9
 
import scala.tools.nsc.util._
10
 
import scala.tools.util.StringOps
11
 
import StringOps._
 
9
import scala.reflect.internal.util._
 
10
import scala.reflect.internal.util.StringOps._
12
11
 
13
12
/**
14
13
 * This interface provides methods to issue information, warning and
21
20
  class Severity(val id: Int) extends severity.Value {
22
21
    var count: Int = 0
23
22
  }
24
 
  val INFO    = new Severity(0)
25
 
  val WARNING = new Severity(1)
26
 
  val ERROR   = new Severity(2)
 
23
  val INFO    = new Severity(0) {
 
24
    override def toString: String = "INFO"
 
25
  }
 
26
  val WARNING = new Severity(1) {
 
27
    override def toString: String = "WARNING"
 
28
  }
 
29
  val ERROR   = new Severity(2) {
 
30
    override def toString: String = "ERROR"
 
31
  }
27
32
 
28
33
  /** Whether very long lines can be truncated.  This exists so important
29
34
   *  debugging information (like printing the classpath) is not rendered
47
52
    finally incompleteHandler = saved
48
53
  }
49
54
 
50
 
  var cancelled         = false
51
 
  def hasErrors         = ERROR.count > 0 || cancelled
52
 
  def hasWarnings       = WARNING.count > 0
53
 
 
54
 
  def    info(pos: Position, msg: String, force: Boolean) { info0(pos, msg,    INFO, force) }
55
 
  def warning(pos: Position, msg: String                ) { info0(pos, msg, WARNING, false) }
56
 
  def   error(pos: Position, msg: String                ) { info0(pos, msg,   ERROR, false) }
57
 
  def incompleteInputError(pos: Position, msg: String   ) {
 
55
  var cancelled   = false
 
56
  def hasErrors   = ERROR.count > 0 || cancelled
 
57
  def hasWarnings = WARNING.count > 0
 
58
 
 
59
  /** For sending a message which should not be labeled as a warning/error,
 
60
   *  but also shouldn't require -verbose to be visible.
 
61
   */
 
62
  def echo(msg: String): Unit                                = info(NoPosition, msg, true)
 
63
  def echo(pos: Position, msg: String): Unit                 = info(pos, msg, true)
 
64
 
 
65
  /** Informational messages, suppressed unless -verbose or force=true. */
 
66
  def info(pos: Position, msg: String, force: Boolean): Unit = info0(pos, msg, INFO, force)
 
67
 
 
68
  /** Warnings and errors. */
 
69
  def warning(pos: Position, msg: String): Unit              = withoutTruncating(info0(pos, msg, WARNING, false))
 
70
  def error(pos: Position, msg: String): Unit                = withoutTruncating(info0(pos, msg, ERROR, false))
 
71
  def incompleteInputError(pos: Position, msg: String): Unit = {
58
72
    if (incompleteHandled) incompleteHandler(pos, msg)
59
73
    else error(pos, msg)
60
74
  }
69
83
  }
70
84
 
71
85
  // sbt compat
72
 
  @deprecated("Moved to scala.tools.util.StringOps", "2.10.0")
 
86
  @deprecated("Moved to scala.reflect.internal.util.StringOps", "2.10.0")
73
87
  def countElementsAsString(n: Int, elements: String): String = StringOps.countElementsAsString(n, elements)
74
 
  @deprecated("Moved to scala.tools.util.StringOps", "2.10.0")
 
88
  @deprecated("Moved to scala.reflect.internal.util.StringOps", "2.10.0")
75
89
  def countAsString(n: Int): String = StringOps.countAsString(n)
76
90
}