src/Pure/Thy/sessions.scala
changeset 75998 c36e5c6f3069
parent 75997 90ff9ed0cd75
child 75999 b831a0bdd751
equal deleted inserted replaced
75997:90ff9ed0cd75 75998:c36e5c6f3069
   930             Position.here(old_entry.pos) + Position.here(entry.pos))
   930             Position.here(old_entry.pos) + Position.here(entry.pos))
   931       }
   931       }
   932   }
   932   }
   933 
   933 
   934   private object Parsers extends Options.Parsers {
   934   private object Parsers extends Options.Parsers {
       
   935     private val description: Parser[String] =
       
   936       ($$$(DESCRIPTION) ~! text ^^ { case _ ~ x => x }) | success("")
       
   937 
   935     private val chapter_def: Parser[Chapter_Def] =
   938     private val chapter_def: Parser[Chapter_Def] =
   936       command(CHAPTER_DEFINITION) ~!
   939       command(CHAPTER_DEFINITION) ~! (position(chapter_name) ~ description) ^^
   937         (position(chapter_name) ~ $$$(DESCRIPTION) ~ text) ^^
   940         { case _ ~ ((a, pos) ~ b) => Chapter_Def(pos, a, b) }
   938         { case _ ~ ((a, pos) ~ _ ~ b) => Chapter_Def(pos, a, b) }
       
   939 
   941 
   940     private val chapter_entry: Parser[Chapter_Entry] =
   942     private val chapter_entry: Parser[Chapter_Entry] =
   941       command(CHAPTER) ~! chapter_name ^^ { case _ ~ a => Chapter_Entry(a) }
   943       command(CHAPTER) ~! chapter_name ^^ { case _ ~ a => Chapter_Entry(a) }
   942 
   944 
   943     private val session_entry: Parser[Session_Entry] = {
   945     private val session_entry: Parser[Session_Entry] = {
   976       command(SESSION) ~!
   978       command(SESSION) ~!
   977         (position(session_name) ~
   979         (position(session_name) ~
   978           (($$$("(") ~! (rep1(name) <~ $$$(")")) ^^ { case _ ~ x => x }) | success(Nil)) ~
   980           (($$$("(") ~! (rep1(name) <~ $$$(")")) ^^ { case _ ~ x => x }) | success(Nil)) ~
   979           (($$$(IN) ~! path ^^ { case _ ~ x => x }) | success(".")) ~
   981           (($$$(IN) ~! path ^^ { case _ ~ x => x }) | success(".")) ~
   980           ($$$("=") ~!
   982           ($$$("=") ~!
   981             (opt(session_name ~! $$$("+") ^^ { case x ~ _ => x }) ~
   983             (opt(session_name ~! $$$("+") ^^ { case x ~ _ => x }) ~ description ~
   982               (($$$(DESCRIPTION) ~! text ^^ { case _ ~ x => x }) | success("")) ~
       
   983               (($$$(OPTIONS) ~! options ^^ { case _ ~ x => x }) | success(Nil)) ~
   984               (($$$(OPTIONS) ~! options ^^ { case _ ~ x => x }) | success(Nil)) ~
   984               (($$$(SESSIONS) ~! rep1(session_name)  ^^ { case _ ~ x => x }) | success(Nil)) ~
   985               (($$$(SESSIONS) ~! rep1(session_name)  ^^ { case _ ~ x => x }) | success(Nil)) ~
   985               (($$$(DIRECTORIES) ~! rep1(path) ^^ { case _ ~ x => x }) | success(Nil)) ~
   986               (($$$(DIRECTORIES) ~! rep1(path) ^^ { case _ ~ x => x }) | success(Nil)) ~
   986               rep(theories) ~
   987               rep(theories) ~
   987               (opt(document_theories) ^^ (x => x.getOrElse(Nil))) ~
   988               (opt(document_theories) ^^ (x => x.getOrElse(Nil))) ~