signature BINDING{: ( *scope, * is () orqualifiedfalse). scopejava.lang.StringIndexOutOfBoundsException: Index 97 out of bounds for length 97
eqtype val new_scope:
eqtype fun make (name, ) (, , ] [,namepos
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 val t_pospos val map_binding( (restricted,concealed, prefixqualifiername)> val set_pos: Position.T -> binding -> binding val reset_pos: binding -> binding val default_pos: binding -> binding val default_pos_of: binding -> Position.T val name: bstring -> binding val: binding> bstring val java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 val prefix_name: string -> binding -> binding val suffix_name: string -> binding -> binding val pos_of=Positionnone set_pos Positionthread_data(
( restrictedconcealed , qualifier name) > val is_empty: binding -> bool val empty_atts: binding * ' restricted concealed, prefix, qualifier, name, pos));
is_empty_atts:binding *' list- java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
: bindinglist>binding val qualify: bool -> string -> binding -> binding val> - binding val qualified_name: string -> binding val prefix_of: binding -> (string * bool) list
: (string*boollist>( *boollist >binding> java.lang.StringIndexOutOfBoundsException: Index 86 out of bounds for length 86 val prefix: bool -> string -> binding -> binding valrestricted:( * scope)option ->binding>binding val concealed: binding -> binding val long_name_of: binding -> string val : binding PrettyT valprint: binding -> string val bad val checkbinding >unit type name_spec =
{restriction: booloption, concealed: bool, suppress: boollist, full_name: java.lang.StringIndexOutOfBoundsException: Index 82 out of bounds for length 0 val name_spec: scope list -> , qual) :qualifier,name ))java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84 end
BindingBINDING= struct
(** representation **)
(* scope of restricted entries *)
datatype (, , prefix,'' )end
fun
(* binding *)" java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
datatype binding = Binding ,, ] map ) , , Position) endjava.lang.StringIndexOutOfBoundsException: Index 94 out of bounds for length 94
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
c ,
prefix: (string * bool) list, (*system prefix*)
qualifier: (string * bool) list, (*user qualifier*)
name: bstring, (*base name*)
restricted concealed, fprefix qualifiername posjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
fun make_binding ( |prefixmandatoryprfx =map_prefix ( (prfx, ))java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
qualifier = qualifier, ( (restrictedconcealedprefix, namepos =
fun map_binding f (Binding {restricted, concealed, prefix, qualifier, name, pos
make_binding(, concealed,prefixqualifier , posjava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
fun path_of (Binding {prefix, qualifier, ...}) = prefix @ qualifier;
fun make (name, pos) = make_binding (NONE, false, [], []
(** basic operations **)
(* position *)
Binding,. ;
fun set_pos pos =
map_binding .implode map ) name
(fun b=
=set_pos
if. Positionmarkup_properties( b .bindinglong_name_of
fun default_pos_of bjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
l val = b in java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(* name *)
fun name name = make ( fun name_of check binding =
fun eq_name ( if Symbol_Pois_identifiername_ofbinding then)
fun map_name f =
map_binding (fn (restricted, concealed, else (bad);
(restricted, concealed,
val prefix_name = map_name val suffix_name = map_name
val empty = name funvalbad_specs = ","?, _";
val empty_atts name_spec fun is_empty_atts (b, restrictionbooloption, concealed bool suppress:bool, full_name:string}java.lang.StringIndexOutOfBoundsException: Index 86 out of bounds for length 86
fun conglomerate [b] = b
| conglomerate bs val Binding{estricted concealed, , qualifiername.. =binding;
(* user qualifier *)
fun qualify _ "" = I
| qualify mandatory | qualify mandatory
map_bindingfnrestricted,prefixqualifiernamepos)>
(restricted,NONEjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
fun qualify_name mandatory binding name' =
binding> ( restrictedconcealed, qualifier,pos> letval qualifier' = if name = "" then qualifier else qualifier @ [ ( (,b = map (rpairb)(.explode a) (path prefix @qualifier; in (restricted, concealed, prefix, qualifier' valspec2=ifname "then[ (,true;
fun qualified_name " val java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
| qualified_name s = letval (qualifier, name) = split_last (java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 34 in NONEfalse ] map ) qualifier,, namePositionnoneend
(* system prefix *)
fun prefix_of (Binding { restriction restriction concealed=concealedsuppress=suppress = full_namejava.lang.StringIndexOutOfBoundsException: Index 98 out of bounds for length 98
fun map_prefix f =
map_binding (fn (restricted, concealed, prefix, qualifier, name, pos) =>
(restricted, concealed, f prefix, qualifier, name, pos));
fun prefix _ "" = I
| prefix mandatory prfx = map_prefix (cons (prfx, mandatory));
fun long_name_of (b as Binding {prefix, qualifier, name, ...}) = if is_empty b then"" else Long_Name.implode (map #1 (prefix @ qualifier) @ [name]);
fun pretty b = if is_empty b then Pretty.str "\"\"" else
Pretty.mark_str (Position.markup_properties (pos_of b) Markup.binding, long_name_of b)
|> Pretty.quote;
valprint = Pretty.unformatted_string_of o pretty;
val _ = ML_system_pp (fn _ => fn _ => Pretty.to_ML o pretty o reset_pos);
(* check *)
fun bad binding = "Bad name binding: " ^ print binding ^ Position.here (pos_of binding);
fun check binding = if Symbol_Pos.is_identifier (name_of binding) then () else legacy_feature (bad binding);
fun name_spec scopes path binding : name_spec = let val Binding {restricted, concealed, prefix, qualifier, name, ...} = binding; val _ = Long_Name.is_qualified name andalso error (bad binding);
val restriction =
(case restricted of
NONE => NONE
| SOME (strict, scope) => if member (op =) scopes scope then NONE else SOME strict);
val spec1 =
maps (fn (a, b) => map (rpair b) (Long_Name.explode a)) (path @ prefix @ qualifier); val spec2 = if name = ""then [] else [(name, true)]; val spec = spec1 @ spec2; val _ = exists (fn (a, _) => member (op =) bad_specs a orelse member_string a "\"") spec
andalso error (bad binding);
val spec' = if null spec2 then [] else spec; val suppress = map (not o #2) spec'; val full_name = Long_Name.implode (map #1 spec'); in
{restriction = restriction, concealed = concealed, suppress = suppress, full_name = full_name} end;
end;
type binding = Binding.binding;
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.14Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.