src/Pure/Isar/outer_syntax.scala
changeset 58694 983e98da2a42
parent 58503 ea22f2380871
child 58695 91839729224e
equal deleted inserted replaced
58693:4c9aa5f7bfa0 58694:983e98da2a42
   132       case Token.Parsers.Success(tokens, _) => tokens
   132       case Token.Parsers.Success(tokens, _) => tokens
   133       case _ => error("Unexpected failure of tokenizing input:\n" + input.toString)
   133       case _ => error("Unexpected failure of tokenizing input:\n" + input.toString)
   134     }
   134     }
   135   }
   135   }
   136 
   136 
   137   def scan_line(input: CharSequence, context: Scan.Line_Context): (List[Token], Scan.Line_Context) =
   137   def scan_line(input: CharSequence, context: Scan.Line_Context, depth: Int)
       
   138     : (List[Token], Scan.Line_Context, Int) =
   138   {
   139   {
   139     var in: Reader[Char] = new CharSequenceReader(input)
   140     var in: Reader[Char] = new CharSequenceReader(input)
   140     val toks = new mutable.ListBuffer[Token]
   141     val toks = new mutable.ListBuffer[Token]
   141     var ctxt = context
   142     var ctxt = context
   142     while (!in.atEnd) {
   143     while (!in.atEnd) {
   144         case Token.Parsers.Success((x, c), rest) => { toks += x; ctxt = c; in = rest }
   145         case Token.Parsers.Success((x, c), rest) => { toks += x; ctxt = c; in = rest }
   145         case Token.Parsers.NoSuccess(_, rest) =>
   146         case Token.Parsers.NoSuccess(_, rest) =>
   146           error("Unexpected failure of tokenizing input:\n" + rest.source.toString)
   147           error("Unexpected failure of tokenizing input:\n" + rest.source.toString)
   147       }
   148       }
   148     }
   149     }
   149     (toks.toList, ctxt)
   150 
       
   151     val depth1 = depth // FIXME
       
   152     (toks.toList, ctxt, depth1)
   150   }
   153   }
   151 
   154 
   152 
   155 
   153   /* parse_spans */
   156   /* parse_spans */
   154 
   157