src/Pure/Thy/thy_syntax.scala
changeset 36956 21be4832c362
parent 36948 d2cdad45fd14
child 38239 89a4d1028fb3
equal deleted inserted replaced
36955:226fb165833e 36956:21be4832c362
    20       val body = not(rep(whitespace) ~ (command | eof)) ~> not_eof
    20       val body = not(rep(whitespace) ~ (command | eof)) ~> not_eof
    21       command ~ rep(body) ^^ { case x ~ ys => x :: ys } | rep1(whitespace) | rep1(body)
    21       command ~ rep(body) ^^ { case x ~ ys => x :: ys } | rep1(whitespace) | rep1(body)
    22     }
    22     }
    23   }
    23   }
    24 
    24 
    25   type Span = List[Outer_Lex.Token]
    25   type Span = List[Token]
    26 
    26 
    27   def parse_spans(toks: List[Outer_Lex.Token]): List[Span] =
    27   def parse_spans(toks: List[Token]): List[Span] =
    28   {
    28   {
    29     import parser._
    29     import parser._
    30 
    30 
    31     parse(rep(command_span), Outer_Lex.reader(toks)) match {
    31     parse(rep(command_span), Token.reader(toks)) match {
    32       case Success(spans, rest) if rest.atEnd => spans
    32       case Success(spans, rest) if rest.atEnd => spans
    33       case bad => error(bad.toString)
    33       case bad => error(bad.toString)
    34     }
    34     }
    35   }
    35   }
    36 }
    36 }