equal
deleted
inserted
replaced
387 ( |
387 ( |
388 type T = (((src -> Proof.context -> method) * string) * stamp) NameSpace.table; |
388 type T = (((src -> Proof.context -> method) * string) * stamp) NameSpace.table; |
389 val empty = NameSpace.empty_table; |
389 val empty = NameSpace.empty_table; |
390 val copy = I; |
390 val copy = I; |
391 val extend = I; |
391 val extend = I; |
392 fun merge _ tables : T = NameSpace.merge_tables (eq_snd (op =)) tables handle Symtab.DUPS dups => |
392 fun merge _ tables : T = NameSpace.merge_tables (eq_snd (op =)) tables handle Symtab.DUP dup => |
393 error ("Attempt to merge different versions of method(s) " ^ commas_quote dups); |
393 error ("Attempt to merge different versions of method " ^ quote dup); |
394 ); |
394 ); |
395 |
395 |
396 fun print_methods thy = |
396 fun print_methods thy = |
397 let |
397 let |
398 val meths = MethodsData.get thy; |
398 val meths = MethodsData.get thy; |
428 let |
428 let |
429 val new_meths = raw_meths |> map (fn (name, f, comment) => |
429 val new_meths = raw_meths |> map (fn (name, f, comment) => |
430 (name, ((f, comment), stamp ()))); |
430 (name, ((f, comment), stamp ()))); |
431 |
431 |
432 fun add meths = NameSpace.extend_table (Sign.naming_of thy) new_meths meths |
432 fun add meths = NameSpace.extend_table (Sign.naming_of thy) new_meths meths |
433 handle Symtab.DUPS dups => |
433 handle Symtab.DUP dup => error ("Duplicate declaration of method " ^ quote dup); |
434 error ("Duplicate declaration of method(s) " ^ commas_quote dups); |
|
435 in MethodsData.map add thy end; |
434 in MethodsData.map add thy end; |
436 |
435 |
437 val add_method = add_methods o Library.single; |
436 val add_method = add_methods o Library.single; |
438 |
437 |
439 |
438 |