# HG changeset patch # User wenzelm # Date 1184192134 -7200 # Node ID f37ff1f39fe981517db0bca3718a8b36913f4d79 # Parent b094f9b7a52db5aee7a3989c221e31ae660c8b89 exported command_keyword; tuned; diff -r b094f9b7a52d -r f37ff1f39fe9 src/Pure/Isar/outer_syntax.ML --- a/src/Pure/Isar/outer_syntax.ML Thu Jul 12 00:15:30 2007 +0200 +++ b/src/Pure/Isar/outer_syntax.ML Thu Jul 12 00:15:34 2007 +0200 @@ -27,6 +27,7 @@ type token type parser val get_lexicons: unit -> Scan.lexicon * Scan.lexicon + val command_keyword: string -> OuterKeyword.T option val command: string -> string -> OuterKeyword.T -> (token list -> (Toplevel.transition -> Toplevel.transition) * token list) -> parser val markup_command: ThyOutput.markup -> string -> string -> OuterKeyword.T -> @@ -133,10 +134,9 @@ fun get_parsers () = ! global_parsers; fun get_parser () = Option.map (#2 o #1) o Symtab.lookup (get_parsers ()); -fun command_tags name = - (case Symtab.lookup (get_parsers ()) name of - SOME (((_, k), _), _) => OuterKeyword.tags_of k - | NONE => []); +fun command_keyword name = + Option.map (fn (((_, k), _), _) => k) (Symtab.lookup (get_parsers ()) name); +fun command_tags name = these ((Option.map OuterKeyword.tags_of) (command_keyword name)); fun is_markup kind name = (AList.lookup (op =) (! global_markups) name = SOME kind); @@ -249,14 +249,14 @@ let val src = Source.of_string (File.read path); val pos = Position.path path; - val (name', parents, files) = ThyHeader.read (src, pos); + val (name', imports, uses) = ThyHeader.read (src, pos); val ml_path = ThyLoad.ml_path name; val ml_file = if ml andalso is_some (ThyLoad.check_file NONE ml_path) then [ml_path] else []; in if name <> name' then error ("Filename " ^ quote (Path.implode path) ^ " does not agree with theory name " ^ quote name') - else (parents, map (Path.explode o #1) files @ ml_file) + else (imports, map (Path.explode o #1) uses @ ml_file) end;