src/Pure/Thy/thy_output.ML
changeset 23942 079e99db59d7
parent 23935 2a4e42ec9a54
child 24680 0d355aa59e67
equal deleted inserted replaced
23941:6234185a2e2e 23942:079e99db59d7
    61   else warning ("Redefined text antiquotation " ^ kind ^ ": " ^ quote name);
    61   else warning ("Redefined text antiquotation " ^ kind ^ ": " ^ quote name);
    62   Symtab.update (name, x) tab);
    62   Symtab.update (name, x) tab);
    63 
    63 
    64 in
    64 in
    65 
    65 
    66 val add_commands = Library.change global_commands o fold (add_item "command");
    66 fun add_commands xs = CRITICAL (fn () => change global_commands (fold (add_item "command") xs));
    67 val add_options = Library.change global_options o fold (add_item "option");
    67 fun add_options xs = CRITICAL (fn () => change global_options (fold (add_item "option") xs));
    68 
    68 
    69 fun command src =
    69 fun command src =
    70   let val ((name, _), pos) = Args.dest_src src in
    70   let val ((name, _), pos) = Args.dest_src src in
    71     (case Symtab.lookup (! global_commands) name of
    71     (case Symtab.lookup (! global_commands) name of
    72       NONE => error ("Unknown text antiquotation command: " ^ quote name ^ Position.str_of pos)
    72       NONE => error ("Unknown text antiquotation command: " ^ quote name ^ Position.str_of pos)
    73     | SOME f => transform_failure (curry Antiquote.ANTIQUOTE_FAIL (name, pos)) (f src))
    73     | SOME f => f src)
    74   end;
    74   end;
    75 
    75 
    76 fun option (name, s) f () =
    76 fun option (name, s) f () =
    77   (case Symtab.lookup (! global_options) name of
    77   (case Symtab.lookup (! global_options) name of
    78     NONE => error ("Unknown text antiquotation option: " ^ quote name)
    78     NONE => error ("Unknown text antiquotation option: " ^ quote name)