clarified signature --- fewer warnings;
authorwenzelm
Thu, 04 Mar 2021 21:19:05 +0100
changeset 73615 894f29abe5fc
parent 73614 77ef8bef0593
child 73616 ffdb22a155b4
clarified signature --- fewer warnings;
src/Pure/Thy/thy_header.scala
src/Pure/Thy/thy_syntax.scala
--- a/src/Pure/Thy/thy_header.scala	Thu Mar 04 21:04:27 2021 +0100
+++ b/src/Pure/Thy/thy_header.scala	Thu Mar 04 21:19:05 2021 +0100
@@ -186,10 +186,10 @@
   private def read_tokens(reader: Reader[Char], strict: Boolean): (List[Token], List[Token]) =
   {
     val token = Token.Parsers.token(bootstrap_keywords)
-    def make_tokens(in: Reader[Char]): Stream[Token] =
+    def make_tokens(in: Reader[Char]): LazyList[Token] =
       token(in) match {
         case Token.Parsers.Success(tok, rest) => tok #:: make_tokens(rest)
-        case _ => Stream.empty
+        case _ => LazyList.empty
       }
 
     val all_tokens = make_tokens(reader)
--- a/src/Pure/Thy/thy_syntax.scala	Thu Mar 04 21:04:27 2021 +0100
+++ b/src/Pure/Thy/thy_syntax.scala	Thu Mar 04 21:19:05 2021 +0100
@@ -27,7 +27,7 @@
       val visible = new mutable.ListBuffer[Command]
       val visible_overlay = new mutable.ListBuffer[Command]
       @tailrec
-      def check_ranges(ranges: List[Text.Range], commands: Stream[(Command, Text.Offset)]): Unit =
+      def check_ranges(ranges: List[Text.Range], commands: LazyList[(Command, Text.Offset)]): Unit =
       {
         (ranges, commands) match {
           case (range :: more_ranges, (command, offset) #:: more_commands) =>
@@ -55,7 +55,7 @@
 
       val commands =
         (if (overlays.is_empty) node.command_iterator(perspective.range)
-         else node.command_iterator()).toStream
+         else node.command_iterator()).to(LazyList)
       check_ranges(perspective.ranges, commands)
       (Command.Perspective(visible.toList), Command.Perspective(visible_overlay.toList))
     }