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

« back to all changes in this revision

Viewing changes to src/compiler/scala/tools/nsc/matching/Matrix.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 2005-2011 LAMP/EPFL
 
2
 * Copyright 2005-2013 LAMP/EPFL
3
3
 * Author: Paul Phillips
4
4
 */
5
5
 
9
9
import transform.ExplicitOuter
10
10
import symtab.Flags
11
11
import scala.collection.mutable
 
12
import scala.language.implicitConversions
12
13
 
13
14
trait Matrix extends MatrixAdditions {
14
15
  self: ExplicitOuter with ParallelMatching =>
23
24
 
24
25
  /** Translation of match expressions.
25
26
   *
26
 
   *  `p':  pattern
27
 
   *  `g':  guard
28
 
   *  `bx': body index
 
27
   *  `p`:  pattern
 
28
   *  `g`:  guard
 
29
   *  `bx`: body index
29
30
   *
30
31
   *   internal representation is (tvars:List[Symbol], rows:List[Row])
31
32
   *
122
123
    private val _syntheticSyms = mutable.HashSet[Symbol]()
123
124
    def clearSyntheticSyms() = {
124
125
      _syntheticSyms foreach (_ resetFlag (NO_EXHAUSTIVE|MUTABLE))
125
 
      if (settings.debug.value)
126
 
        log("Cleared NO_EXHAUSTIVE/MUTABLE on " + _syntheticSyms.size + " synthetic symbols.")
 
126
      debuglog("Cleared NO_EXHAUSTIVE/MUTABLE on " + _syntheticSyms.size + " synthetic symbols.")
127
127
      _syntheticSyms.clear()
128
128
    }
129
129
    def recordSyntheticSym(sym: Symbol): Symbol = {
199
199
    class PatternVar(val lhs: Symbol, val rhs: Tree, val checked: Boolean) {
200
200
      def sym = lhs
201
201
      def tpe = lhs.tpe
 
202
      if (checked)
 
203
        lhs resetFlag NO_EXHAUSTIVE
 
204
      else
 
205
        lhs setFlag NO_EXHAUSTIVE
202
206
 
203
207
      // See #1427 for an example of a crash which occurs unless we retype:
204
208
      // in that instance there is an existential in the pattern.
208
212
      override def toString() = "%s: %s = %s".format(lhs, tpe, rhs)
209
213
    }
210
214
 
211
 
    /** Sets the rhs to EmptyTree, which makes the valDef ignored in Scrutinee.
212
 
     */
213
 
    def specialVar(lhs: Symbol, checked: Boolean) =
214
 
      new PatternVar(lhs, EmptyTree, checked)
215
 
 
216
215
    /** Given a tree, creates a new synthetic variable of the same type
217
216
     *  and assigns the tree to it.
218
217
     */
253
252
    {
254
253
      val n = if (name == null) cunit.freshTermName("temp") else name
255
254
      // careful: pos has special meaning
256
 
      recordSyntheticSym(owner.newVariable(pos, n) setInfo tpe setFlag (SYNTHETIC.toLong /: flags)(_|_))
 
255
      val flagsLong = (SYNTHETIC.toLong /: flags)(_|_)
 
256
      recordSyntheticSym(owner.newVariable(n, pos, flagsLong) setInfo tpe)
257
257
    }
258
258
  }
259
 
}
 
 
b'\\ No newline at end of file'
 
259
}