src/Pure/sign.ML
changeset 12588 0361fd72f1a7
parent 12313 e2cb7e8bb037
child 12785 27debaf2112d
equal deleted inserted replaced
12587:3f3d2ffb5df5 12588:0361fd72f1a7
   140     (string * string * (string -> string * real)) list -> sg -> sg
   140     (string * string * (string -> string * real)) list -> sg -> sg
   141   val add_trrules: (xstring * string) Syntax.trrule list -> sg -> sg
   141   val add_trrules: (xstring * string) Syntax.trrule list -> sg -> sg
   142   val add_trrules_i: ast Syntax.trrule list -> sg -> sg
   142   val add_trrules_i: ast Syntax.trrule list -> sg -> sg
   143   val add_path: string -> sg -> sg
   143   val add_path: string -> sg -> sg
   144   val add_space: string * string list -> sg -> sg
   144   val add_space: string * string list -> sg -> sg
   145   val hide_space: string * string list -> sg -> sg
   145   val hide_space: bool -> string * string list -> sg -> sg
   146   val hide_space_i: string * string list -> sg -> sg
   146   val hide_space_i: bool -> string * string list -> sg -> sg
   147   val add_name: string -> sg -> sg
   147   val add_name: string -> sg -> sg
   148   val data_kinds: data -> string list
   148   val data_kinds: data -> string list
   149   val merge_refs: sg_ref * sg_ref -> sg_ref
   149   val merge_refs: sg_ref * sg_ref -> sg_ref
   150   val merge: sg * sg -> sg
   150   val merge: sg * sg -> sg
   151   val copy: sg -> sg
   151   val copy: sg -> sg
   443 fun cond_extrn_table spaces kind tab = NameSpace.cond_extern_table (space_of spaces kind) tab;
   443 fun cond_extrn_table spaces kind tab = NameSpace.cond_extern_table (space_of spaces kind) tab;
   444 
   444 
   445 (*add / hide names*)
   445 (*add / hide names*)
   446 fun change_space f spaces kind x = overwrite (spaces, (kind, f (space_of spaces kind, x)));
   446 fun change_space f spaces kind x = overwrite (spaces, (kind, f (space_of spaces kind, x)));
   447 fun add_names x = change_space NameSpace.extend x;
   447 fun add_names x = change_space NameSpace.extend x;
   448 fun hide_names x = change_space NameSpace.hide x;
   448 fun hide_names b x = change_space (NameSpace.hide b) x;
   449 
   449 
   450 (*make full names*)
   450 (*make full names*)
   451 fun full _ "" = error "Attempt to declare empty name \"\""
   451 fun full _ "" = error "Attempt to declare empty name \"\""
   452   | full None name = name
   452   | full None name = name
   453   | full (Some path) name =
   453   | full (Some path) name =
  1004 (* change name space *)
  1004 (* change name space *)
  1005 
  1005 
  1006 fun ext_add_space (syn, tsig, ctab, (path, spaces), data) (kind, names) =
  1006 fun ext_add_space (syn, tsig, ctab, (path, spaces), data) (kind, names) =
  1007   (syn, tsig, ctab, (path, add_names spaces kind names), data);
  1007   (syn, tsig, ctab, (path, add_names spaces kind names), data);
  1008 
  1008 
  1009 fun ext_hide_space (syn, tsig, ctab, (path, spaces), data) (kind, xnames) =
  1009 fun ext_hide_space (syn, tsig, ctab, (path, spaces), data) (b, (kind, xnames)) =
  1010   (syn, tsig, ctab, (path, hide_names spaces kind (map (intrn spaces kind) xnames)), data);
  1010   (syn, tsig, ctab, (path, hide_names b spaces kind (map (intrn spaces kind) xnames)), data);
  1011 
  1011 
  1012 fun ext_hide_space_i (syn, tsig, ctab, (path, spaces), data) (kind, names) =
  1012 fun ext_hide_space_i (syn, tsig, ctab, (path, spaces), data) (b, (kind, names)) =
  1013   (syn, tsig, ctab, (path, hide_names spaces kind names), data);
  1013   (syn, tsig, ctab, (path, hide_names b spaces kind names), data);
  1014 
  1014 
  1015 
  1015 
  1016 (* signature data *)
  1016 (* signature data *)
  1017 
  1017 
  1018 fun ext_init_data sg (syn, tsig, ctab, names, data) (kind, (e, cp, ext, mrg, prt)) =
  1018 fun ext_init_data sg (syn, tsig, ctab, names, data) (kind, (e, cp, ext, mrg, prt)) =
  1059 val add_tokentrfuns   = extend_sign true (ext_syn Syntax.extend_tokentrfuns) "#";
  1059 val add_tokentrfuns   = extend_sign true (ext_syn Syntax.extend_tokentrfuns) "#";
  1060 val add_trrules       = extend_sign true ext_trrules "#";
  1060 val add_trrules       = extend_sign true ext_trrules "#";
  1061 val add_trrules_i     = extend_sign true (ext_syn Syntax.extend_trrules_i) "#";
  1061 val add_trrules_i     = extend_sign true (ext_syn Syntax.extend_trrules_i) "#";
  1062 val add_path          = extend_sign true ext_path "#";
  1062 val add_path          = extend_sign true ext_path "#";
  1063 val add_space         = extend_sign true ext_add_space "#";
  1063 val add_space         = extend_sign true ext_add_space "#";
  1064 val hide_space        = extend_sign true ext_hide_space "#";
  1064 val hide_space        = curry (extend_sign true ext_hide_space "#");
  1065 val hide_space_i      = extend_sign true ext_hide_space_i "#";
  1065 val hide_space_i      = curry (extend_sign true ext_hide_space_i "#");
  1066 fun init_data arg sg  = extend_sign true (ext_init_data sg) "#" arg sg;
  1066 fun init_data arg sg  = extend_sign true (ext_init_data sg) "#" arg sg;
  1067 fun put_data k f x sg = extend_sign true (ext_put_data sg) "#" (k, f, x) sg;
  1067 fun put_data k f x sg = extend_sign true (ext_put_data sg) "#" (k, f, x) sg;
  1068 fun add_name name sg  = extend_sign true K name () sg;
  1068 fun add_name name sg  = extend_sign true K name () sg;
  1069 fun prep_ext sg       = extend_sign false K "#" () sg;
  1069 fun prep_ext sg       = extend_sign false K "#" () sg;
  1070 
  1070