adapted to Scala 2.8.0 Beta 1;
authorwenzelm
Tue Mar 30 00:13:27 2010 +0200 (2010-03-30)
changeset 360156111de7c916a
parent 36014 c51a077680e4
child 36016 4f5c7a19ebe0
adapted to Scala 2.8.0 Beta 1;
src/Pure/System/standard_system.scala
src/Tools/jEdit/src/jedit/document_model.scala
src/Tools/jEdit/src/jedit/document_view.scala
src/Tools/jEdit/src/jedit/html_panel.scala
src/Tools/jEdit/src/jedit/isabelle_encoding.scala
src/Tools/jEdit/src/jedit/isabelle_hyperlinks.scala
src/Tools/jEdit/src/jedit/isabelle_sidekick.scala
src/Tools/jEdit/src/jedit/output_dockable.scala
src/Tools/jEdit/src/jedit/plugin.scala
src/Tools/jEdit/src/jedit/protocol_dockable.scala
src/Tools/jEdit/src/jedit/scala_console.scala
     1.1 --- a/src/Pure/System/standard_system.scala	Tue Mar 30 00:12:42 2010 +0200
     1.2 +++ b/src/Pure/System/standard_system.scala	Tue Mar 30 00:13:27 2010 +0200
     1.3 @@ -20,7 +20,7 @@
     1.4  object Standard_System
     1.5  {
     1.6    val charset = "UTF-8"
     1.7 -  val codec = Codec(charset)
     1.8 +  def codec(): Codec = Codec(charset)
     1.9  
    1.10  
    1.11    /* permissive UTF-8 decoding */
    1.12 @@ -136,7 +136,7 @@
    1.13    def process_output(proc: Process): (String, Int) =
    1.14    {
    1.15      proc.getOutputStream.close
    1.16 -    val output = Source.fromInputStream(proc.getInputStream)(codec).mkString  // FIXME
    1.17 +    val output = Source.fromInputStream(proc.getInputStream)(codec()).mkString  // FIXME
    1.18      val rc =
    1.19        try { proc.waitFor }
    1.20        finally {
     2.1 --- a/src/Tools/jEdit/src/jedit/document_model.scala	Tue Mar 30 00:12:42 2010 +0200
     2.2 +++ b/src/Tools/jEdit/src/jedit/document_model.scala	Tue Mar 30 00:13:27 2010 +0200
     2.3 @@ -8,6 +8,8 @@
     2.4  package isabelle.jedit
     2.5  
     2.6  
     2.7 +import isabelle._
     2.8 +
     2.9  import scala.actors.Actor, Actor._
    2.10  import scala.collection.mutable
    2.11  
     3.1 --- a/src/Tools/jEdit/src/jedit/document_view.scala	Tue Mar 30 00:12:42 2010 +0200
     3.2 +++ b/src/Tools/jEdit/src/jedit/document_view.scala	Tue Mar 30 00:13:27 2010 +0200
     3.3 @@ -8,6 +8,8 @@
     3.4  package isabelle.jedit
     3.5  
     3.6  
     3.7 +import isabelle._
     3.8 +
     3.9  import scala.actors.Actor._
    3.10  
    3.11  import java.awt.event.{MouseAdapter, MouseEvent}
     4.1 --- a/src/Tools/jEdit/src/jedit/html_panel.scala	Tue Mar 30 00:12:42 2010 +0200
     4.2 +++ b/src/Tools/jEdit/src/jedit/html_panel.scala	Tue Mar 30 00:13:27 2010 +0200
     4.3 @@ -7,6 +7,8 @@
     4.4  package isabelle.jedit
     4.5  
     4.6  
     4.7 +import isabelle._
     4.8 +
     4.9  import java.io.StringReader
    4.10  import java.awt.{BorderLayout, Dimension}
    4.11  import java.awt.event.MouseEvent
     5.1 --- a/src/Tools/jEdit/src/jedit/isabelle_encoding.scala	Tue Mar 30 00:12:42 2010 +0200
     5.2 +++ b/src/Tools/jEdit/src/jedit/isabelle_encoding.scala	Tue Mar 30 00:13:27 2010 +0200
     5.3 @@ -7,14 +7,16 @@
     5.4  package isabelle.jedit
     5.5  
     5.6  
     5.7 +import isabelle._
     5.8 +
     5.9  import org.gjt.sp.jedit.io.Encoding
    5.10  import org.gjt.sp.jedit.buffer.JEditBuffer
    5.11  
    5.12 -import java.nio.charset.{Charset, CharsetDecoder, CodingErrorAction}
    5.13 +import java.nio.charset.{Charset, CodingErrorAction}
    5.14  import java.io.{InputStream, OutputStream, Reader, Writer, InputStreamReader, OutputStreamWriter,
    5.15    CharArrayReader, ByteArrayOutputStream}
    5.16  
    5.17 -import scala.io.{Source, BufferedSource}
    5.18 +import scala.io.{Codec, Source, BufferedSource}
    5.19  
    5.20  
    5.21  object Isabelle_Encoding
    5.22 @@ -28,24 +30,23 @@
    5.23  class Isabelle_Encoding extends Encoding
    5.24  {
    5.25    private val charset = Charset.forName(Standard_System.charset)
    5.26 -  private val BUFSIZE = 32768
    5.27 +  val BUFSIZE = 32768
    5.28  
    5.29 -  private def text_reader(in: InputStream, decoder: CharsetDecoder): Reader =
    5.30 +  private def text_reader(in: InputStream, codec: Codec): Reader =
    5.31    {
    5.32 -    def source(): Source =
    5.33 -      BufferedSource.fromInputStream(in, decoder, BUFSIZE, { () => source() })
    5.34 +    val source = new BufferedSource(in)(codec)
    5.35      new CharArrayReader(Isabelle.system.symbols.decode(source.mkString).toArray)
    5.36    }
    5.37  
    5.38  	override def getTextReader(in: InputStream): Reader =
    5.39 -    text_reader(in, charset.newDecoder())
    5.40 +    text_reader(in, Standard_System.codec())
    5.41  
    5.42  	override def getPermissiveTextReader(in: InputStream): Reader =
    5.43  	{
    5.44 -		val decoder = charset.newDecoder()
    5.45 -		decoder.onMalformedInput(CodingErrorAction.REPLACE)
    5.46 -		decoder.onUnmappableCharacter(CodingErrorAction.REPLACE)
    5.47 -		text_reader(in, decoder)
    5.48 +		val codec = Standard_System.codec()
    5.49 +		codec.onMalformedInput(CodingErrorAction.REPLACE)
    5.50 +		codec.onUnmappableCharacter(CodingErrorAction.REPLACE)
    5.51 +		text_reader(in, codec)
    5.52  	}
    5.53  
    5.54    override def getTextWriter(out: OutputStream): Writer =
     6.1 --- a/src/Tools/jEdit/src/jedit/isabelle_hyperlinks.scala	Tue Mar 30 00:12:42 2010 +0200
     6.2 +++ b/src/Tools/jEdit/src/jedit/isabelle_hyperlinks.scala	Tue Mar 30 00:13:27 2010 +0200
     6.3 @@ -7,6 +7,8 @@
     6.4  package isabelle.jedit
     6.5  
     6.6  
     6.7 +import isabelle._
     6.8 +
     6.9  import java.io.File
    6.10  
    6.11  import gatchan.jedit.hyperlinks.{Hyperlink, HyperlinkSource, AbstractHyperlink}
     7.1 --- a/src/Tools/jEdit/src/jedit/isabelle_sidekick.scala	Tue Mar 30 00:12:42 2010 +0200
     7.2 +++ b/src/Tools/jEdit/src/jedit/isabelle_sidekick.scala	Tue Mar 30 00:13:27 2010 +0200
     7.3 @@ -8,6 +8,8 @@
     7.4  package isabelle.jedit
     7.5  
     7.6  
     7.7 +import isabelle._
     7.8 +
     7.9  import scala.collection.Set
    7.10  import scala.collection.immutable.TreeSet
    7.11  
     8.1 --- a/src/Tools/jEdit/src/jedit/output_dockable.scala	Tue Mar 30 00:12:42 2010 +0200
     8.2 +++ b/src/Tools/jEdit/src/jedit/output_dockable.scala	Tue Mar 30 00:13:27 2010 +0200
     8.3 @@ -7,6 +7,8 @@
     8.4  package isabelle.jedit
     8.5  
     8.6  
     8.7 +import isabelle._
     8.8 +
     8.9  import scala.actors.Actor._
    8.10  
    8.11  import javax.swing.JPanel
     9.1 --- a/src/Tools/jEdit/src/jedit/plugin.scala	Tue Mar 30 00:12:42 2010 +0200
     9.2 +++ b/src/Tools/jEdit/src/jedit/plugin.scala	Tue Mar 30 00:13:27 2010 +0200
     9.3 @@ -9,6 +9,8 @@
     9.4  package isabelle.jedit
     9.5  
     9.6  
     9.7 +import isabelle._
     9.8 +
     9.9  import java.io.{FileInputStream, IOException}
    9.10  import java.awt.Font
    9.11  import javax.swing.JTextArea
    10.1 --- a/src/Tools/jEdit/src/jedit/protocol_dockable.scala	Tue Mar 30 00:12:42 2010 +0200
    10.2 +++ b/src/Tools/jEdit/src/jedit/protocol_dockable.scala	Tue Mar 30 00:13:27 2010 +0200
    10.3 @@ -7,6 +7,8 @@
    10.4  package isabelle.jedit
    10.5  
    10.6  
    10.7 +import isabelle._
    10.8 +
    10.9  import scala.actors.Actor._
   10.10  
   10.11  import java.awt.{Dimension, Graphics, BorderLayout}
    11.1 --- a/src/Tools/jEdit/src/jedit/scala_console.scala	Tue Mar 30 00:12:42 2010 +0200
    11.2 +++ b/src/Tools/jEdit/src/jedit/scala_console.scala	Tue Mar 30 00:13:27 2010 +0200
    11.3 @@ -7,6 +7,8 @@
    11.4  package isabelle.jedit
    11.5  
    11.6  
    11.7 +import isabelle._
    11.8 +
    11.9  import console.{Console, ConsolePane, Shell, Output}
   11.10  
   11.11  import org.gjt.sp.jedit.{jEdit, JARClassLoader}
   11.12 @@ -63,7 +65,7 @@
   11.13  
   11.14      def write(cbuf: Array[Char], off: Int, len: Int)
   11.15      {
   11.16 -      if (len > 0) write(new String(cbuf.subArray(off, off + len)))
   11.17 +      if (len > 0) write(new String(cbuf.slice(off, off + len)))
   11.18      }
   11.19  
   11.20      override def write(str: String)