summaryrefslogtreecommitdiff
path: root/src/library/scalax/util/control
diff options
context:
space:
mode:
authorAntonio Cunei <antonio.cunei@epfl.ch>2008-11-25 18:05:48 +0000
committerAntonio Cunei <antonio.cunei@epfl.ch>2008-11-25 18:05:48 +0000
commitaf47e5b433ea538bf096a176c88f3c91116e09cd (patch)
treeb3e66e93fb653570ebbef16183cf4f2be2111c12 /src/library/scalax/util/control
parent2d61f09332dbc6038f869c6a23a95dca1bc3b6c7 (diff)
downloadscala-af47e5b433ea538bf096a176c88f3c91116e09cd.tar.gz
scala-af47e5b433ea538bf096a176c88f3c91116e09cd.tar.bz2
scala-af47e5b433ea538bf096a176c88f3c91116e09cd.zip
Merging everything from the 2.8.x development b...
Merging everything from the 2.8.x development branch back to trunk. - If you were working on trunk, please keep working on trunk If you were - working on 2.8-devel, please switch to trunk now
Diffstat (limited to 'src/library/scalax/util/control')
-rwxr-xr-xsrc/library/scalax/util/control/Break.scala15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/library/scalax/util/control/Break.scala b/src/library/scalax/util/control/Break.scala
new file mode 100755
index 0000000000..173188d2e9
--- /dev/null
+++ b/src/library/scalax/util/control/Break.scala
@@ -0,0 +1,15 @@
+package scalax.util.control
+
+object Break {
+ private class BreakException extends RuntimeException
+ private val breakException = new BreakException
+ def break { throw breakException }
+ def breakable(op: => Unit) {
+ try {
+ op
+ } catch {
+ case ex: BreakException =>
+ }
+ }
+}
+