equal
deleted
inserted
replaced
165 lazy val root_syntax = |
165 lazy val root_syntax = |
166 Outer_Syntax.init() + "(" + ")" + "+" + "," + "=" + "[" + "]" + |
166 Outer_Syntax.init() + "(" + ")" + "+" + "," + "=" + "[" + "]" + |
167 (CHAPTER, Keyword.THY_DECL) + (SESSION, Keyword.THY_DECL) + |
167 (CHAPTER, Keyword.THY_DECL) + (SESSION, Keyword.THY_DECL) + |
168 IN + DESCRIPTION + OPTIONS + GLOBAL_THEORIES + THEORIES + FILES + DOCUMENT_FILES |
168 IN + DESCRIPTION + OPTIONS + GLOBAL_THEORIES + THEORIES + FILES + DOCUMENT_FILES |
169 |
169 |
170 private object Parser extends Parse.Parser |
170 private object Parser extends Parse.Parser with Options.Parser |
171 { |
171 { |
172 private abstract class Entry |
172 private abstract class Entry |
173 private sealed case class Chapter(name: String) extends Entry |
173 private sealed case class Chapter(name: String) extends Entry |
174 private sealed case class Session_Entry( |
174 private sealed case class Session_Entry( |
175 pos: Position.T, |
175 pos: Position.T, |
193 private val session_entry: Parser[Session_Entry] = |
193 private val session_entry: Parser[Session_Entry] = |
194 { |
194 { |
195 val session_name = atom("session name", _.is_name) |
195 val session_name = atom("session name", _.is_name) |
196 |
196 |
197 val option = |
197 val option = |
198 name ~ opt($$$("=") ~! name ^^ { case _ ~ x => x }) ^^ { case x ~ y => (x, y) } |
198 option_name ~ opt($$$("=") ~! option_value ^^ |
|
199 { case _ ~ x => x }) ^^ { case x ~ y => (x, y) } |
199 val options = $$$("[") ~> rep1sep(option, $$$(",")) <~ $$$("]") |
200 val options = $$$("[") ~> rep1sep(option, $$$(",")) <~ $$$("]") |
200 |
201 |
201 val theories = |
202 val theories = |
202 ($$$(GLOBAL_THEORIES) | $$$(THEORIES)) ~! |
203 ($$$(GLOBAL_THEORIES) | $$$(THEORIES)) ~! |
203 ((options | success(Nil)) ~ rep(theory_xname)) ^^ |
204 ((options | success(Nil)) ~ rep(theory_xname)) ^^ |